If you want to grow a raid array or perform other actions on it you should make sure that all files are consistent.
mdadm has a function that can ensure this even without having to rebuild the raid.

Before you can start you always have to make sure that everything is save for the present:
|
1 2 3 4 |
root@nas34 cat /proc/mdstat Personalities : [raid6] [raid5] [raid4] md42 : active raid5 sdd[0] sdb[4] sda[3] sde[1] 4395411456 blocks super 1.2 level 5, 512k chunk, algorithm 2 [4/4] [UUUU] |
If everything looks just fine, as above, we would not have to be concerned, if there would not be the risk of bad blocks because they have the characteristic that they become conspicuous only if there are read or write actions performed to them. For ensuring that the array act correct we are going to perform a manual check:
|
1 |
echo check >/sys/block/md42/md/sync_action |
Now we have to check that the “check” we have just sent to /sys/block/md42/md/sync_action produces an effect:
|
1 2 3 4 5 |
cat /proc/mdstat Personalities : [raid6] [raid5] [raid4] md42 : active raid5 sdd[0] sdb[4] sda[3] sde[1] 4395411456 blocks super 1.2 level 5, 512k chunk, algorithm 2 [4/4] [UUUU] [>....................] check = 0.0% (23564/1465137152) finish=500.0min speed=63564K/sec |
Alright! The action has been started. If the Raid does not show any errors:
|
1 2 |
cat /sys/block/md42/md/mismatch_cnt 0 |
and does not suddenly start to rebuild we can grant that it is stable and start with the proper work, without being concerned that one of the disk could be damaged any way.
If you want to you can cancel the procedure by sending ‘idle’ to /sys/block/md42/md/sync_action:
|
1 |
echo idle >/sys/block/md42/md/sync_action |
auffallend