Dual-Boot – How to Fix GRUB2 Not Loading Ubuntu

dual-bootgrub2

Having an issue with a dual boot setup that is being run from Windows boot manager. I can successfully load into grub2 from Windows boot manager, however it seems that grub2 cannot locate to the Kernel or something, as it is dropping me right into a shell with the following output:

[ Minimal BASH-like line editing is suported. For the First word, TAB
list the posible command completion. Anywhere else tab list the posible
completions of a device/filename,]

grub>

I have used Easybcd in the past and successfully loaded a Linux grub through Windows bootloader, but this was when both operating systems were on the same partition, but since my OS installationd are now on separate partitions it seems EasyBcd cant work its magic.

ONe encouragement is that I was able to get Easybcd to load a working Grub if I used the Neo grub bootloader and edit the confg with:

title Ubuntu 14.04
find --set-root /boot/vmlinuz-3.19.0-61-generic
kernel /boot/vmlinuz-3.19.0-61-generic ro root=/dev/sdc
initrd /boot/initrd.img-3.19.0-61-generic

however this loads in Grub4DOS which is very slow, and as of today this method stopped working See THIS POST for details).

Here is the output of EasyBcd Settings for all the different methods I have tried for the Ubuntu 14.04 installation:

Default: Windows 7
Timeout: 30 seconds
Boot Drive: C:\

Entry #1
Name: Windows 7
BCD ID: {current}
Drive: C:\
Bootloader Path: \Windows\system32\winload.exe

Entry #2
Name: Ubuntu 14.04 Legacy
BCD ID: {a4f127cf-3150-11e6-8aaf-408d5cb9e442}
Drive: C:\
Bootloader Path: \NST\nst_linux.mbr

Entry #3
Name: Ubuntu 14.04 Grub2
BCD ID: {a4f127d0-3150-11e6-8aaf-408d5cb9e442}
Drive: C:\
Bootloader Path: \NST\AutoNeoGrub0.mbr

Entry #4
Name: Ubuntu Neo Grub
BCD ID: {a4f127d1-3150-11e6-8aaf-408d5cb9e442}
Drive: C:\
Bootloader Path: \NST\NeoGrub.mbr

*It seems that none of the paths seen above are pointing to my dev/sdc2/ partition which would be considered DISK1 on my Windows Volume manager.


EDIT – In the confusion of attempting to get a working bootmanager for Ubuntu/Windows, you will see that grub and Windows Boot manager have all been installed in numerous locations. Below are the present locations and contents of all bootmanager & Grub installations:

dev/sdb Windows7 drive

/dev/sdb1 – 512 MB fat32 partition which is currently empty

/dev/sdb2 – 110 GB ntfs partition containing Windows7 installation. This partition contains a 'Boot' folder which contains BCD files and a whole wack of langauage folders. THIS IS The FOLDER THAT WINDOWS BOOTLOADER uses.

/dev/sdb4 – 121.53 ntfs partition containing storage for media


dev/sdd – Ubuntu Drive

dev/sdd1 – 512 MB partition containing a 'EFI' folder, inside of which are two folders 'grub' and 'Ubuntu', both of which contain the exact same files (grub.cfg, grubx64.efi, MokManager.efi, shium64.efi)

dev/sdd2 – 48.83 GB ext4 partition that contains the '/' folder and Ubuntu instalation.

dev/sdd3 – 69.91 GB ntfs partition containing storage for media

what do I need to do so that the Grub shell I am being dropped into will load up Ubuntu? HOw can I get this machine to dual boot out of Grub?

Best Answer

You have two options - using the GRUB boot loader (what I recommend) or the Windows loader. First remove all the Ubuntu or GRUB entries you had created in the Windows BCD store before. To list all identifiers open command prompt as administrator, execute : bcdedit /enum all /v

To delete the Ubuntu entries execute : bcdedit /delete {*} for each Ubuntu entry you have. Replace * with the Ubuntu identifier to delete - be careful and don't delete the Windows entry. Additionally I recommend to uninstall EasyBCD to avoid further problems with BCD operations.

Method 1 : GRUB boot loader

Boot from the Ubuntu installation media and select Try Ubuntu without installing, once on the Live desktop open GParted to identify the disk and partitions where the operating systems are installed. In most cases the disk is sda, the Windows partition on msdos partition table sda1.

Now install the GRUB boot loader from which you can boot Ubuntu and Windows to the disk in Legacy BIOS (msdos partition table) mode - so open a terminal and execute these commands :

sudo mount /dev/sd** /mnt  
sudo grub-install --boot-directory=/mnt/boot /dev/sd*

Replace sd* (disk) and sd** (Ubuntu partition) with the letters and number you've identified.

In case the systems are installed in UEFI BIOS mode ... install the GRUB boot loader in EFI mode.

sudo mount /dev/sd*** /mnt
sudo mount /dev/sd** /mnt/boot/efi
for i in /dev /dev/pts /proc /sys /run; do sudo mount -B $i /mnt$i; done
sudo chroot /mnt
grub-install /dev/sd*
update-grub  

Replace sd* (disk), sd** (efi partition), sd*** (Ubuntu partition) with what you've identified.

Boot into BIOS and change the boot order in UEFI settings - select Ubuntu to be the default OS.

Method 2 : Windows boot loader

Boot from the Ubuntu installation media and select Try Ubuntu without installing, once on the Live desktop open GParted to identify the disk and partitions where the operating systems are installed. In most cases the disk is sda, the Windows partition on msdos partition table sda1.

First mount the Windows partition, open a terminal, execute : sudo mount /dev/sd*** /mnt
Replace sd*** (Windows partition) with the letters and number you have identified before.

Copy the first 512 bytes of Ubuntu : dd if=/dev/sd** of=/mnt/linux.bin bs=512 count=1
Replace sd** (Ubuntu partition) with the letters and number you've had identified before.

Boot into Windows, open command prompt as administrator and execute these commands :

bcdedit /create /d Ubuntu /application bootsector
bcdedit /set {identifier} device partition=c:
bcdedit /set {identifier} path \linux.bin
bcdedit /displayorder {identifier} /addlast  
bcdedit /timeout X  

Replace "identifier" with the characters, letters and numbers being returned when you executed the first command and replace "X" with the number of seconds (for instance 10) you want to see the Windows boot loader menu - before it automatically will boot the default operating system.

Related Question