Editing /sys/class/leds/phy0-led/ configs

0

I am trying to configure LEDs on my laptop running Xubuntu 14.04. I found out that there are some configs that affect LED behaviour, located in /sys/class/leds/phy0-led/. There are 3 relevant files: "brightness", "max_brightness", and "trigger".

The problem is, I can't find any way to change those files. I tried the following:

  1. I am of course logged as root via sudo -i.
  2. I applied chmod 777 to all these files.
  3. I tried using leafpad/vim/mousepad to edit and save them; I tried echo and cat; I tried using tee.
    • leafpad writes and saves, but then I open the files again, and there are no changes.
    • vim fails with some Fsync error, mousepad can't even "mount" the file.
    • cat/echo return write error: Invalid argument.
    • tee seems to have same behavior as leafpad; it appears to work without errors, but at the end, there are no changes.
  4. Even logging in under Ctrl+Alt+F1 and using console vim does not affect the result.

The only success I could achieve was changing the value stored in "brightness" from 1 to 0, and back. Whenever I would try to write something else in this file, it just would not work.

How is it possible that I'm not able to change any file on my system under root? And what would be a solution?


What I'm trying to achieve is ultimately switching off all LEDs completely, or at least changing the events on which they blink/light up. I don't mind not seeing status of my HDD if it needs to blink every other second to report that it's working.

Ufos

Posted 2015-06-06T09:21:42.697

Reputation: 119

This isn’t a regular filesystem. These files support only certain values as content and will revert on reboot. – Daniel B – 2015-06-06T10:52:58.690

Daniel, can you point out how is it called in the Linux universe? I would at least be able to read up on it. – Ufos – 2015-06-16T13:57:24.827

I don’t know if there’s a name for that. The whole construct is called sysfs.

– Daniel B – 2015-06-16T16:27:54.910

Answers

0

You can't disable the HDD led, because it's controlled by the HDD controller, not your laptop.

If you want to change the trigger just type:

echo heartbeat > trigger

in the proper led directory as root user. I don't know any other way to change the contents of this file. However, the brightness file can be modified by leafpad, gedit, nano...

redbeam_

Posted 2015-06-06T09:21:42.697

Reputation: 532

Following happens: root@MyLaptop:/sys/class/leds/phy0-led# echo heartbeat > trigger // -bash: echo: write error: Invalid argument – Ufos – 2015-06-16T14:09:17.340