I had a failed drive from a RAID-1 array (2 drives) replaced and now need to:
- Format it.
- Add it back to the array.
My drives are like this:
root@s01 [~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/vg_server01-LogVol01
2.7T 416G 2.2T 17% /
tmpfs 7.8G 0 7.8G 0% /dev/shm
/dev/md0 477M 149M 303M 33% /boot
/dev/md2 32G 5.6G 25G 19% /mysql
/usr/tmpDSK 4.0G 220M 3.6G 6% /tmp
root@s01 [~]#
The /dev/md2 works fine. The /dev/md1 is the one that had failed. After the drive was replaced, it looks like this:
root@s01 [~]# mdadm --detail /dev/md1
/dev/md1:
Version : 1.1
Creation Time : Sat Jul 7 18:23:24 2012
Raid Level : raid1
Array Size : 2929751932 (2794.03 GiB 3000.07 GB)
Used Dev Size : 2929751932 (2794.03 GiB 3000.07 GB)
Raid Devices : 2
Total Devices : 1
Persistence : Superblock is persistent
Intent Bitmap : Internal
Update Time : Tue Jul 5 10:54:30 2016
State : clean, degraded
Active Devices : 1
Working Devices : 1
Failed Devices : 0
Spare Devices : 0
Name : server01.domain.com:1
UUID : 58600fc5:5348d92c:a7d25465:20d42940
Events : 2281612
Number Major Minor RaidDevice State
0 0 0 0 removed
1 8 50 1 active sync /dev/sdd2
root@s01 [~]#
I noticed it says "removed" and there's just 1 drive in the array. But there should be 2 identical ones in the machine, just one isn't formatted and added.
The drives that are in the array that works okay are:
0 8 1 0 active sync /dev/sda1
1 8 17 1 active sync /dev/sdb1
So it looks like the one I need to format and add to the array is /dev/sdc
? But how?
root@s01 [~]# lsblk -d -n -oNAME,RO | grep '0$' | awk {'print $1'}
loop0
sda
sdc
sdb
sdd
root@s01 [~]#