Linux - quick guide for software RAID

  1. umount all the disks which are going to be joined in soft RAID

    umount -a

  2. cread soft RAID

    mdadm –create –auto=yes /dev/md0 –level=0 –raid-devices=12 /dev/sdb /dev/sdc /dev/sdd /dev/sde /dev/sdf /dev/sdg /dev/sdh /dev/sdi /dev/sdj /dev/sdk /dev/sdl /dev/sdm

  3. add config file

    mdadm -Ds > /etc/mdadm.conf

modify the config file with the following format

ARRAY /dev/md0 level=raid0 num-devices=8 UUID=bdf8681f:2e4e7503:7dedd257:e6a95783
devices /dev/ssda /dev/ssdb /dev/ssdc /dev/ssdd /dev/ssde /dev/ssdf /dev/ssdg /dev/ssdh

ARRAY /dev/md1 level=raid0 num-devices=4 UUID=e04a6b09:fb689843:18767824:8fdeb28c
devices /dev/sdb /dev/sdc /dev/sdd /dev/sda4
  1. check the conf file

    stop all

    mdadm -Ss

    start all according to the config

    mdadm -As

  2. format

    mkfs.ext4 /dev/md0
    mkfs.ext4 /dev/md1

  3. mount

    mount -t xfs /dev/md0 /data
    mount -t xfs /dev/md1 /data1

  4. edit /etc/rc.local (do NOT recommend to add into fstab, it may lead to boot failed)

    /sbin/mdadm -As

    mount -t xfs /dev/md0 /data

  5. edit /etc/fstab, do NOT mount original partition

  6. reboot, check

P.S.

mkfs.ext4 do NOT support 16T by default, need to upgrade.

or

use xfs:

yum install xfsprogs.x86_64

then:

msfs.xfs