Welcome! Log In Create A New Profile

Advanced

Netgear ReadyNAS duo V2 - hard disk presence LEDs

Posted by AndreaCipcino 
Netgear ReadyNAS duo V2 - hard disk presence LEDs
July 25, 2024 06:24PM
Hello,
I have managed to run a rootfs of Debian 12 + OMV7 on this old NAS. Everything works except hard disk presence LEDs. Those two LEDs remain off, instead they should turn and stay on when an hard disk is connected in the sata port.
I know that an user managed to make them work by adjusting an udev rule file, but I am very noob in Linux and I have no idea how to do it.
I'm quite stuck.
Please can someone help me to make those led to work? Thank you very much.
Re: Netgear ReadyNAS duo V2 - hard disk presence LEDs
July 25, 2024 08:47PM
AndreaCipcino,

> I have managed to run a rootfs of Debian 12 + OMV7
> on this old NAS. Everything works except hard disk
> presence LEDs.

Which kernel are you running on this ReadyNAS duo V2?

If you are running my regularly released kernel here, then yes that's how it behaves. When you access the HDD, it will flash to show activities.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Netgear ReadyNAS duo V2 - hard disk presence LEDs
July 26, 2024 02:22AM
Hello bodhi,
yes I have used your rootfs of Bookworm with included kernel version 6.5.7. Then creating swap file, done apt-update / upgrade, and set it to boot with systemd. Then installed omv7. Should I update kernel with your latest version?
There are 3 LEDs on Nas. "Act" led actually works with hard disks activity. Led "1" and "2" instead are always off.
I don't know if it is related but I have X-RAID2 on those disks. I don't think that I should reformat the disks for use on omv7 since X-RAID2 with 2 disks should be using RAID1. Thank you!

Ps: during omv7 installation I got another "update-initramfs" so I have regenerated again the uInitrd boot file.



Edited 3 time(s). Last edit at 07/26/2024 04:02AM by AndreaCipcino.
Re: Netgear ReadyNAS duo V2 - hard disk presence LEDs
July 26, 2024 02:19PM
AndreaCipcino,

My notes in the release.

Quote

Updated 01 Nov 2023:

Basic Debian bookworm Kirkwood rootfs for most Kirwood plugs:

- tarball size: 250MB
- install size: 714MB
- The init system used in this rootfs is sysvinit . To boot with systemd, see Notes below.
- Installed packages: nano, avahi, ntp, busybox-syslogd (log to RAM), htop, isc-dhcp-client, dialog, bzip2, nfs server/client, iperf, ethtool, sysvinit-core, sysvinit, sysvinit-utils, u-boot-tools, libubootenv-tool, mtd-utils, and orphan-sysvinit-scripts.
- see LED controls examples in /etc/rc.local, and /etc/init.d/halt

So do
ls -l /sys/class/leds
And you should see
status:blue:disk1_led
status:blue:disk2_led

And see this Wiki topic for example

How to control LEDs in Linux userspace (HDD LEDs triggers)
https://forum.doozan.com/read.php?3,136816,136829#msg-136829

If you are running systemd, instead of /etc/rc.local, you might need a different set up during boot to set the triggers.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Netgear ReadyNAS duo V2 - hard disk presence LEDs
August 02, 2024 10:48AM
Bodhi,
I have managed to configure all the leds with systemd method, here I show how I have done it for people who might find useful for resolving similar issues:

for configuring leds I have used udev rules:
I have created a new rules file in /etc/udev/rules.d and called it 10-local.rules
cd /etc/udev/rules.d/
touch 10-local.rules

Then I have gained udev info for the leds that I wanted to configure using udevadm info:
udevadm info -a -p /sys/class/leds/status:blue:backup_led
this is the output:
looking at device '/devices/platform/gpio-leds/leds/status:blue:backup_led':
    KERNEL=="status:blue:backup_led"
    SUBSYSTEM=="leds"
    DRIVER==""
    ATTR{brightness}=="0"
    ATTR{max_brightness}=="1"
    ATTR{power/control}=="auto"
    ATTR{power/runtime_active_time}=="0"
    ATTR{power/runtime_status}=="unsupported"
    ATTR{power/runtime_suspended_time}=="0"
    ATTR{trigger}=="[none] usb-gadget usb-host kbd-scrolllock kbd-numlock kbd-capslock kbd-kanalock kbd-shiftlock kbd-altgrlock kbd-ctrllock kbd-altlock kbd-shiftllock kbd-shiftrlock kbd-ctrlllock kbd-ctrlrlock f1072004.mdio-bus-mii:00:link f1072004.mdio-bus-mii:00:1Gbps f1072004.mdio-bus-mii:00:100Mbps f1072004.mdio-bus-mii:00:10Mbps usbport timer oneshot disk-activity disk-read disk-write ide-disk1 ide-disk2 mtd nand-disk heartbeat gpio cpu cpu0 default-on panic rfkill-any rfkill-none"

this gives all the information for creating the rule. I have done the same with status:blue:disk1_led and status:blue:disk2_led
After that I have edited my newly created 10-local.rules file and inserted these rules:
KERNEL=="status:blue:backup_led", ATTR{trigger}="usb-host"
KERNEL=="status:blue:disk1_led", ATTR{trigger}="ide-disk1"
KERNEL=="status:blue:disk2_led", ATTR{trigger}="ide-disk2"

The new rule can be tested with
udevadm test /sys/class/leds/status:blue:backup_led

And finally for activating the rules:
udevadm control --reload

After configuring those 3 leds, I wanted to make power led blinking upon issuing shutdown/reboot commands, so I created a new systemd service for doing so:
The service file which I have called "powerled-blink" must be created in /etc/systemd/system and must have ".service" extension.
cd /etc/systemd/system
touch powerled-blink.service

Then I edited it with nano :
[Unit]
Description=Power led blinking at shutdown

[Service]
Type=oneshot
RemainAfterExit=true
ExecStart=/bin/true
ExecStop=/bin/bash -c "echo timer  > /sys/class/leds/status:blue:power_led/trigger"

[Install]
WantedBy=multi-user.target

what this service do is running the command "true" (ExecStart=/bin/true) on boot and will mantain it as it is still running (Type=oneshot + RemainAfterExit=true) until the machine will stop. As soon as the machine stops the service will be stopped and before it's termination will execute what is in the ExecStop= , which in my case it is using the timer (that blinks on and off) trigger for status:blue:power_led.
After that for activating the new service:
systemctl daemon-reload
systemctl enable powerled-blink
reboot

And all was done !
Author:

Your Email:


Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: