Failed HDD question regarding suppression before replacing
Hi,
I just had an interview at a company with a heavy Linux environment and I was asked this question and wasn't quite sure: If you have a hard drive in a raid array and it's throwing errors and needs replacing, but you see the drive is still in use: what command do you type to suppress the drive and show it as offline before physically removing the drive? Thanks in advance! |
Quote:
|
"umount /dev/sd"[drive letter] ?
|
Not if it's in a raid array, the individual partitions are not mounted separately.
The answer is it depends on if it's a hardware vs software raid, and if hardware, what the manufacturer's tools are. |
Damn! I blew that one then...so if it's a software raid what would need to be done?
|
I don't know off the top of my head, I'd have to look at the man page for mdadm (the Linux software raid manager).
|
If they use mdadm, then you do it like this. Replace the device names as required.
Fail the device if not already in a failed state Code:
mdadm /dev/md0 --fail /dev/sda1 Code:
mdadm /dev/md0 --remove /dev/sda1 Code:
mdadm --zero-superblock /dev/sda1 |
All times are GMT -5. The time now is 11:45 PM. |