LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Failed HDD question regarding suppression before replacing (https://www.linuxquestions.org/questions/linux-newbie-8/failed-hdd-question-regarding-suppression-before-replacing-4175575937/)

bomurf 03-26-2016 09:24 PM

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!

hortageno 03-27-2016 03:54 PM

Quote:

Originally Posted by bomurf (Post 5521797)
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?

So what was your answer?

bomurf 03-27-2016 06:04 PM

"umount /dev/sd"[drive letter] ?

suicidaleggroll 03-27-2016 06:53 PM

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.

bomurf 03-27-2016 06:58 PM

Damn! I blew that one then...so if it's a software raid what would need to be done?

suicidaleggroll 03-27-2016 07:48 PM

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).

hortageno 03-28-2016 05:37 AM

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
remove it
Code:

mdadm /dev/md0 --remove /dev/sda1
optionally zero out the superblock
Code:

mdadm --zero-superblock /dev/sda1


All times are GMT -5. The time now is 11:45 PM.