You are here

Installing a RAID system on CentOS 6

The process is very straightforward, with only one minor complication: the MBR and GRUB must be set up on both drives for alternate boot if one drive fails.
1. First setup a boot raid partition (100MB) on each drive
-Do this by creating a raid partition on each drive separately
-Then combine them into one RAID1 ext4 device mounted at /boot
2. Make two 4096GB raid partitions for the swap drive (adjust size as needed)
-Combine them into RAID1 of type swap (not mounted)
3. Next use the rest of the disks to make big raid partitions
-Combine them into RAID1 device of with LVM filesystem
-Create a Volume group from the RAID
-Create an LVM logical volume of 50GB in the physical group, type EXT4, name lvsys, mount at /
-Create another LVM of 50GB, named lvhome, mount at /home
For good how-tos, see:
http://wiki.centos.org/HowTos/SoftwareRAIDonCentOS5
http://www.texsoft.it/index.php?c=hardware&m=hw.storage.grubraid1&l=it
Here is a sample script to print the status:
raid.sh

#!/bin/bash
# print raid status. Takes one parameter, either md# or hd##
if [ $# -lt 1 ]; then
  cat /proc/mdstat
elif [ "$1" == "md0" ] || [ "$1" == "md1" ] || [ "$1" == "md2" ] || [ "$1" == "md3" ]; then
  /sbin/mdadm --detail /dev/$1
else
  echo "============================== checking drive:" $1
  /sbin/mdadm --examine /dev/$1
fi

New partitions can be added back in (if failed) by:
mdadm --manage /dev/md0 --add /dev/hdc1
For a how-to on replacing a failed drive, see: http://www.howtoforge.com/replacing_hard_disks_in_a_raid1_array

Topic: