Replacing failed OS RAID disks
RAID1 is automatically configured on the server. However, in some cases, you may need to remove, recover, and add new devices to RAID.
In most cases, this requires removing the failing disk and installing a new one.
| While you can do this while powered up, if the system allows you to power down, do so. |
-
To check the status of the RAID1 disk, type:
cat /proc/mdstatWhen RAID1 is working correctly, the terminal prints, for example:
Personalities : [raid1] md126 : active raid1 sda[1] sdb[0] 125032448 blocks super external:/md127/0 [2/2] [UU] md127 : inactive sdb[1](S) sda[0](S) 4520 blocks super external:imsm-
[UU]indicates that both disks are operational. -
If there is a problem with one of the disks, the
[UU]string is[_U]or[U_].
-
-
Check if disk
sdaorsdbhas failed. -
To remove the disk from RAID configuration, type:
Take care when removing the failing disk.
Remove only the disk identified as failing. In the following example, it is
sdb.mdadm --manage /dev/md/imsm0 --remove /dev/sdbThe terminal prints:
mdadm: hot removed /dev/sdb from /dev/md/imsm0 - Power down computer, replace the failing disk, and reboot
-
To create the partition on the replacement disk, type:
sfdisk -d /dev/sda | sfdisk /dev/sdb -
To verify the partition, type:
fdisk –l -
To add a new disk to the raid array, type:
mdadm --manage /dev/md/imsm0 --add /dev/sdb -
To check the recovery process, type:
cat /proc/mdstatThe terminal prints:
[root@wes-install ~]# cat /proc/mdstat Personalities : [raid1] md126 : active raid1 sdb[2] sda[1] 125032448 blocks super external:/md127/0 [2/2] [UU] md127 : inactive sdb[1](S) sda[0](S) 4520 blocks super external:imsm unused devices: <none>
