My CentOS 6 server is running a software RAID 1 configuration with two 1 TB disks. Yesterday trouble started happening when the server was very irresponsive. I checked the logs and noticed a whole bunch of continuous error messages having to do with disk IO. I also noticed that the second disk /dev/sdb got 'kicked' out of the RAID 1 setup. It said it was degraded and showed [U_] instead of [UU] when I did a cat /proc/mdstat
.
The output looks like this:
root@rescue:~# cat /proc/mdstat
Personalities : [linear] [raid0] [raid1] [raid10] [raid6] [raid5] [raid4] [multipath] [faulty]
md1 : active raid1 sda1[0]
20971456 blocks [2/1] [U_]
md2 : active raid1 sda2[0]
955260864 blocks [2/1] [U_]
unused devices: <none>
After contacting my hosting company where the server is running and running smartctl to check the drives it turns out both disks need to be replaced.
At this point I can only but up in rescue mode where I can still mount my partitions (/dev/md1 and /dev/md2) and access the data. I already downloaded the most recent Plesk backups using scp.
Now please bear with me as I'm not a server administrator, but my plan is to first replace the second disk, /dev/sdb and re-add it to the RAID 1 setup. That way the new second disk will be synched with the old disk 1. After that's done I can repeat the process with disk 1 and sync the new disk 1 with the new disk 2. Is that possible?
Also what steps should I take to do this?
- Replace faulty disk 2 with new disk 2
- Partition disk 2 the same as disk 1:
sfdisk -d /dev/sda | sfdisk /dev/sdb
- Add the new disk to the partitions /dev/md1 and /dev/md2:
mdadm --manage /dev/md1 --add /dev/sdb1
andmdadm --manage /dev/md2 --add /dev/sdb2
- Wait for synch to complete keeping an eye on /proc/mdstat to verify
- Repeat above steps for disk 1
Does this look okay? And will the synching start right after point 3? Did I forget anything in these steps?