[<< | Prev | Index | Next | >>]

Monday, June 05, 2023

Sleepdisk (Idle Disk Sleeper)



[Nerdy stuff for linux sys admins]

One of my backup disks (a WD Blue) doesn't sleep on its own, so I needed something like hd-idle. But per usual I had enough issues with hd-idle that it was quicker to write my own, which I called sleepdisk.

It's basically the same functionality as hd-idle, except: you specify exactly (and only) the disks you want to sleep, with their associated idle times; hot-swapping is handled (however you want, depending on which /dev/ path you use to identify your drives); wakes and sleeps are logged (via stdout, to whatever log file you specify in the [optional] systemd service file); and, critically in my case, it works even on setups where "hdparm -y" increments the read count on the drive (which causes hd-idle to think the drive wakes up right after it's put to sleep!).

Lastly, it's just one short-ish python file with very standard imports, so easy to read/understand/modify as you wish.

Here's the source.



[<< | Prev | Index | Next | >>]


Simon Funk / simonfunk@gmail.com