Software RAID: Two good references
http://www.tldp.org/HOWTO/Software-RAID-HOWTO-1.html
http://lists.us.dell.com/pipermail/linux-poweredge/2003-July/014331.html
Note, you must setup grub for each RAID 1 device. Suppose you have
2 SCSI drives (sda and sdb). By default grub is setup on sda; but, you
need to enable it for sdb (/dev/hdb for ide) as follows:
grub>device (hd0) /dev/sdb
grub>root (hd0,0)
grub>setup (hd0)
Checking if "/boot/grub/stage1" exists... no
Checking if "/grub/stage1" exists... yes
Checking if "/grub/stage2" exists... yes
Checking if "/grub/e2fs_stage1_5" exists.. yes
Running "embed /grub/e2fs_stage1_5 (hd0)"... 16 sectors are embedded.
succeeded
Running "install /grub/stage1 (hd0) (hd0)1+16 p (hd0,0)/grub/stage2
/grub/grub
.conf"... succeeded.
Done.
grub>
grub>quit
Checking to see if everything is working:
$ cat /proc/mdstat
Checking the drives
$ sfdisk -d /dev/sdb
$ sfdisk -d /dev/sda
$ fdisk -l /dev/sda "This will give general information"
$ fdisk -l "General information for all drives"
Adding raid (assume you want to add the first drive "sda1", or if it is
the second
drive then substitute "sda2" below )
$ raidhotadd /dev/md0 /dev/sda1
$ raidhotadd /dev/md1 /dev/sda2
$ raidhotadd /dev/md2 /dev/sda3
This is an example of an cat /proc/mdstat that is working. Note that
there is a listing for both sda1[0] and sdb1[1]
$ cat /proc/mdstat
Personalities : [raid1]
read_ahead 1024 sectors
Event: 12
md0 : active raid1 sda1[0] sdb1[1]
104320 blocks [2/2] [UU]
md1 : active raid1 sda2[0] sdb2[1]
1044160 blocks [2/2] [UU]
md2 : active raid1 sda3[0] sdb3[1]
34411136 blocks [2/2] [UU]
unused devices: <none>
Compare that to this where md2 is missing sdb3
$ cat /proc/mdstat
Personalities : [raid1]
read_ahead 1024 sectors
Event: 9
md0 : active raid1 sda1[0] sdb1[1]
104320 blocks [2/2] [UU]
md1 : active raid1 sda2[0] sdb2[1]
1044160 blocks [2/2] [UU]
md2 : active raid1 sdb3[1] <---- HERE
34411136 blocks [2/1] [_U]
unused devices: <none>
If you are rebuilding an array, you can watch it by doing the following:
$ watch -n1 cat /proc/mdstat
Need to know the raid setup?
$ cat /etc/raidtab