Tips: System Administration

Quick Reference for RAID Administration

Quick reference on administration of raid with mdadm.


Linux Software RAID

create a raid array

mdadm --create /dev/md0 --level=5 --raid-devices=4 /dev/sd[bcde]1

mark as failed

mdadm --manage /dev/md0 --fail /dev/sdb1

remove from array

mdadm --manage /dev/md0 --remove /dev/sdb1

copy same partition info to new drive

sfdisk -d /dev/sda | sfdisk /dev/sdb

add new drive to array

mdadm --manage /dev/md0 --add /dev/sdb1

check to see array status

cat /proc/mdstat

zero out super blocks. Sometimes needed if drive was in a array before

mdadm --zero-superblock /dev/sdb1

Hot Swap SCSI remove from bus (/proc/scsi/scsi) to find ID

echo "scsi remove-single-device 2 0 0 0" > /proc/scsi/scsi

Hot swap SCSI add to bus

echo "scsi add-single-device 2 0 0 0" > /proc/scsi/scsi