Task: set up a 14 drive raid with 1 hot spare for a customer.
First I yum update. No reboot necessary, which was nice. Next, I learn the finer points of mdadm, as I’ve never actually done RAID 5 on a live server. Since the machine is remote, the chances of my screwing it up increase dramatically.
Then, I fdisk the drives, all 14 of them. Then, comes the part that I can now do in my sleep.
mknod /dev/md6 b 9 6
chmod 640 /dev/md6
chgrp disk md6
and then… things go downhill from there.
mdadm —create —verbose /dev/md6 —level=5 —chunk=8 —raid-devices=13/dev/sdb1 /dev/sdc1 /dev/sdd1 /dev/sde1 /dev/sdf1 /dev/sdg1 /dev/sdh1 / /dev/sdj1 /dev/sdk1 /dev/sdl1 /dev/sdm1 /dev/sdn1 /dev/sdp1
reboot. my md6 is gone, my raid does not mount.
remake node. research mkadm more. redo with different flags. talk to friends about why this isn’t working. item responsible? udev. udev doesn’t want me to have my node. it doesn’t like the fact that I didn’t ask for it in a nice way. it wants me to beg. I hax0r /etc/rc.d/rc.sysinit to add it manually.
reboot. the joy is all gone.
End result? 1.5 days spent fighting with the damn thing. What FINALLY worked? setting both auto=yes on the mdadm raid AND in mdadm.conf
mdadm -Cv /dev/md6 -l5 -ayes -n13 -c8 -x1 /dev/sd[bcdefghjklmnop]1
in mdadm.conf add the auto=yes to the line with your RAID, before the UUID
reboot. rejoice.
