Wednesday, 28 May 2008

Software RAID 1 and GRUB issues

A small problem I ran into the other day while I was trying to install a new kernel on a CentOS box... After making the changes I wanted on the grub.conf file, I run "grub-install /dev/md0" and I got this error:
"md0 does not have a corresponding BIOS drive"

(a small middle finger) no worries though..
after looking it up turns out the middle finger was justified.. grub does not look at /etc/fstab to find the corresponding drives instead it uses /etc/mtab 

In this case when having a /dev/md0 as / which corresponds to /dev/hda1 all that needs to be done is:
  • edit /etc/mtab and switch /dev/md0 with /dev/hda
  • run "grub-install /dev/hda" to install GRUB to the MRB of the first drive
  • edit /etc/mtab and switch /dev/md0 with /dev/hdb
  • run "grub-install /dev/hda" to install GRUB to the MRB of the second drive (just in case of failure)
  • edit /etc/mtab again and put it back as you found it with devices set to md instead of hd

Changes might need to be made using the same logic to the "/boot/grub/" file which according to the Romanian guy that wrote the solution I used "maps a logical name such as /dev/hda to a physical device such as (hd0) which means (to grub) the first hard drive detected by the BIOS"

The actual link if you want the full article can be found here

Special thanks to "that guy" his solution did work and helped a lot.

Thanks for playing :)

No comments:

Post a Comment