Working with GRUB
GRUB is a very weird beast, which is completely and utterly unintuitive.
You must have explicit instructions to get going with it, so I need to
jot these notes down (in case the web sites I stole them from go away the
next time my MBR (Master Boot Record) gets corrupted (like it did this
morning). To do this just follow this steps:
Boot with the installation CD/DVD.
Type "linux rescue" at the prompt, or select the "Rescue" item on the boot menu.
You may have to answer questions about keyboard and language and whatnot,
but just keep going until you get to the prompt.
Since I can never remember my partition table, I normally type something like:
fdisk /dev/hda
… followed by a "p" and a "q"
This is normally enough to jog my memory about where I put things.
Mount your normal root (the '/' directory) at /mnt
, with something like:
mount /dev/hda6 /mnt
Now, reset the file system perspective with the command: chroot /mnt
Start grub
out with some configuration options, as in:
grub --config-file=/boot/grub/menu.lst -device-map=/boot/grub/device.map
Now, you'll be at the grub
prompt. Set the GRUB's root device to the
partition containing the boot directory by typing something like:
root (hd0,0)
That second zero may not be what you want. It will be if your '/' root
partition is /dev/hda1
… in my case, I would type: root (hd0,5)
(since I had it on /dev/hda6
).
Note: If you are not sure which partition actually holds this directory,
use the command 'find' like this:
find /boot/grub/stage1
This will search for the file name '/boot/grub/stage1' and show the devices
which contain the file.
Once you've set the root device correctly, run the 'setup' command, by typing:
setup (hd0)
This command will install GRUB boot loader on the Master Boot Record (MBR) of the first drive.
Type quit
You should be good to go. Restart your PC (without the installation CD/DVD).
Tell others about this article: