# more /proc/mdstat Personalities : [raid5] read_ahead 1024 sectors unused devices: <none>However, if RAID level 5 is compiled as a module, the Personalities might be empty. You should try to insert RAID level 5 module
# insmod raid0and eventually see the same result.
An example for RAID level 5 is shown below.
raiddev /dev/md0
raid-level 5
chunk-size 32k
parity-algorithm left-symmetric
persistent-superblock 1
nr-raid-disks 4
# Spare disks for hot reconstruction
nr-spare-disks 0
device /dev/sdb1
raid-disk 0
device /dev/sdc1
raid-disk 1
device /dev/sdd1
raid-disk 2
device /dev/sde1
raid-disk 3
where /dev/sdb1, /dev/sdc1 and /dev/sdd1 are free
partitions with Linux native or Linux raid autodetect types.
The left-symmetric is the parity-algorithm that offers maximum
performance on typical disks. Since when you traverse the striping units
sequentially, it allows each disk to be accessed once before accessing any
disks twice. Left-symmetric and left-asymmetric algorithm are demonstrated in
Figures 13.5 and 13.6. See man
raidtab for further detail.
All previous data in disk array will be destroyed then RAID superblock is created.
# mkraid --really-force /dev/md0The RAID device /dev/md0 must be specified in /etc/raidtab.
The command mkraid also start the RAID device being initialized automatically. Check the started RAID by:
# more /proc/mdstat Personalities : [raid5] read_ahead 1024 sectors md0 : active raid5 sde1[3] sdd1[2] sdc1[1] sdb1[0] 16780800 blocks level 5, 32k chunk, algorithm 2 [4/4] [UUUU] resync=10.1% finish=588.4min unused devices: <none>Size of the RAID device is reported by the number of blocks (each block has 1024 bytes). The
However if this is not the case, you can start RAID device manually by command
# raidstart /dev/md0
The RAID device will appear to users just like a typical disk partition. The follow command creates ext2 file system on the RAID device.
# mkfs /dev/md0
# mount /dev/md0 <mount point>Finally, you must edit the /etc/fstab to make the modification persistent as shown below.
LABEL=/ / ext2 defaults 1 1 none /proc proc defaults 0 0 /dev/sda5 swap swap defaults 0 0 /dev/md0 /RAID5 ext2 defaults 1 2