RAID-5 (Distributed Parity)
RAID-5, for the same reasons as RAID-4, requires a minimum of
three disks to be more useful than a RAID-0 or RAID-1 array.
Configuration is nearly identical to other levels, except for the
addition of the parity-algorithm variable.
parity-algorithm is used to select the algorithm
that generates and checks the checksum information used to provide
fault tolerance. A simple /etc/raidtab for RAID-5
is shown here:
# RAID-5 with three member disks raiddev /dev/md0 raid-level 5 chunk-size 64 persistent-superblock 1 parity-algorithm left-symmetric nr-raid-disks 3 device /dev/sdb1 raid-disk 0 device /dev/sdc1 raid-disk 1 device /dev/sdd1 raid-disk 2
The left-symmetric algorithm will yield the
best disk performance for a RAID-5, although this value can be changed
to one of the other algorithms (right-symmetric,
left-asymmetric, or
right-asymmetric). While
left-symmetric is the best choice, it is not the
default for raidtools, so be certain to
explicitly specify it in /etc/raidtab. If you
forget to include a parity-algorithm, then the
array will default to left-asymmetric.
Execute mkraid to create this array:
# mkraid /dev/md0
handling MD device /dev/md0
analyzing super-block
disk 0: /dev/sdb1, 17920476kB, raid superblock at 17920384kB
disk 1: /dev/sdc1, 17920476kB, raid superblock at 17920384kB
disk 2: /dev/sdd1, 17920476kB, raid superblock at 17920384kBCreate the same RAID-5 using mdadm:
# mdadm -Cv -l5 -c64 -n3 -pls /dev/md0 /dev/sd{b,c,d}1 mdadm: array /dev/md0 started. ...Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access