Would that be the correct and safe order of replacing a failed raid1 disk
by yangou from LinuxQuestions.org on (#4Z00M)
Hello everyone
I've got a failed raid1 disk that needs replacing and I'm planning to follow the steps below. It's been a long time since I replaced a raid disk so I would like to make sure I don't do anything wrong.
1. Determine which disk has failed:
Code:[root@blue ~]# cat /proc/mdstat
Personalities : [raid1]
md0 : active raid1 sda1[0] sdb1[1]
511988 blocks super 1.0 [2/2] [UU]
md126 : active raid1 sdb4[1] sda4[0]
458508156 blocks super 1.1 [2/2] [UU]
bitmap: 0/4 pages [0KB], 65536KB chunk
md127 : active raid1 sdc1[0](F) sdd1[1]
3906885632 blocks super 1.2 [2/1] [_U]
bitmap: 19/30 pages [76KB], 65536KB chunk
md1 : active raid1 sdb2[1] sda2[0]
20970428 blocks super 1.1 [2/2] [UU]
bitmap: 0/1 pages [0KB], 65536KB chunk[_U] means that /dev/sda has failed and needs to be replaced.
2. Get the serial number of the failed fisk to make sure you remove the correct one using: hdparm -I /dev/sda
3. Mark the disk as failed: mdadm --manage /dev/md127 --fail /dev/sdc1
(Question: At this step do I use "-- fail /dev/sdc1 or
/dev/sda"?)
4. Remove disk: mdadm --manage /dev/md127 --remove /dev/sdc1
5. Physically replace /dev/sda with a new disk.
6. Copy the partition table from /dev/sdb to the new dev/sda:
sfdisk -d /dev/sdb | sfdisk /dev/sda
7. Add the new disk to the array: mdadm --manage /dev/md0127 --add /dev/sdc1
8. Mirroring has started and progress can be checked with: cat /proc/mdstat
Could you please let me know if anything is wrong with this How-To?
Many thanks for your help.


I've got a failed raid1 disk that needs replacing and I'm planning to follow the steps below. It's been a long time since I replaced a raid disk so I would like to make sure I don't do anything wrong.
1. Determine which disk has failed:
Code:[root@blue ~]# cat /proc/mdstat
Personalities : [raid1]
md0 : active raid1 sda1[0] sdb1[1]
511988 blocks super 1.0 [2/2] [UU]
md126 : active raid1 sdb4[1] sda4[0]
458508156 blocks super 1.1 [2/2] [UU]
bitmap: 0/4 pages [0KB], 65536KB chunk
md127 : active raid1 sdc1[0](F) sdd1[1]
3906885632 blocks super 1.2 [2/1] [_U]
bitmap: 19/30 pages [76KB], 65536KB chunk
md1 : active raid1 sdb2[1] sda2[0]
20970428 blocks super 1.1 [2/2] [UU]
bitmap: 0/1 pages [0KB], 65536KB chunk[_U] means that /dev/sda has failed and needs to be replaced.
2. Get the serial number of the failed fisk to make sure you remove the correct one using: hdparm -I /dev/sda
3. Mark the disk as failed: mdadm --manage /dev/md127 --fail /dev/sdc1
(Question: At this step do I use "-- fail /dev/sdc1 or
/dev/sda"?)
4. Remove disk: mdadm --manage /dev/md127 --remove /dev/sdc1
5. Physically replace /dev/sda with a new disk.
6. Copy the partition table from /dev/sdb to the new dev/sda:
sfdisk -d /dev/sdb | sfdisk /dev/sda
7. Add the new disk to the array: mdadm --manage /dev/md0127 --add /dev/sdc1
8. Mirroring has started and progress can be checked with: cat /proc/mdstat
Could you please let me know if anything is wrong with this How-To?
Many thanks for your help.