Sysadmin Garden of Eden Docs

Version 1337.42.0

mdadm

Checkout the mdadm man page.

NOTE

Don’t forget to keep your mdadm.conf uptodate when creating, modifiying, deleting mdadm arrays.

Generate mdadm.conf

1
mdadm --detail --scan >> /etc/mdadm.conf

Grow RAID 5 to RAID 6

DON’T FORGET THE --backup-file=FILE for mdadm --grow operations!

(This “backup file” should be on different disk / storage, not on the mdadm array you are growing!)

Speed up RAID rebuild

NOTE

This may or may not improve your RAID rebuild performance.

This assumes your disks are sda, sdb and sdc, and the RAID array is md0 (/dev/md0).

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
for disk in sd{a..c}; do
    blockdev --setra 16384 "/dev/${disk}"
    echo 1024 > "/sys/block/${disk}/queue/read_ahead_kb"
    echo 256 > "/sys/block/${disk}/queue/nr_requests"
    # Disable NCQ on all disks.
    echo 1 > "/sys/block/${disk}/device/queue_depth"
done
# Set read-ahead to 64 MiB for /dev/md0
blockdev --setra 65536 /dev/md0
# Set stripe_cache_size to 16 MiB for /dev/md0
echo 16384 > /sys/block/md0/md/stripe_cache_size
Last updated on 31 Jan 2020
Published on 31 Jan 2020
Edit on GitHub