Howardism Musings from my Awakening Dementia
My collected thoughts flamed by hubris
Home PageSend Comment
Note

Yeah, it seems like I've been paying dearly for all my negative Linux comments, as my karma seems to be haunting me with a string of bad computer luck.

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:

  1. Boot with the installation CD/DVD.

  2. 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.

  3. 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.

  4. Mount your normal root (the '/' directory) at /mnt, with something like:
    mount /dev/hda6 /mnt

  5. Now, reset the file system perspective with the command: chroot /mnt

  6. Start grub out with some configuration options, as in:

    grub --config-file=/boot/grub/menu.lst -device-map=/boot/grub/device.map
  7. 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.

  8. 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.

  9. Type quit

  10. You should be good to go. Restart your PC (without the installation CD/DVD).

Tell others about this article:
Click here to submit this page to Stumble It