You are not logged in.

#1 2014-03-27 04:19:33

arew264
Member
From: Friendswood, Texas, US
Registered: 2006-07-01
Posts: 394
Website

Per-Hard Drive Status LEDs

I've been working on replacing the factory firmware on a NAS box I own, and I'm at a loss as to how to drive the HDD status LEDs.

The box has a green and a red light for every drive bay. In the factory firmware, the vendor patched the Intel SATA driver so that disk activity caused the green light to pulse, and the red light illuminated when the drive wasn't in the RAID array, the drive had failed, or the drive was re-synchronizing.

I would prefer to stick with a vanilla kernel as much as possible (although I'm having to do some simple driver work to make the LEDs function at all), so I would prefer not to use the same hacky techniques the vendor resorted to. What's more, I'm planning on using btrfs across the drives rather than straight RAID, so patching the RAID driver wouldn't help anyway.

Ultimately, I'd like a green light if the drive is behaving and a red light if it isn't, and I need to make the lights correspond to the SATA port the drive is connected to (and hence the drive bay on the NAS chassis). Does anyone have an idea for where I could look for this information? Can I get it out of btrfs, or do I need to poll a SMART monitor or something?

Offline

#2 2014-03-28 22:02:01

arew264
Member
From: Friendswood, Texas, US
Registered: 2006-07-01
Posts: 394
Website

Re: Per-Hard Drive Status LEDs

I guess I'll try stating the problem a different way.

I have a NAS box with a green and red LED for every hard drive. These LEDs are software-driven, and I've done the driver work to make them show up like normal LEDs in /sys/class/led.
I'm planning on using a btrfs RAID 1 setup with the box, and I'd like to make these LEDs show something meaningful. Is there a way to get drive health information out of btrfs? Is there a way to figure out what SATA port each drive is connected to?

Offline

Board footer

Powered by FluxBB