It copies the behavior of the shell script, which checks every minute
the hdd state (the script does this via hdparm, my program uses the
ioctl() call to /dev/sda that hdparm uses directly - this way, I avoid
accessing /usr/bin/hdparm).
It further reads /proc/diskstats (both shell script an program).
Accessing any /proc files should not lead to any hdd activity.
By NOT calling hdparm, I rather avoid hdd accesses which the original script maybe needs.
I do not know whether the ioctl() causes the hdd to "do" something
other than just returning its state.
You can get moving lights yourself by issuing the following command:
echo "1" > /sys/class/leds/oxnas-wd810-leds:st/brightness
or the "standby-blinking-light" with
echo "3" > /sys/class/leds/oxnas-wd810-leds:st/brightness
So the lights are no real indicator if the disk is accessed or not.
I never looked at this, is it true that my program causes "moving lights"
every minute and the original shell script does NOT do so ?
Anyway, from your other post in the forum I understand that you want
to completely disable spindown, so why not just use NO program at all
instead of worrying whether my program causes the hdd-heads to move more or less than the original script ?
Blip
EDIT:
Meanwhile I can confirm that version 1.0.3 and below had the
behavior of accessing the HDD every minute.
It was the ioctl() to see whether the HDD is active or allready asleep.
I never noticed this because the HDD really did shutdown after the idletime nevertheless, and did NOT wake up unless the HDD really was accessed by some other program….
I fixed the bug anyway with new release 1.0.4