Step-2: Resilience check and Monitoring setup

After implementing RAID 10 array on Raspberry Pi 4, there are two things to be taken care. One is checking whether the fault tolerance is still intact or not. After making sure that the RAID array's fault tolerance is working properly, the second thing to be taken care is to deploy monitoring cron jobs on the Raspberry Pi to make sure the state changes on the RAID array are sent to the email so that the user would know if the array is working good or not. Also this gives the user to rectify the issues if there are any before that turns into a very serious problem which may lead to data loss.

To make sure that the RAID 10 array created is working properly or not, we can use the MDADM manage commands to fail a drive on purpose and see if the files in the mount path are still intact or not. The details about the RAID 10 and the RAID 1 from which the disk has been removed are compared before and after the disk removal operation. The files in the mount path are also cross checked before and after removing the disk to make sure no files are lost. The using the same MDADM manage tools to add the disk back to the array to see if the rebuilding is performed properly or not. Results for this process are shown in the results chapter. The set of commands for checking the resilience are converted into a bash script which looks like this:

The next step after checking for the data integrity and fault tolerance is to configure monitoring on the RAID Array. This can be done by a tool called “smartmontools”. his integrates with RAID Array and send email to the user if there is any issue with the RAID Array or the underlying disks. The bash script for the same is as follows:

Updated on