Why did Ubuntu 16.04.2 install the loader on Macbook Pro hard drive despite being told to put it on USB hard drive?
Macbook Pro 12,1 with OS X 10.11.6; installing using Ubuntu 16.04.2-desktop-amd64.iso
Trying to install Ubuntu 16 to a USB hard drive, for use with my Macbook Pro, which I have set up with Boot Camp and Windows 10. So I put the installer on a USB stick, booted using it, and set stuff up in the partition manager as per this photo.
(Why am I adding an EFI partition? Because it had already gone wrong once, and I thought I'd try again, this time taking photos, and wondered whether maybe adding an EFI partition to the USB hard drive would help it decide to do the right thing. Anyway, I'm the one asking the questions here.)
Note device selected for boot loader installation.
I clicked Install Now
.
That all seemed in order, so I clicked Continue
and let it install. And what ended up happening was that the boot loader was installed on /dev/sda1
, and /dev/sdd1
was left blank.
This made a bit of a mess:
Switch on with USB hard drive connected: Ubuntu boot menu appears, with an option for Ubuntu and an option for Windows 10 (which works). No sign of OS X
Switch on with USB hard drive disconnected: grub text console. I don't know how to use this, because when I typed
help
I got several pages of output that immediately scrolled away and I decided life was too shortSwitch on while holding Alt: standard Apple boot menu appears, allowing selection of OS X and Windows as before. But even when USB hard drive is connected, there's no sign of Ubuntu
It's fairly easy to remove the loader (mount EFI partition and remove the ubuntu
folder there), so now I'm back where I was.
But I'm still a bit confused. What, if anything, did I do wrong? Why did the loader end up on /dev/sda1
rather than /dev/sdd1
?
(This doesn't answer my direct question, but making it work proved more annoying than I expected so I thought I'd post some notes.)
In the end I seem to have got it working to my satisfaction. Armed with the ubuntu
folder that the installer had added to my Macbook's EFI partition, my USB hard drive with an empty EFI partition, and @oldfred's comments, I filled the USB hard drive's EFI partition as follows:
- make folder in root of empty EFI partition called
EFI
- copy
ubuntu
folder (that the installer added) into the newEFI
folder - make folder in
EFI
calledBoot
- move
EFI/ubuntu/grubx64.efi
andEFI/ubuntu/MokManager.efi
intoEFI/Boot
- move
EFI/ubuntu/shimx64.efi
intoBoot
, and rename it toBOOTx64.EFI
- Edit
EFI/ubuntu/grub.cfg
, find thesearch.fs_uuid
line, and remove the device specifier from the end (so it reads justsearch.fs_uuid <<GUID>> root
).
My USB disk then appears in the Apple boot menu when it's connected. And when selected, it brings up the usual boot menu, and I can select Ubuntu
and off it goes.
As a final step, once up and running, I edited /etc/fstab
to mount the USB disk's EFI partition, rather than the MBP's.
(I don't know whether step 6 is vital, and I don't know whether these file names are case-sensitive. This took numerous reboots and I don't fancy doing much more additional experimentation.)