Creating the Array Using mdadm

[root@backup ~]# mdadm -C -l 5 -n 4 /dev/md0 /dev/etherd/e1.[0-3]

Create /dev/md0 as a RAID5 array consisting of /dev/etherd/e1.0,  /dev/etherd/e1.1, /dev/etherd/e1.2, and /dev/etherd/e1.3.

Examining this command with options (per man mdadm):

-C or –create, Create a new array

-l 5 or –level 5,  Set raid level 5.

When used with –create, options are: linear, raid0, 0, stripe, raid1, 1, mirror, raid4, 4, raid5, 5, raid6, 6, raid10, 10, multipath, mp, faulty. Obviously some of these are synonymous.

When used with –build, only linear, stripe, raid0, 0, raid1, multipath, mp, and faulty are valid.

Not yet supported with –grow.

-n 4 or –raid devices 4,  Sets the number of active devices in the array.

This, plus the number of spare devices (see below) must equal the number of component-devices (including “missing” devices) that are listed on the command line for –create. Setting a value of 1 is probably a mistake and so requires that –force be specified first. A value of 1 will then be allowed for linear, multipath, raid0 and raid1. It is never allowed for raid4 or raid5.
This number can only be changed using –grow for RAID1 arrays, and only on kernels which provide necessary support.

Leave a Reply