My book live never sleeps

Hi Tony (and all friends),

As I use this box only as storage (NFS&Samba) I killed the twonky and the other niceties off, but the standby mode still doesn’t kick in. Taking a look at the system, I found this:

/usr/bin/monitorio.sh is monitoring the I/O by checking /proc/diskstats every minute

! By calling a lot of tools from /bin and /usr/bin ! As soon as the content of these executables is dropped from the fs cache, the disks will spin up to fetch them again, so the sleep time will be the fs cache retention time rounded up to the next minute.

IMHO the best way would be simpler to let the drives handle the standby themselves: hdparm -S 120 /dev/sd[ab]

Sure, for the flashy led show you would need some program that, once loaded, can perform file operations on the /proc/… entries without touching anything, but since you have /usr/bin/php, I don’t think that’s a problem.

Or, shadow the whole /bin, /lib, /usr/bin, /usr/lib to ramdisk. Or, put the whole branch to the initrd image and run it from there.

The same is true for /etc/rc.logrotate: shell script, invokes external binaries.

For some reason, syslogd also wakes up the drives, regardless of the ‘-m 0’.

The smbd and nmbd also keep some file open, and although they don’t write them, a ‘stat’ is still considered as IO: /usr/var/locks.hd/*.tdb, /DataVolume/jewab/log.smbd, /usr/private/secrets.tdb, /usr/var/log/log.nmbd.

I haven’t checked the /proto/SxM_webui/* files, but they seem to behave nicely, not waking up the disks.

As a conclusion: your firmware, as it is now, heavily relies on a writeable storage, and therefore the standby mode requires heavy refactoring. If you allow me some advice (on the base of several flash-based embedded systems):

  • Run from the initrd. If you don’t intend to write the binaries, why switching to an r/w storage?

  • Unless doing config changes, keep everything r/o. When changing a config: remount rw, change, remount ro.

  • If something needs transient state data (like logs), send them to ramdisk that you rotate frequently.

  • Don’t enable the standby mode that you didn’t test, the frequent spinning up/down heats up the disks more than the constant operation.

Regards,

Mozsafa

1 Like