Dual-boot Windows 7 and Ubuntu on two SSDs with UEFI
I recently built a new system with (Asus)UEFI and two SSDs for boot drives, and an HDD for storage. I installed Windows on the first SSD through the UEFI, and it works fine, I've been using it for a couple of weeks now. When I enter the UEFI setting, however, it did not give me the option to set the second SSD as the boot device, even in advanced mode. I instead booted into the live CD (which worked with no problems) and installed ubuntu to the second SSD from there (which also seemed to work with no problems).
The problem is, now I can't figure out how to boot into Ubuntu, only Windows. The UEFI still only lets me choose the Windows SSD or the DVD drive to boot from, and neither Grub nor the Windows bootloader appears when I turn on the machine. Do I need to set the device for boot loader installation to be my Windows drive?
Does anyone who has set up a similar system know what might be causing this? Any help is appreciated.
EDIT: I used EasyBCD to add my "/boot" partition to the Windows bootloader, and now it gives me the option to boot to ubuntu--but when I try, it just gives me the Grub rescue prompt without actually loading the kernel.
EDIT2: I followed the procedure in the first section of the UEFI Community Documentation. I ran the boot-repair twice, and now I get the Grub menu on booting--but when I choose any "Ubuntu" option, all I get is a blinking underscore. No prompt or anything, just a black screen with a white underscore. I tried entering several commands, but nothing produced any feedback.
I have several operating systems on my laptop which has three hard drives (Windows 8 on HDD1, Ubuntu LTS and Fedora on HDD2, latest version of Ubuntu on HDD3/SSD). They all have independent EFI System Partitions (ESP).
Add missing UEFI NVRAM entry
Given that your Ubuntu installation has a working installation of grub-efi
(that is if boot-repair didn't overwrite it with something else, or there was no grub-efi
to begin with, or no ESP on the Ubuntu SSD), you could add the Ubuntu bootmenu entry to UEFI NVRAM with the following command:
sudo efibootmgr --create --disk /dev/sdc --part 1 --label "Ubuntu" --loader \\EFI\\ubuntu\\grubx64.efi
Note that sdc
is my third hard drive and --part 1
my ESP in this example. If your Ubuntu SSD is the second drive in your computer and you have to create the probably missing ESP (e.g. if just have a root /
and swap partition on the Ubuntu SSD) your parameters would be sdb
and --part 3
.
Reinstall grub-efi to ESP and root filesystem
To reinstall grub-efi
you could boot the live media in UEFI mode, mount the Ubuntu root filesystem on the SSD and the ESP respectively within that mountpoint (e.g. $mountpoint_of_external_root_filesystem/boot/efi
) and run the following command:
sudo grub-install --boot-directory $mountpoint_of_external_root_filesystem/boot/efi /dev/sdc
Again, sdc
is my third hard drive, replace it as well as the path to the mountpoint of the ESP correspondingly. Run efibootmgr
afterwards and check if you have a ubuntu
entry, if not run the efibootmgr
command from above and check again.
Ubuntu for some reason doesn't ship a default UEFI bootloader, which could get you in trouble if the NVRAM entry is missing (e.g. after a firmware update, formerly called BIOS update). You could copy EFI/ubuntu
on the ESP to EFI/BOOT
and make a copy of grubx64.efi
or shimx64.efi
named BOOTX64.EFI
or install gummiboot (see related) to have a fallback.
Related questions and answers
- How do I remove "Ubuntu" in the bios boot menu? (UEFI)
- https://askubuntu.com/a/434532/40581 my answer on how to install and configure Gummiboot as default hotpluggable UEFI bootloader - I need to write a clean version of this when I have time :(