MD just seems more intuitive than the LVM that comes with a click click CentOS installation. Here are the steps for creating a md device.
1. Create the virtual driveFirst create the disks, whether in AWS or on ESX. Four seems to be a magic number.
mdadm --create /dev/md0 --chunk=256 --level 0 --raid-devices=4 /dev/sdl /dev/sdm /dev/sdn /dev/sdoIn AWS, the device is easy to know because it is set when the disk is attached to the system.
In ESX, at adding a disk to SCSI 1:0 will likely start at sdb and would look something like this:
mdadm --create /dev/md0 --chunk=256 --level 5 --raid-devices=4 /dev/sdb /dev/sdc /dev/sdd /dev/sdeMD RAID level 0 has excellent performance on AWS (and ESX as well). I’ve seen garnering 15 percent performance boost in Hudson build environments on AWS. However, RAID 0 cannot be expanded, so upsizing (adding a disk) will require a forklift migration.
Finally format the drive. If using xfs, that package may need to be installed.
yum install xfsprogs
2. Ensure the device will start at bootCreate a /etc/mdadm.conf file with the following line:
DEVICE partitionsThen add the device md information with the following command:
mdadm --detail --scan | tee -a /etc/mdadm.conf
3. Wire up the drive so it will be there after rebootIn /etc/fstab, add the device to the mount point, in this case /data:
/dev/md0 /data xfs noatime,nodiratime,allocsize=512m 0 0Running the command mount -a should mount the drive without any errors.
4. Check the driveTwo commands will help check status of the drive.
mdadm --detail /dev/md0 will show the RAID health of the drive.
df –h will show the operating system’s view of the drive.