Make HDD enclosure LED blink in Linux

by RamWise
Published: Last Updated on 3,861 views

Make HDD enclosure LED blink in Linux

At times it becomes hard to locate the hard drives when you have a huge server or hard drive enclosure. By blinking Hard Drive enclosure LEDs we can locate them in Linux. There are many ways to do this, but I have found the below two options to be more useful to me often.

Using the classic 'dd' command

DD command is basically used for file copying or moving.

dd if=/dev/sdX of=/dev/null 

Here replace the source /dev/sdX with the hard drive mount-point you are trying to locate. Essentially, this command attempts to copy from the source disk to the garbage can. This process will trigger your enclosure LED to blink continuously. Hit Ctrl+’C’ once you have found your HDD location to stop the copying process, don’t forget to do this.

Another important point to note is that, this will work only if you are HDD is functional. It may not work if your disk is dead.

So, my next options will address this problem by exclusively working on the enclosure LED alone

Using the 'ledctl' utililty

First install the ledctl utility by installing the ledmon package.

sudo apt-get install ledmon 

Issue the ledctl on the HDD mount-point

sudo ledctl locate=/dev/sdX 

To trigger multiple HDD enclosure LEDs you can do as below

sudo ledctl locate={ /dev/sdX /dev/sdY } 

Remember that this will only blink the LED momentarily, unlike the ‘dd’¬†operation.

Leave a Comment

This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish. Accept Read More