Just in case for me (and others) when a software raid 5 degraded, how do I know which Sata Channel my dev/sda, /dev/sdb, etc. associated with, so that we can replace them properly?
2 Answers
Rather than trying to identify the failed disk by the SATA channel it's connected to, you can identify it by its serial number. I have found that most hard disks these days have their serial numbers stamped/printed on the front edge, so all you need to do is determine the serial number of the failed drive.
I assume you have already discovered the logical name of the failed drive via cat /proc/mdstat
. For the sake of example, let's assume that failed drive is /dev/sdb
.
Next, if you haven't got it already, install the lshw
package, and then run this command (I'm not sure if you need to sudo
it; it's harmless to try it with/without sudo
):
lshw -class disk
You should get output that looks something like the following:
*-disk:0
description: ATA Disk
product: ST32000542AS
vendor: Seagate
physical id: 0
bus info: scsi@2:0.0.0
logical name: /dev/sda
version: CC34
serial: 1AB23C45
size: 1863GiB (2TB)
capabilities: partitioned partitioned:dos
configuration: ansiversion=5 signature=12345678
*-disk:1
description: ATA Disk
product: ST32000542AS
vendor: Seagate
physical id: 1
bus info: scsi@3:0.0.0
logical name: /dev/sdb
version: CC34
serial: 6DE78FG9
size: 1863GiB (2TB)
capabilities: partitioned partitioned:dos
configuration: ansiversion=5 signature=90abcdef
From this, you should be able to identify the problem drive from its logical name
(e.g. /dev/sdb
), and thus obtain its serial number (e.g. 6DE78FG9
). With the serial number in hand, you can be confident you're pulling the correct drive.
(If your failed drive doesn't show up in the lshw
output at all, then it's really dead. You can probably still use lshw
to find the dead drive, but this time by process of elimination.)
This file will give you RAID informations like which drives are assigned to each RAID
cat /proc/mdstat