My personal webspace

A webspace for innovation, free thinking, and procrastination

This one took me the better part of a day. The challenge; get Grub 2 working on my desktop, which has two 1TB drives in RAID 1 via fakeraid (and the Windows virus!).

It’s really not as hard as it sounds, if you know all of the steps.

Step 1: Install Grub2

Simply run…

sudo pacman -S grub-bios

If you have grub-common (the legacy one), you will need to replace it.

Step 2: Install Grub to the drive

This one is also not that hard, after you know what to do. Run:

grub-install --target=i386-pc --recheck --debug $DRIVE

where $DRIVE is the device (in /dev/sdX format, or, if you’re using RAID, /dev/mapper/)

Or, if you prefer, you can create the file automatically by running:

grub-mkconfig -o /boot/grub/grub.cfg

Step 3: Create the grub.cfg file

There are a few ways to do this. I have several operating system on my machine, including a Windows install. To speed things up, I “converted” my old menu.lst file to the “grub.cfg” file by executing the following:

grub-menulst2cfg /boot/grub-legacy/menu.lst /boot/grub/grub.cfg

In theory, you are now done. However, I strongly recommend you backup your working grub.cfg file. At some point, you should move the entries that aren’t automatically detected into a file in /etc/grub.d/.

Here is what my Windows entry looks like…

I’m sure I’ll be back here later looking for it!

menuentry 'Windows' {
  set root='(hd0,1)'; set legacy_hdbias='0'
  parttool "$root" boot+
  chainloader  '+1'
}

Even with fakeraid, the root device is (hd0,1). This should be replaced with the appropiate device for you. I have no idea how one would get access to sda if the RAID takes hd0, but this is a challenge for another day…


Content © 2022 Charles Hathaway