hdd-spindown.sh icon indicating copy to clipboard operation
hdd-spindown.sh copied to clipboard

Use partition-based stats for spinning down disks

Open bocki opened this issue 3 years ago • 0 comments

On newer kernels (apparently >5.4) disk monitoring tools will alter R/W stats in /sys/block/$1/stat, therefore preventing hdd-spindown.sh from ever spinning down disks. Individual partitions listed in /proc/diskstats however will stay unchanged if no "real" activity happened.

These commits will change hdd-spindown.sh to read /proc/diskstats once per interval and store the individual disks and partitions in an array. Comparing disks will now optionally loop over their corresponding partitions if defined in hdd-spindown.rc. If R/W stats of all partitions did not change, hdd-spindown.sh will be instructed to spin down the disk, ignoring any change in activity on disk level.

Ideally this should solve #5 :)

bocki avatar May 14 '21 22:05 bocki