Creation of Arrays
# make /dev/md0 a RAID1 array
mdadm --create /dev/md0 --level 1 -n 2 /dev/sda2 /dev/hda2
mdadm --detail /dev/md0 # have a look
# make /dev/md1 a RAID0 array
mdadm --create /dev/md1 --level 0 -n 2 /dev/hda1 /dev/sda3
mdadm --detail /dev/md1 # have a look
# make /dev/md3 a RAID1 array with one missing device (to add later on - see below...)
mdadm --create /dev/md3 --level=1 --raid-devices=2 missing /dev/sdb3
Add devices to /dev/md3
# add device /dev/sda3 to existing raid array /dev/md3
mdadm --add /dev/md3 /dev/sda3
Monitor mdadm arrays
cat /proc/mdstat
Configure /dev/md3 in /etc/mdadm/mdadm.conf (obsolete for Debian Lenny or optional, I am not sure...)
DEVICE /dev/sda3 /dev/sdb3
ARRAY /dev/md3 level=raid1 num-devices=2 UUID=0fc5588a:2fddde42:87a3b1dd:0d49cb68 devices=/dev/sda3,/dev/sdb3
First line (DEVICE) to be added manually, second line (ARRAY) with following command:
mdadm --brief --detail --verbose /dev/md3 >> /etc/mdadm/mdadm.conf
Postponing stuff: use the device
mkfs.ext3 /dev/md3
mount /dev/md3 /mnt
...or similar (do as you want)
Information sources:
(1)
http://www.administrator.de/index.php?content=28672
(2)
http://www.shimari.com/dm-crypt-on-raid/
Kategorie(n): Linux, Datenverwaltung