How to Install Ubuntu 14.04+ on MacPro 1,1 (EFI boot mode)

An Apple MacPro box, even old one, makes a nice home server. It has 4 SATA bays + 2 onboard SATA ports, ECC memory, looks much better than any enterprise ECC-capable server box, and can be found pretty cheap.

Why boot in EFI mode? Up to Ubuntu 14.04 there were +mac disc images that had let you boot in BIOS compatibility mode and worked just fine, except for one issue: 2 extra SATA ports on motherboard were disabled in non-EFI boot mode, precluding their use, e.g. as a system boot drive. I wanted to boot from a 16GB M.2 SSD in a PCIe to M.2 adapter, so I found a way to boot in EFI.

What are the problems? If you’re reading this, you most likely have encountered some of them:

  1. How to select boot device? How to keep the selection?
  2. Linux hangs during boot (avoided with noefi kernel option)
  3. Linux doesn’t boot from the hard drive after installation

Note that MacPro 1,1 boxes, while being 64-bit, have an added challenge of EFI32 boot system. While it’s possible to run 32-bit Linux in PAE mode, it’s uncool and, surprisingly, makes MacPro consume more energy, according to my Kill-o-watt.

So here is the deal:

Prepare Boot Media

  1. Partition a USB stick with a GPT partition table, format it to FAT32 and set bootable flag (gparted is a good tool to use).
  2. Get the helpful tarball containing EFI-compatible GRUB and unpack it into the USB stick’s root folder
  3. Download “linux” and “initrd.gz” files from Ubuntu netinstall: 64-bit or 32-bit
  4. Edit “grub.cfg” and add the following lines:
  5. menuentry "Install Linux 64bit" {
       fakebios
       linux /efi/boot/linux priority=low vga=normal video=efifb noefi
       initrd /efi/boot/initrd.gz
    }
  6. note “noefi” kernel parameter – it works around the issue of MacPro EFI implementation hanging kernel boot in recent kernels (14.04 is OK, 16.04 will hang).
  7. You are now ready to boot

Select a Boot Device

  1. Select boot device: hold Option (Alt) key as you reboot the box – it will show you boot device selector. Select the USB stick prepared above. (Note: Ctrl-click makes this selection permanent)

Installation

  1. Boot normally, run the installer.
  2. During disk partitioning, make a EFI partition, mountable as /boot/efi, in addition to whatever disk layout you like,
  3. Install system, packages,
  4. When installing GRUB, if it asks whether to install it on removable media, agree. This is very useful if the system does not show grub prompt after reboot from the hard drive.

Booting From the Hard Drive

  1. Reboot, select your new hard drive as a boot device. It should show grub command prompt.
    1. If it does not, patch the contents of target drive’s EFI directory: reboot, select USB again, start installer and then drop to shell (Ctrl-Alt-F1). Mount EFI partition on the target hard drive (mount -t vfat /dev/<dev> /mnt/<folder>), mount USB EFI parititon, and then copy /efi/ubuntu directory from USB stick to the corresponding directory on the target drive. Also copy *.efi files from /efi/boot. Repeat [1].
  2. At GRUB prompt, tell GRUB how to boot from your hard drive:
  3. ls
        <this shows your hard drives, you can also ls (hd0,1)/ to see files>
        <find the target drive>
    set prefix=(hd0,3)/boot/grub
    insmod normal
    normal
  4. At this point you will see GRUB boot menu, but we still need to add “noefi” parameter for 16.04+ – edit GRUB entry, and add the parameter, then continue booting from that entry.
  5. Once booted from the hard drive, update GRUB config to boot normally:
    1. edit “/etc/default/grub”, add ” noefi” to parameters in GRUB_CMDLINE_LINUX_DEFAULT=”…”
    2. run “sudo update-grub”
  6. Reboot, select your new hard drive as boot device. Hold Ctrl key when selecting, this will make the choice permanent.

 You’re done! What next? How about making it sleep and wake up on access attempt, to avoid paying big bucks for its electricity when idle?

8 thoughts on “How to Install Ubuntu 14.04+ on MacPro 1,1 (EFI boot mode)

  1. pilip

    This post let me boot(or at least get the boot menu) from a usb stick, but I kept getting kernel panic with ‘noinitrd’ and by specifying the initrd file. I was able to boot the installer by using the ‘linux’ and ‘initrd.gz’ files from this iso: http://cdimage.ubuntu.com/releases/14.04/release/ubuntu-14.04.3-server-amd64+mac.iso

    I go through the install just fine(although grub install doesn’t bug me about picking the drive to install to) but when the installation finishes and the machine reboots, I don’t see the install drive(where Ubuntu was installed to) as one of the options to boot to on the Boot Menu of the Mac Pro. I have mac pro 1,1 too.

    Did you ever ran into this? I hope you could help me out or give me pointers. Thanks a lot in advance! I really appreciate this post.

    Reply
    1. admin Post author

      Hi Pilip,

      Thanks for noticing the noinitrd error – I copied by mistake the entry I made for testing kernels with efi patch. Corrected now.

      Re: not seeing it in boot menu – EFI boot requires a win32 GPT partition with “boot” attribute (Installation, step 3). If there is one on your disk, it should show up in the menu.

      I hope this helps!
      Sergey

      Reply
  2. Joseph Sirucka

    Hi I was not able to install the 14.04 desktop from the iso image. The 14.04 server iso image. Everytime it hanged up at the grub installation procedure. Seems on the server version it work with the grub installation. I was able to use a pci card with a ssd. I am able to boot from the pci card. It seems I am not able to detect the sata disks from the + 2 sata ports. I have updated to 16.10 ubuntu. Is there anything special to make the + 2 extra sata ports detected on the macpro 1,1.

    Reply
    1. admin Post author

      If the system is not seeing 2 additional SATA ports the only reason I can think of is you are not booting in EFI boot mode. You are not using installation images with “mac” in the file name, by the chance?

      Reply
  3. madmalkav

    Thanks for your guide, it have provided me a lot of valuable info.

    I have found an alternative method -I think easier- for installing in Mac Pro 1.1 using EFI mode. Debian have an image, multiarch, specially thought for systems with 32 bit EFI and 64 bit CPUs. For being able to boot that image, your method is valid, or, for making a bootable DVD, you can use the ISO converter in this link:

    https://mattgadient.com/2016/07/11/linux-dvd-images-and-how-to-for-32-bit-efi-macs-late-2006-models/

    My only problem is I wasn’t able to get it to boot directly, and also didn’t got Refind to install OK. Creating a Refind USB boot disk and copying its boot folder to /boot/efi/EFI works OK. Will try to figure out why it is that to provide a cleaner solution.

    Reply
    1. admin Post author

      I was happy not to use Refind and boot directly. Actually, all worked nicely practically out of the box, I just needed the right version of Grub and danced around EFI boot hang issue in newer kernels.

      Reply
      1. madmalkav

        I’m surely doing something wrong with the EFI partition. I reinstalled formating the other FS but leave the EFI one intact, and after that it boot directly to grub without Refind.

        Reply
        1. madmalkav

          Ok, I confirm I did something wrong the other day, I did the 64 bit expert install , select Yes for the removable media question, and it installed flawlessly .

          Reply

Leave a Reply

Your email address will not be published. Required fields are marked *