I have a software RAID 1 setup on CentOS 6.9 with two HDDs (SDA & SDB). SDB's smart self-test began throwing errors this week:
Device: /dev/sdb [SAT], Self-Test Log error count increased from 0 to 1
Thus, this morning I set it to a failed state using mdadm and removed SDB and inserted a new HDD. The commands I ran are:
smartctl --all /dev/sdb cat /proc/mdstat mdadm --manage /dev/md1 --fail /dev/sdb1 mdadm --manage /dev/md1 --remove /dev/sdb1 mdadm --manage /dev/md5 --fail /dev/sdb5 mdadm --manage /dev/md5 --remove /dev/sdb5 mdadm --manage /dev/md3 --fail /dev/sdb3 mdadm --manage /dev/md3 --remove /dev/sdb3 mdadm --manage /dev/md2 --fail /dev/sdb2 mdadm --manage /dev/md2 --remove /dev/sdb2 cat /proc/mdstat shutdown -h now
The top command allowed me to see the HDDs Serial number to ensure I pulled the correct drive.
After putting a new drive in the servers BIOS simply give me an error (along the lines of) install a proper boot device and restart the machine.
My assumption is that (somehow) I mistakenly only had the MBR on SDB (only a guess). Thus, it will not boot with SDB removed. I tried putting SDB back into the machine and it just clicks (of course) and gives me the same error of install a proper boot device and restart.
Can anyone make any suggestions on how to get this machine to boot so that I can recover all of my data? SDA should still be a good HDD. Further, if there is a way to boot from SDA then I should be able to install a new SDB and allow the software RAID to sync.
Thanks to RalfFriedl I have the server booted from a LiveCD.
I have used:
sfdisk -d /dev/sda | sfdisk --force /dev/sdb
to partition the new SDB just like SDA.