4

My laptop has a WDC WD10JPCX-24UE4T0. It spins down after 5 seconds of idle. That is pretty annoying.

How can I change the spindown time?

I have tried:

/usr/bin/gnome-disks
hdparm -S 200 /dev/sda
hd-idle -i 100 -a sda

The disk spins down after 5 seconds still.

3

Not only annoying! It would make the drive dead in a matter of months probably.

So far I have found out you need to change APM level to allow suspending disks by setting:

hdparm -B 127 /dev/sdX

Where 127 is actually the maximum value allowing suspending drives (spindown).


And then you can change the suspend value with:

hdparm -S 241 /dev/sdX

From the man page:

Values from 241 to 251 specify from 1 to 11 units of 30 minutes, yielding timeouts from 30 minutes to 5.5 hours.


You'll need a service file for this to persist on suspend and reboot. Wait for it.

Something like this should work:

[Unit]
Description=hdparm sleep
After=suspend.target

[Service]
Type=oneshot
ExecStart=/sbin/hdparm -S 241 -B 127 /dev/sda

[Install]
WantedBy=multi-user.target suspend.target

Save it as root to:

/lib/systemd/system/hdparm.service

Then you'll need to activate it with:

systemctl enable hdparm.service

Take this service file only as an example, read thoroughly the hdparm man page!

  • 2
    How do you the op is using both Linux and systemd? Great answer +1 – Rui F Ribeiro Jan 30 at 10:01
  • Did not solve the problem. It still spins down very fast (less than 30 seconds). – Ole Tange Feb 9 at 7:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.