Saturday, May 12, 2007

How to create a mdadm managed soft raid device

add devices

I like the 4 port promise Sata300 Tx4 which works with the debian etch kernel 2.6.18-4-486.
It works with the sata_promise kernel module.

Then add drives ( I like 400G WD drives with 5 year warranties).
Then fdisk /dev/sda
n p 1
accept defaults
t fd
(ie linux autodetect raid defaults)
then
mdadm /dev/md0 --create --level=1 --raid-devices=2 /dev/sda1 /dev/sdb1
then it work work on this - takes some time...
Either before or after run
mkfs.ext3 /dev/md0
then can mount.
need to create the mdadm.conf file
so run
mdadm --detail --scan >>mdadm.conf

output looks like
ARRAY /dev/md0 level=raid1 num-devices=2 UUID=3cfd16a0:6eaa64dd:0dfcf1b5:2690c9eb
then edit the file so it looks like this

DEVICE /dev/sda1 /dev/sdb1
ARRAY /dev/md0 level=raid1 num-devices=2 UUID=3cfd16a0:6eaa64dd:0dfcf1b5:2690c9eb

then copy it to
/etc/mdadm/mdadm.conf

Now I sometimes have servers that are located in weird places and want to
insure remounting forcing even if raid is degraded.
so i dont put the mount point in /etc/fstab
and i create an init.d script to force assemble the raid
and mount it.
mdadm -A (need to check syntax here)
to be continued..

No comments: