ThinkPad HDD Led

On some (any?) new ThinkPad models, Lenovo has chosen not to add a hdd-led. E.g. on my new ThinkPad Edge E540.

Who is used to look at this led, when pc is stuck (it doesen’t change anything, but it is nice to know if it is working), will shurely miss it someday.

Under linux it is very simple to control the led, Lenovo uses as tittle on the ThinkPad logo.

You can find it as: /proc/acpi/ibm/led

A short cat /proc/acpi/ibm/led shows how to use it:
status: supported
commands: on, off, blink ( is 0-15)

Now we need a small script, that checks hdd activity and controls the led accordingly.

hdd activity can be found on:
cat /proc/diskstats
Column 1 and 5 are listing all read and write operations. When they change, our hdd should blink.

You’ll find a python script doing this in my GitHub-Repository (

it looks like this:

import time

led = "0"

def on(file):
    file.write(led + " on")

def off(file):
    file.write(led + " off")

def blink(file):
    file.write(led + " blink")

def get_val(line):
    a = line.strip(' ').split(' ')
    for x in range(a.count('')):
    return a

def blink():
    with open("/proc/acpi/ibm/led", "w") as l:

if __name__ == "__main__":
    i = ''
    while True:
        with open("/proc/diskstats", "r") as s:
            s =
            if s != i:
            i = s

Now we have to start this script on boot time. Cause I’m using Arch Linux and Arch uses systemd, I created a .service File for that:

Description=Enable ThinkPad LED as HDD LED



You’ll find the complete solution in the AUR: tp-hdd-led.

After installation you can start the service via:
systemctl start tp-hdd-led
and load it on every boot via:
systemctl enable tp-hdd-led

Tagged , , , , , , , , , ,