Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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?

share|improve this question
add comment

2 Answers 2

up vote 5 down vote accepted

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

share|improve this answer
add comment

This file will give you RAID informations like which drives are assigned to each RAID

cat /proc/mdstat
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.