Spindown your hard drive when hdparm doesn’t work

On several Western Digital drives, hdparm doesn’t play so good. That’s why the hd-idle project was created. But hey, that’s C and not very flexible actually. Have a look at my Python rewrite here. It uses sg3_utils sg_start tool and it’s been successfully tested on SATA (over SCSI layer) devices. I don’t know if it’s going to work on pure SCSI devices (given the fact that they might not come back from spindown automatically, IIRC).

Feel free to deploy it on your home server, it really saves a lot of money on the electricity bill.

About lxnay

the creator of Sabayon Linux, Entropy Package Manager {Eit, Equo, Rigo}, Molecule release media buildsystem, Matter Portage buildbot/tinderbox and only God knows what else...

3 responses to “Spindown your hard drive when hdparm doesn’t work

  1. Stupot

    Why the recent dive into power saving, if I may ask?

    I considered worrying about optimizing my home server (45 watt quad core AMD), but when I look at the electricity used during the winter vs how much it used during the summer (Air Conditioning) the computer draw is negligible.

  2. Yes. it seems like using a util to reduce power consumption of your hd’s is a futile effort. (unless your in a bunker in antarctica running off a diesel genney). However if this increases hd life/reliability then im all for it. I have a SSD drive for my new laptop, and with ssd problems like idlespin fizzle and dissapear and in some cases are replaced by new issues.

    Are there any official distro recomendations/tips/packages/settings for ssd drive tweaking? I have read a few small guides witth tips regarding other linux flavors, some were universal, some tips were more distro specific.

    thx

  3. Mikeyb

    Hmm,

    On some of my SATA drives, the STOP message sent by sg_start and original hd-idle doesn’t play well with smartctl at all… any attempt to query the drive wakes it up, thus preventing me from having monitoring tools running and disk spindown.

    I’ve tried spinning these disks down into an explicit standby powerstate using sg_start, but that command throws an invalid CDB field error, even if avoiding sg_start and directly sending the required SCSI command sequence using sg_raw.

    hdparm -y though puts the troublesome drives (a Seagate and a Maxtor) into a standby state that can still still have some smartctl queries run without spinup.

    I’ve hacked hd-idle to system call hdparm -y instead of doing a direct issue of the SCSI stop command. Might be worth looking at your script to see how it plays with smartctl / smartd…

Leave a comment

Enter your email address to follow this blog and receive notifications of new posts by email.

Join 581 other subscribers

del.icio.us