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.

So, let's say your server had 6 healthy hard drives. A drive fails (will not mount/detect, drops out of raid with errors) or is failing (SMART getting worse, etc). You need to swap out the bad drive. When you open the case you see.. six identical hard drives.

How can you tell which one is no longer healthy/mounting/functioning?

System would be linux, most likely ubuntu server, using at most simple software RAID. The hard drives would be SATA and connected directly to the motherboard. (no raid controller)

I don't want to randomly disconnect drives until I pick the correct one. The drives all appear identical to me; I imagine there is some common way to identify which drive is which that I am unaware of. Does anyone have any pointers/tips/best practices? Thanks!

EDIT: I had wanted this to be 'generalized' in a hand-wavy sort of way, but it just came off as 'incomplete' and 'horrible'. My bad!

share|improve this question
2  
If you have to shut down the machine and figure out which hard drive is what, you should take the time while the machine is down to identify each harddrive and label it in some manner so this when this happens again, you don't have this issue. –  Roy Rico Sep 10 '09 at 18:53
1  
A "RAID (or whatever)"? Sounds like a user's loose inside the machine room. –  romandas Sep 10 '09 at 18:58
1  
A proper server will tell you which drive by turning on the drive error indicator of the bad drive. –  John Gardeniers Sep 10 '09 at 23:47
3  
Man everyone is so quick to jump on this as being naieve... frankly I think it's a good question, one that I've had to deal with myself! –  Mark Henderson Sep 11 '09 at 12:36
1  
I'm curious if there, for hobby purposes, is possible to somehow construct (with soldering iron in hand and so on) drive signalling LEDs to identify them physically from within a random OS (when there's no decent server-grade disk/raid controller present to do their magic)... –  Oskar Duveborn Oct 26 '10 at 18:03
show 6 more comments

8 Answers 8

up vote 16 down vote accepted

I had this exact problem on a (tower) server just like you explain, and it was easy:

smartctl will output the serial number of the drive

Vendors sometimes ship their own specific tools, like hdparm, that will do the same.

So output the serial of the bad drive, and then use a dentist's mirror and a flashlight to find the drive.

On a rackmount you'll usually have indicator lights like other people have said, but I bet the same would apply.

share|improve this answer
    
Whoops...smartctl, not hdparm was the one I'm thinking of. I need to edit my answer to reflect that. –  Bart Silverstrim Sep 10 '09 at 21:15
    
upvoted for reminding me of the right command :-) –  Bart Silverstrim Sep 10 '09 at 21:15
1  
hdparm -i shows me the serial numbers of my drives -- That may be a vendor-specific response, though –  Ian Clelland Sep 10 '09 at 22:02
1  
excellent! I can't try it now but it looks like this is the answer! I will now label my hard drives with the last N digits of their serial numbers (assuming this is unique, per server) in an place that is exposed while mounted. Also from googling the command looks to be "smartctl -i" –  privatehuff Sep 11 '09 at 14:00
add comment

Usually you would have to hope that the connections are labeled in some fashion then work from the identity of the failed device. For example...and someone would have to comment to correct me...if you have two IDE channels, you have up to 2 drives on each, you could have sda, sdb, sdc, and sdd. If sdd failed it would be the second drive on the cable of the second IDE channel.

If it's SATA and like the system I have in the back room the ports are labeled for each of the sata drives. Again, drive lettering goes from a through whatever the drives go up to, starting at port 0 of the SATA connectors and moving up.

If there are any manufacturing differences, the dmesg |grep sd or dmesg|grep hd should yield some clues.

If you have the serial numbers available I think the hdparm command might give it to you in software so you can trace it that way. You might want to label the drives somewhere if that's the case so you don't have to worry about that when you find there's an issue.

...I knew there was another reason I preferred hardware RAID over software RAID...blinky lights. Really like the blinky lights.

EDIT: smartctl, not hdparm, gives the serial number. My bad.

share|improve this answer
    
+1 for the blinky lights –  Oskar Duveborn Oct 26 '10 at 18:01
add comment

Six internal HDDS? If they are external, hot swap drives, the hot swap carrier likely has an error light to help you identify the bad drive. Also many Raid management programs have an option to flash the light on a particular drive to determine which is which. If they are all internal with no lights, then you are down to your RAID software telling you which IDs are good, and looking at the SCSI IDs, etc to to figure it out. If they are set to auto, then your RAID controller doc should tell you what order in the SCSI chain the IDs are assigned. Good Luck. Take a backup now while things are still running!

share|improve this answer
add comment

At the very least the RAID software/controller which told you about the failed drive should tell you which drive had failed (id number). 0 is usually the one on the top left, moving down, then to the right (if in two or more columns). The ports are probably labeled.

share|improve this answer
add comment

What kind of drives are they (SATA/SCSI/SAS)?
What storage controller are you using?
Which operating system?
Is it hardware or software RAID?
Who is telling you a drive is faulty?

You really should provide some more info here...

share|improve this answer
    
This information is what is needed. However, it sounds to me like the OP is unfamiliar with any of this, and personally I wouldn't want him/her touching the hard drives at this point without someone that knows what they are doing guiding them through the process IN PERSON. –  TheCleaner Sep 10 '09 at 18:34
add comment

They should be labeled on the chassis and correspond with the RAID Software.

On our Dells, the are not the way you would think. On ours 0:0 is bottom left, 0:1 is top left, 0:2 is bottom middle, etc. In all servers I've used (except homemade jobs), the RAID software will indicate the port, and it will be labeled.

share|improve this answer
add comment

When all else fails, you can identify the not-failed drives and work backwards.

find / -type f -exec cat {} \; >> /dev/null

Whichever drives activity lights do NOT come on are likely bad (and hopefully it's just one.) Note that if you have hot-spares configured, those won't light up either.

share|improve this answer
add comment

scsirastools has a set of tools that let you do various diagnostic tests on SCSI disks. You can also use sgmon to power down a disk under software control. This would at least let you identify the physical disk of you could locate it with the diagnostics.

If you have a hardware RAID controller the controller's BIOS or management software should have a facility that lets you identify bad disks.

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.