GRUB loses its way when SATA disk fails
As part of my journey into Linux, J thought she would add a complementary piece in case I have any future problems with my SATA disks that may upset the GRUB bootloader for Linux Mint. So, here it is!
Symptoms
On boot, GRUB cannot find any operating systems (for reasons requiring investigation via BIOS and/or physical inspection) and the onscreen message states “Missing Operating System“.
Nothing further happens and you’re sat looking at a blank screen wondering what’s happened!
What to do
1. Resolve the physical SATA disk problem
Check the hard disk information in the BIOS. In J’s case, she recognised the first SATA drive had ‘fallen out’ of the boot priority listing, and the disk information looked suspect (odd ASCII code in the vendor name….).
Having suffered a similar issue last year when using these same SATA disks for a RAID configuration in Windows Vista, J realised these disks can become ‘disconnected’. So in the BIOS, J changed the disk priority to just DVD drive, disabling all other bootup options, and disabled the Quick Boot so more bootup tests would be performed (in the hope the SATA controller would ‘rebuild’ the SATA disk information).
On reboot, ‘rebuild’ processes were performed on the first SATA disk, which resulted in both SATA disks looking ‘healthy’ once again. In the BIOS, J then added the first SATA disk as the second choice in the boot priority.
However, although the SATA disk is looking good again…GRUB still does not find anything… onto step 2.
2. Repairing GRUB after it gets ‘upset’ (due to something like the above!)
Having cured the physical issue on the SATA disk, J was still not sure why GRUB was not able to continue ‘business as usual’ - but from previous experience, J believes GRUB is sensitive and has to be ‘reassured’ of the locations where the operating systems are to be found.
So, it is necessary to make sure GRUB knows where to look. Real experts of GRUB probably know the GRUB text interface… but in J’s case she booted from her Linux Mint distro CD and used the CD’s Linux Mint desktop. Very useful for troubleshooting! Then, having setup a wireless connection, J used the advice from http://www.linuxmint.com/wiki/index.php/How_to_repair_your_grub, in particular just the following section:
a. First, open Terminal, and change to the GRUB shell by typing at the prompt:
sudo grub
This will produce something like this:
GNU GRUB version 0.97 (640K lower / 3072K upper memory)
Minimal BASH-like line editing is supported. For
the first word, TAB lists possible command
completions. Anywhere else TAB lists the possible
completions of a device/filename.
b. Then, to locate a boot folder/partition, type:
find /boot/grub/stage1
This will produce a list of values like (hd0,1) and (hd0,3), etc.
c. So, one knowing where the GRUB file is located already (it has to be from one of the results listed in the values - in J’s case this is hd1,0), J typed:
root (hd1,0)
This results produced a message like “Filesystem type is ext2fs, partition type 0×83″ if GRUB recognises the filesystem.
d. Next, the setup command is used to ‘install’ GRUB’s stage 1 to MBR:
setup (hd0)
e. Then type:
quit
3. (May be required) A spot of tweaking
When J rebooted the PC, GRUB loaded showing the correct operating systems available. However, when selecting the Linux Mint operating system from the list, it entered into the text-based interface login.
So after entering username and password, J had to use the command startx to enter the usual Mint Linux GUI desktop. J logged out, then used the shutdown -r now command to reboot.
On the GRUB screen, J checked through the various options first before selecting an operating system (these include settings for splash screens, etc).
You can also configure the menu.lst file in Terminal, by using a command like sudo gedit /boot/grub/menu.lst allowing you to manually configure the file (note: for Advanced users only!) or you can use the Gnome utility called Startup-Manager under Administration - this is an excellent and for the uninitiated safer, GUI for configuring GRUB. If Startup-Manager is not already installed, open Terminal and type:
sudo apt-get install startupmanager
And so J was back in business, proof that this works for her anyway!



