Writing LED brightness value to /sys/class/leds/gl-ar150:lan/brightness

I know that I can switch on/off the LEDs using echo 1 > /sys/class/leds/gl-ar150:lan/brightness or echo 0 > /sys/class/leds/gl-ar150:lan/brightness. Now, I have a script which checks my upstream connectivity and updates the LED status quite frequently. But I have read that we need to avoid writing on flash too often. For frequent updates, we need to use the /tmp directory (ie., writing on the RAM).

Thus my question is, Doesn’t the above operation write on the flash? If yes, Is there any other way to switch on/off the LED?

sysfs is mounted on /sys and from kernel.org:

sysfs is a ram -based filesystem initially based on ramfs

It doesn’t write to flash, the filesystem is map to RAM after boot up.

1 Like