how to control Hard Drive light from Linux?

SilverNodashi

Expert Member
Joined
Oct 12, 2007
Messages
3,337
Hi all,

Does anyone know how to control a hard drive light from Linux? I'm building a 24bay Linux File server which will run software RAID and I need an easy way for the engineers to see which HDD has gone bad.

Most of our NAS devices has 2 lights on the hard drive cages and they automatically signal a bad one (reg light, light constant on , etc) but I can't figure out how todo this from Linux.
 

stricken

Expert Member
Joined
Sep 5, 2010
Messages
2,265
Two ways. First is to simply read / write / pause about 10 bytes every x seconds. (But i suppose if the drive is bad then you wont be able to :p) ... second choice is to study the interrupts of the Mobo powering this Nix Server, and see if you can inject (i.e simulate a drive read/write/pause) on the bus when you cannot see the drive anymore - which should also make the light go blinky.

if the light is on the drive (some rare ones have this), then your only hope is to dump the firmware, decompile it, study the drive controller, see which pin puts the LED high, figure out where in your decompiled code the pin is put high, and somehow insert some code to make it do this automagically if something goes wrong. :eek:
 

Other Pineapple Smurf

Honorary Master
Joined
Jun 21, 2008
Messages
14,593
We just took a label making machine and labelled our drive bays. We then use Nagios to monitor our servers (which are all sitting 1500km from our technical office) and when a drive needs replacement we just get our sales staff to walk in and replace said faulty drive - not as nice as your system but ours work perfectly. We replace about 1 drive every 3mths, sometimes even sooner.
 

nivek

Honorary Master
Joined
Mar 25, 2005
Messages
10,271
Hi all,

Does anyone know how to control a hard drive light from Linux? I'm building a 24bay Linux File server which will run software RAID and I need an easy way for the engineers to see which HDD has gone bad.

Most of our NAS devices has 2 lights on the hard drive cages and they automatically signal a bad one (reg light, light constant on , etc) but I can't figure out how todo this from Linux.

Have you got an IPMI connection from your m/b to the backplane?
If not I dont think its possible..

If you do, then there should be some existing IPMI utility that you can use
 

The_Unbeliever

Honorary Master
Joined
Apr 19, 2005
Messages
103,196
We just took a label making machine and labelled our drive bays. We then use Nagios to monitor our servers (which are all sitting 1500km from our technical office) and when a drive needs replacement we just get our sales staff to walk in and replace said faulty drive - not as nice as your system but ours work perfectly. We replace about 1 drive every 3mths, sometimes even sooner.

Of course Nagios (or any monitoring utility) will be worth diddly squat if the hard drives aren't installed in numerical order.

And documentation, documentation and more documentation to drown the techies with :D
 

SilverNodashi

Expert Member
Joined
Oct 12, 2007
Messages
3,337
Does your individual bays have LEDs for each HDD?

Yup, most hot swap HDD bays have 2 lights, on for power / fault and the other for activity. Some bays only have one light which then change colors as needed. But, the controllers also need to have this output, so you won't find this functionality on a desktop motherboard. Many servers boards have it, and RAID cards as well.

The RAID card already does this for me, but not on demand. I.e. if I see a drive which has a certain amount of bad sectors, then I'll replace it before it becomes a problem. So I want to send a signal to the guys in the office and tell them to replace the drive with the red light on :)
 

ponder

Honorary Master
Joined
Jan 22, 2005
Messages
92,825
Lol, you took so long to reply I forgot what my reply was going to be if each bay had individual indicators :eek:
 
Top