RAID

There are two forms of volume management on Redhat Linux - RAID metadevices and LVM. This describes raidsets. The process of creating a RAID device is as follows:

Creating physical partitions

Use fdisk to create physical partitions for use in metadevice

Ensure that the drive ID type is changed to FD (linux RAID autodetect) using the "t" command in fdisk - normally it will be set to 83 (Linux ext2)

Creating /etc/raidtab file

The following example is to create a raid1 metadevice using two partitions /dev/sdb1 and /dev/sdc1 and a spare device /dev/sdd1.

raiddev /dev/md0
raid-level 1
nr-raid-disks 2
nr-spare-disks 1
persistent-superblock 1
chunk-size 4
device /dev/sdb1
raid-disk 0
device /dev/sdc1
raid-disk 1
device /dev/sdd1
spare-disk 0

Making metadevice and mounting

mkraid /dev/md0
mke2fs /dev/md0

mkdir /disk1
vi /etc/fstab
mount /disk1

Useful lsraid commmands

lsraid -a /dev/md0 (displays members and status of md0 metadevice)
lsraid -D -l -a /dev/md0 (as above but more detailed)
lsraid -R -a /dev/md0 ( generates an /etc/raidtab file for md0)