Repair GRUB Boot Process
The need for repairing a GRUB-based boot process typically arises after installing a Microsoft operating system onto a PC after GRUB-based booting has been established. However, another situation that can result in a broken GRUB boot process is the addition of another partition onto a disk that results in a new partition number for the partition hosting your Ubuntu boot directory (/boot).
After experimenting with several out of the hundreds of techniques returned by some simple Google searches, I found one of the best (and most accurate) solutions at the blog entitled "Ramblings of a Mad Man" (http://microdotsagamedev.wordpress.com/2007/06/08/repair-your-grub-loader/).
Given the ephemeral nature of the web, the key steps are paraphrased below in case the link above should ever become non-operational:
- Boot your PC with a Ubuntu Live CD or DVD
- Launch a terminal app of your choosing
- Kick off the repair process by typing "sudo grub" at a command prompt (without the quotes both here and in future steps listed below)
- Type "root (hd" and then press the Tab key on your keyboard
- If you only have one physical drive, it's likely the appropriate drive number will be filled in. If you have more than one, they should be listed and you'll need to select the appropriate drive (e.g., hd0 or hd1).
- Type "," and then press the Tab key again (e.g., "hd0," followed by Tab).
- You will then see something similar to the following output:
grub> root (hd0,
Possible partitions are:
Partition num: 0, Filesystem type unknown, partition type 0×7
Partition num: 2, Filesystem type is ext2fs, partition type 0×83
Partition num: 4, Filesystem type unknown, partition type 0×7
Partition num: 5, Filesystem type is fat, partition type 0xb
Partition num: 6, Filesystem type is fat, partition type 0xb
Partition num: 7, Filesystem type unknown, partition type 0×82 - The most likely partition type for your Ubuntu partition is ext2fs, although if you originally created more than one partition (e.g., to host /home separately), you may need to experiment with the alternatives until you select the correct partition.
- Complete the command started above using the appropriate partition number (e.g., "root (hd0,2)" and press the Enter key.
- Next type "setup (hdx)" where x is replaced with the correct drive number you determined at the start of this process.
- If all proceeds without a hitch, type "quit" and then "sudo reboot" and you should now see your GRUB-based boot menu after your PC restarts.
News :
01 Oct 2008: Added entry on repairing GRUB boot process.
15 Aug 2008: This site will gradually encompass lessons learned in the trenches of Linux system administration.