[UCI-Linux] Re:some comments and crude benchmarks on SW SATA raid5 on linux

Harry Mangalam hjm at tacgi.com
Fri Apr 1 19:10:22 PST 2005


And here is the script that brings up the raid and and mounts it.  The default 
scripts for the ubuntu mdadm and mdadm-raid are out of order relative to 
other module loads.  This also depends on the relatively 
simple /etc/mdadm/mdadm.conf file 

$ cat /etc/mdadm/mdadm.conf
DEVICE /dev/sda1 /dev/sdb1 /dev/sdc1 /dev/sdd1
ARRAY /dev/md0 level=raid5 num-devices=4 \ 
UUID=14f16ab0:5c4b381f:3e3a4f4d:046f2a5f

(the UUID is generated automatically by:
$ mdadm --detail --scan
ARRAY /dev/md0 level=raid5 num-devices=4 
UUID=14f16ab0:5c4b381f:3e3a4f4d:046f2a5f
   devices=/dev/sda1,/dev/sdb1,/dev/sdc1,/dev/sdd1

(in fact it generates a /nearly/ intact mdadm.conf file - dunno why it doesn;t 
do the whole thing).



The init.d/local file is:

$ cat /etc/init.d/local
#!/bin/sh
# start the mdadm daemon
echo "starting mdadm in notify mode"
echo ""
nohup mdadm --monitor --mail='hjm at tacgi.com' --delay=300 /dev/md0 &

echo "starting mdrun to discover raid"
echo ""
/sbin/mdrun

#start the RAID thingie
echo "starting mdadm-raid"
echo ""
/etc/init.d/mdadm-raid start

# mount the raid  on /r
echo "mounting the raid on /r"
echo ""
/bin/mount -t reiserfs /dev/md0 /r

# and finally, add the raid devices as separate swap stripes (not under 
# control of mdadm (swap has been parallelizable for a long time without it)
# the /etc/fstab entry for this is (minus the hashmarks to comment it):
## last partitions of raid disks (~1.8GB ea) are for parallel swap
#/dev/sda2       none            swap    sw               0       0
#/dev/sdb2       none            swap    sw               0       0
#/dev/sdc2       none            swap    sw               0       0
#/dev/sdd2       none            swap    sw               0       0

echo "adding swap on the raid disks"
echo ""
swapon -a
# end of script


Also, some refs that helped me out (to save .79s googling them yourself):
listed in rough order of usefulness:

Some useful info, thought processes, and definitions
  http://www.oreilly.com/catalog/mraidlinux/chapter/ch02.pdf

The Software-RAID HOWTO:
http://www.tldp.org/HOWTO/Software-RAID-HOWTO.html

How to use mdadm (by the same author as the 1st):
  http://www.linuxdevcenter.com/pub/a/linux/2002/12/05/RAID.html

Linux SATA RAID FAQ:
  http://linux.yyz.us/sata/faq-sata-raid.html




More information about the UCI-Linux mailing list