Mdadm

From Ye Ole Stash
Jump to: navigation, search

Contents

Setup and Config

  • View Current Raid layout
cat /proc/mdstat
  • Create Configuration File from CLI
Backup existing config (/etc/mdadm.conf)
mdadm --detail --scan > /etc/mdadm.conf
Add
DEVICE partitions
MAILADDR $your_email_address

Create Raid

Raid 1
Raid 10
--layout
=n2 (near copies.(default)Gives balanced read/write performance similar to RAID 0 over 1/2 the drives.The 2 is the # of copies of the each block.)
=f2 (better read / worse writes. This can easily spread a long sequential read across the drives at the cost of writes )
=o2
Further Reading
Novel SLES Documentation
http://www.issociate.de/board/post/377091/RAID10:_near,_far,_offset_--_which_one?.html

Break/Add Raid

Set Drive Faulty
mdadm --fail /dev/md[1..99] /dev/sd[a-z][1..99]
Remove Drive
mdadm --remove /dev/md[1..99] /dev/sdf[a-z][1..99]
Readd Drive
mdadm --add /dev/md[1..99] /dev/sdf[a-z][1..99]


Re-Assemble Raid

Interesting Errors

  • trying to create a array shows one partition as : "is too small: 0K"
Cause: a software raid was run ontop of another software raid (ie raid 0 + 1)
Fix `dd if=/dev/zero of=/dev/sd(a-z) bs=512 count=100` followed by a fdisk and recreate of the partition.
Personal tools