Configuring RAID

Notes

The name md comes from multiple disk, the filesystem type of md (RAID) devices is FD. The Kernel need to know which device is a RAID partition to automatic configure the RAID over the devices, we can also call it autodetect. You need to run manually mdadm –assemble after a reboot if the filesystem type for RAID devices are not FD.

RAID





Create RAID device /dev/md0, md0 is the name, you can choice whatever you want, level is the RAID level, in this example RAID1, -n is the count of devices to build the RAID, at the end the two devices, sda5 and sda6

Another example for RAID5

You need also to know, that the software RAID writes meta data on the devices, the meta data block will overwrite the bootloader (if a bootloader is present on the devices sda5, sda6, sda7)
The kernel does a sync job on the background (between the devices in the raid array md0) with a low priority, but that’s not a problem, we can use the RAID device already, also if the sync is still running.

Get information about the RAID array

Get some more information from dmesg

Create filesystem on RAID array

The chunksize on the RAID devices is 512k (default), we can tell the filesystem the chunkfilesize, this is helpfully for RAID0 and RAID5 arrays. Blocksize 4096 (maximum blocksize) you can also choose also a smaller blocksize, 2048 or 1024, as example if you need to manage tiny files. The stride is the count of chunks, you need to calculate it with the blocksize of the RAID devices (512k), (512*1024)/4096 = 128:

The -E option was in the past -R, -R is also still working.

Stop RAID array

Start RAID array

Add a device to the RAID array

The /etc/mdadm/mdadm.conf is for the mdadmd deamon, it reads this file and send notification if something on the RAID array is wrong

META information from devices

Remove device from RAID array

raidtools

Raidtools was the raid configuration utility from previous versions is not out of date, the configuration was in /etc/raidtab, the tools mkraid and raidstart are no more in use.