The post describes the steps to replace a mirror disk in a software RAID array. In this example, we have used /dev/sda1 as the known good partition, and /dev/sdb1 as the suspect or failing partition. Before proceeding, it is recommended to backup the original disk. Before removing raid disks, please make sure you run the following command to write all disk caches to the disk:

1. Mark the disk as failed

To verify that the disk is failed, check /proc/mdstat:

Failed disk will be marked as “(F)”.

 

2. Remove the disk by mdadm

3. Replace the disk

Replace the faulty disk with new one.

4. Copy the partition table to the new disk

Copy the partition table to the new disk (Caution: This sfdisk command will replace the entire partition table on the target disk with that of the source disk – use an alternative command if you need to preserve other partition information):

4a. Limit speed:

echo 5000 > /proc/sys/dev/raid/speed_limit_max (5000=5MB/s)

5. Create mirror

Create the mirror of the disk:

6. Verify

To test the setup, enter the below command:

The following command will show the current progress of the recovery of the mirror disk:

By vuat8b

Leave a Reply

Your email address will not be published. Required fields are marked *