About a month ago, my laptop started acting sluggish; file access-time gradually increased to the point of several seconds to open a file.
Look up the S.M.A.R.T. values. Current Pending Sectors at six-hundred and increasing! Welp, this disk is on it’s way to kaput-land. Off to the computer store! Find a 1TiB Western Digital Blue (first choice was an HGST, but no-one here speaks that language), buy it.
So after that it’s an update backup, replace old drive with the new one, boot-strap Void, restore backup, get back to work.
Hold your horses!
I’m still getting some latency. The good news is that it only happens after some idle time, so this must be something other than hardware.
Turns out it is (well sort of). Intellipark seems to be a feature available in most Western Digital drives, and what it essentially does is park the hard-drive head after a pre-determined delay—presumably to conserve power.
But here’s the trouble: the usual delay is eight seconds.
Eight (yes that 8). Seconds.
Every hard drive has a rating for the number of times the drive head can be parked and un-parked before the drive begins to degrade; it’s just standard mechanics.
The current setup I use has several virtual-machines and containers running. And even if we take those out of the equation there’s still the logs being written. Essentially, this means that the drive head is being parked and un-parked every eight seconds. RIP.
I’d like to go on corporate-douchbaggery rant here but I got no proof, so… let’s just find a solution.
Can I change the default value? Yes! With the official DOS
WDIDLE.EXE
program. The bad news? There’s no download link
anymore.
Open-source to the rescue!
There’s two tools that can change this value: idle3-tools, and hdparm.
idle3-tools was made for the job, so:
$ idle3ctl -d /dev/sda
Idle3 timer disabled
Please power cycle your drive off and on for the new setting to be taken into account. A reboot will not be enough!
$ maeth
Now all we just need to commit the value permanently by
doing a power-cycle, which meant a complete
power-down
(maeth
is an alias for shutdown)
and power-up (pushing the power button).
Et voilà! That should end
Intellipark (and constantly running
smartctl
out of fear).
Now for some Camera Obscura!