Sunday, August 11, 2019

grub2 - Must go through Windows Boot Loader to get to Grub



I just installed a fresh copy of Precise alongside Windows 7. I have to separate 750GB hard drives; /dev/sda holds the Windows partitions and /dev/sdb holds the Ubuntu partitions. Other than that, these are fresh installs of both Windows 7 and Ubuntu 12.04.



Whenever I boot, Grub doesn't load, instead it goes to a black screen with a single blinking (horizontal bar) cursor in the top right corner. However, if I boot, hit escape right as the BIOS/POST screen finishes up, see the Windows Boot Loader and hit escape to make it go back to the BIOS screen. After the BIOS screen, grub shows up and everything functions normally; I can boot into Ubuntu or Win7.




I don't want to have to do the Escape, Escape, Wait, Boot trick every time. I have no idea what would be wrong or what information I could give you guys to help diagnose. I have run a sudo update-grub and it found everything normally. I tried adding nomodeset flag in the /etc/default/grub line GRUB_CMDLINE_LINUX_DEFAULT which searching around made me think might work.



Thoughts on what I could do to fix this?



EDIT: I've tried changing the boot order so that both drives in the BIOS (both are labeled as "Internal HDD") have had a try booting first. I think the problem may be that every time I boot, the BIOS boot order is different... and I have to reset it. It seems to not be stable... but I'm not sure how to go about fixing that either.



The machine has both traditional BIOS and UEFI. It came standard in "Legacy" mode; so it is currently set to boot through Legacy mode. I've reinstalled Ubuntu now, and now if I hit escape at the end of the BIOS/POST startup screen, it takes me to GRUB menu. Otherwise it automatically loads Windows. It seems like GRUB is now the acting bootloader, it just doesn't automatically start that unless I ask it to open a bootloader. In my other machines, it has always automatically started at the end of BIOS/POST.



EDIT2: Using gparted, I just looked at my partitions, it would seem that my linux-swap partition is currently flagged as the boot partition for my Ubuntu install. I currently only have 2 partitions: one of "ext4" with a mount point of "/" and flag " "; and the "linux-swap" with mount point " " and flag "boot."




If I change the boot flag to be on "/," it does not reliably solve the problem. After 10 boots:




  • 2 Booted successfully to GRUB

  • 5 Booted directly to Windows 7

  • 3 booted to the black screen with the cursor and hung there



Further research makes me think this is an issue of the BIOS not reliably booting hard drives in the same order or not finding both hard drives. If I ask it to create a "boot menu" sometimes it has 2 entries for "Internal HDD," sometimes 1. Also the list it creates changes order every time I bring it up; so it is not following a consistent boot sequence. Will report back if this is not an issue with GRUB.




EDIT3: After changing the 'boot flags' about a bit, I have found a pattern. This machine actually has 3 hard drives, 2 SATA 750GB ('sda' and 'sdb') and a 128GB SSD ('sdc'). When I boot, I think it is loading from a different one of them each time in this order: 'sda' (Windows loads with no boot loader), 'sdc' (black screen with cursor), then 'sdb' (GRUB loads and I can choose to load windows or Ubuntu). I think the problem is trying to tell the BIOS to reliably choose a partition to boot from; not in the way Ubuntu installed.



After changing the 'boot flags' about a bit, I have found a pattern. This machine actually has 3 hard drives, 2 SATA 750GB ('sda' and 'sdb') and a 128GB SSD ('sdc'). When I boot, I think it is loading from a different one of them each time in this order: 'sda' (Windows loads with no boot loader), 'sdc' (black screen with cursor), then 'sdb' (GRUB loads and I can choose to load windows or Ubuntu).



I can't see for sure what device it is booting from, but this pattern makes sense given the system setup and my knowledge of how the drives are setup.



I think the problem is trying to tell the BIOS to reliably choose a partition to boot from; not in the way Ubuntu installed.


No comments:

Post a Comment

11.10 - Can't boot from USB after installing Ubuntu

I bought a Samsung series 5 notebook and a very strange thing happened: I installed Ubuntu 11.10 from a usb pen drive but when I restarted (...