Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to blink the failing device in my 24-disk SAS enclosure.

I have found sg_ses --index 7 --set=locate /dev/sg24 which is supposed to identify slot 7.

But how do I figure out which slot/index /dev/sdh is?

This is not obvious as Linux does not name /dev/sdX after the slot, but after the sequence it was detected. Think what happens if slot 1 is empty at boot, but is filled later.


The controller is a SAS2008.

share|improve this question
This is completely dependent upon your array controller hardware. You need to tell us what that is. – Patrick Apr 19 '12 at 23:12
I checked my system (Sles11 sp2), the sg_ses doesn't have a --index and --set as input params, and there is no /sys/class/enclosure* in the sles11 sp2. What's your Linux environment? Did you install other utilities in the OS by yourself? – user22001 Aug 13 '12 at 8:46
Debian Stable: Linux server 3.2.0-0.bpo.1-amd64 – Ole Tange Aug 13 '12 at 13:15
up vote 7 down vote accepted

After cycling around /sys for a while, I found this solution:

# echo /sys/class/enclosure/*/*/device/block/sdaa
/sys/class/enclosure/2:0:35:0/Slot 15/device/block/sdaa
# echo 1 > '/sys/class/enclosure/2:0:35:0/Slot 15/locate' 


# echo 1 > /sys/class/enclosure/*/*/device/block/sdaa/../../enclosure*/locate

To blink all detected devices:

parallel echo 1 \> ::: /sys/class/enclosure/*/*/device/block/sd*/../../enclosure*/locate

This is useful if you have a drive that is so broken that is not even detected by Linux (e.g. it does not spin up).


I have made a small tool (called blink) to blink slots. https://github.com/ole-tange/tangetools/tree/master/blink

share|improve this answer

Check what /sys/class/block/sdh links to. You can see the host, target and LUN this way. Usually this is enough to pinpoint the device's hardware address.

share|improve this answer
Thanks for pointing me to /sys. As you can see the solution is a bit more involved. – Ole Tange Apr 20 '12 at 9:35
@OleTange Ok. You should post your solution as an answer, please don't post answers in questions as they are not easily visible to future visitors. It's OK to ask and answer your own question.. I'll leave my answer because it shows the general approach, but you should accept your own answer (when the system lets you, there's a delay) since it's more complete for this particular task on this particular enclosure. – Gilles Apr 20 '12 at 12:37

There is a nice tool encled (available at https://github.com/amarao/sdled) to manage your enclosure led's.

You should be able to use it like this (not tested, though):

encled /dev/sgh fault

From the README:

fault - set led indicator to 'faulty'. This WILL NOT make device faulty, just set enclosure led to 'FAULTY' status.

share|improve this answer
Hi and welcome to the site. We like answers to be more comprehensive here. Could you edit your answer and provide an example of how the OP could use this tool to achieve their objective? As it stands, it is not an answer but a comment. – terdon Apr 2 '15 at 14:27
While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes. – dhag Apr 2 '15 at 15:00
Look, if I have a tool and know where I can find this tool, whats wrong with answer? I definitely know that edited answer is wrong, since initially author of this question requested a locate led. But, anyway, this answer provide much easiest way to made led on enclosure blink than previous. – Siarhei Karatkevich Apr 3 '15 at 17:55

Your Answer


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.