What is the correct way to install software RAID 1 in CentOS 6.4?

5,357

Solution 1

Using grub-install /dev/sdX is probably how it is intended to be done. However, I just had to rescue a CentOS 6.4 server that had that setup, but now froze at boot after its other bootable RAID 1 disk was replaced some months earlier (the server had stayed on during the meantime).

What solved the issue in my case was grub-install /dev/md0, where md0 is the RAID 1 device created from bootable disks sda & sdb.

This seems like an unreliable solution, though. My gut says that in case one disk fails, booting from md0 will fail as well.

Solution 2

You should try one of this (in case you have /dev/sda and /dev/sdb in your RAID 1):

# grub-install /dev/sda
# grub-install /dev/sdb

OR

# grub
grub> root (hd0,0)
grub> setup (hd0)
grub> root (hd1,0)
grub> setup (hd1)

After this yo can try to load system with only one drive in test purposes.

Share:
5,357

Related videos on Youtube

Nikolai Zh
Author by

Nikolai Zh

Updated on September 18, 2022

Comments

  • Nikolai Zh
    Nikolai Zh over 1 year

    I'm going to install CentOS 6.4 on HP ProLiant ML310e Gen8 server. This server has fakeraid controller so i decided to use software raid. The problem is that i don't know how to correctly install GRUB and/or boot sector with software RAID 1 to get system which boot successfully in case of failure of one HDD. CentOS wiki have 2 topics concerning this question:

    1) http://wiki.centos.org/HowTos/SoftwareRAIDonCentOS5

    This topic describes manual installing GRUB on both HDDs and as i understood this is the most common solution, but this topic have such warning:

    This article addresses an approach for setting up of software (mdraid) RAID1 at install time on systems without a true hardware RAID* controller. It is NOT supported by the CentOS project; it is NOT a recommended approach for non-hobby users

    2) http://wiki.centos.org/HowTos/Install_On_Partitionable_RAID1

    If you are installing a system on a partitionable RAID you can use the whole hard drive as a RAID component device, and since RAID1 is a mirror, you will be able to boot your system from any of the drives in case of failure without any additional tricks required to preserve bootloader configuration, etc.

    Looks like exactly that i need, but i searched internets about Partitionable RAID and found that there are a lot of bugs with it. I even found information that this way is not supported by upstream (can't find there i saw this).

    So what is the correct way to install CentOS 6.4 on software RAID 1? I would like system to boot in case of failure of one of the disks.

  • Michael Hampton
    Michael Hampton about 7 years
    Of course you should be using UEFI, in which case it will boot from either mirror if one is unavailable.