mdadm package needed (aptitude install mdadm)
http://neil.brown.name/blog/mdadm
Create array:
mdadm --create --verbose /dev/md0 --level=0 --raid-devices=2 /dev/sdb1 /dev/sdc1
or
mdadm -Cv /dev/md0 -l0 -n2 -c128 /dev/sdb1 /dev/sdc1/etc/mdadm.conf
# optional, but used for easier interaction
DEVICE /dev/sdb1 /dev/sdc1
ARRAY /dev/md0 devices=/dev/sda1,/dev/sdb1
Show md info:# produces output that you would put in the mdadm.conf
mdadm --detail --scan
Show device info:
mdadm -E /dev/sdc1
# shows info about the component disks
Start (assemble) Existing Array:
mdadm -As /dev/md0
# -A starts assemble mode to assemble existing array
# -s indicates the use of /etc/mdadm.conf
or
mdadm -A /dev/md0 /dev/sdb1 /dev/sdc1
# starts array without existing /etc/mdadm.conf
Assemble an existing array automatically:
mdadm --assemble --scan
or
mdadm -As
Stop the array:
mdadm -S /dev/md0
or
mdadm --stop /dev/md0
Add a disk:
mdadm /dev/md0 --add /dev/sdc1
Remove a disk:
mdadm /dev/md0 --fail /dev/sdc1 --remove /dev/sdc1
# "fails" and removes a disk
fstab entry for the array:
# this assumes the array was formated with ext3
/dev/md0 /export/ ext3 suid,dev,defaults,exec 0 0
http://www.linuxdevcenter.com/pub/a/linux/2002/12/05/RAID.html
No comments:
Post a Comment