Managing the RAID array is possible from the command line as well as from YaST. If you want to manage the array from the command line, you need the mdadm command. This command offers many options to handle the RAID array. One of the most important options is the - -monitor option. If you are using this option on an existing RAID device, the software will check the consistency of the RAID array, and if necessary when the array is in a degraded state, it will automatically start rebuilding the array. Usually, however, you wouldn't even need to do this, since the RAID drivers will rebuild a degraded RAID array automatically. If you are not sure, you can monitor the array from the /proc/mdstat file. In this file, you will always find the current status of an array. Listing 8-2 shows an example of this file.
Listing 8-2. Example of/proc/mdstat
Personalities : [raids] [raid4]
16771584 blocks level 5, 128 k chunk, algorithm 2 [3/3] [UUU]
unused devices: <none>
If you want to, it is possible to test that an array is working and see the autorebuild process operational. First use mdadm /dev/md0 --fail /dev/sdc1 --remove /dev/sdc1 to fail the /dev/sdc1 device and then remove the device sdc1 from the RAID array. This command will write the changing status of the RAID array to the /var/log/messages file. You can also see the new status of the array in /proc/mdstat. In this file, you can see that the same amount of data blocks are still available to your system; in addition, you will still be able to work with the RAID array. When the failing disk has been replaced, you can rebuild the array using mdadm or using YaST.
Was this article helpful?