16.21. Repairing RAID disks
You can repair disks in a RAID array by using the repair option.
Prerequisites
-
The
mdadmpackage is installed.
Procedure
Check the array for the failed disks behavior:
# echo check > /sys/block/md0/md/sync_actionThis checks the array and the
/sys/block/md0/md/sync_actionfile shows the sync action.-
Open the
/sys/block/md0/md/sync_actionfile with the text editor of your choice and see if there is any message about disk synchronization failures. -
View the
/sys/block/md0/md/mismatch_cntfile. If themismatch_cntparameter is not0, it means that the RAID disks need repair. Repair the disks in the array:
# echo repair > /sys/block/md0/md/sync_actionThis repairs the disks in the array and writes the result into the
/sys/block/md0/md/sync_actionfile.View the synchronization progress:
# cat /sys/block/md0/md/sync_action repair # cat /proc/mdstat Personalities : [raid0] [raid6] [raid5] [raid4] [raid1] md0 : active raid1 sdg[1] dm-3[0] 511040 blocks super 1.2 [2/2] [UU] unused devices: <none>