Disable automatic HDD spindown (since latest update)

Since latest stable update, my harddisk spins down after some inactivity period. Before the update this was not the case, it was spinning continuously (this is what I prefer).

Which component is responsible for this new behaviour and how to restore the previous “always on” operation?

Thanks in advance

Hi @renkforce,

I think you might find your answer here:

2 Likes

Thanks for your reply, but this seems like a generic approach and doesn’t explain the change in behaviour from applying the latest updates. Some component seems to apply the automatic shutdown ATA command and I’d like to find out where, without wrinting custom scripts on my own.

Try seeing if there’s anything in the logs:

journalctl --grep=/dev/to/grep

Where /dev/to/grep is the device identifier of the offending device, e.g. /dev/sda.

In my case it’s /dev/sda but this returns no results unfortunately. Do I now have to add some custom scripting to prevent the spindown?

I feel like some component sends an ATA command to the drive to set some timeout, which didn’t happen before. I don’t want to issue additional ATA commands but turn off the initial cause.

Any insight what changed with recent updates?

Disable APM

sudo hdparm -B 255 /dev/sdX

Disable spindown

sudo hdparm -S 0 /dev/sdX

Permanent solution /etc/hdparm.conf (better to use id instead of sdX):

/dev/disk/by-id/*The id of your disk* {
    apm = 255
    spindown_time = 0
}
1 Like

Thanks, I’ll try that as a last resort.

I’d like to know which component introduced the new behaviour and adjust it accordingly. Something is currently setting the timeout and I want to get rid of it, instead of overwriting and fighting it with hdparm.

Perhaps new udev rules. You can have a look at the files in /usr/lib/udev/rules.d/ or /etc/udev/rules.d/.

Thanks but I couldn’t find any offending rules there. Also udev seems unable to set the spindown timeout itself and relies on calling external tools like hdparm (which isn’t installed currently).

I also checked udisks2 and upower, which both don’t seem to set the timeout. Also the hdparm.conf approach above seems like a custom solution for Ubuntu. The arch/manjaro package only provides the binary, no bundled way to apply any configuration automatically.

I really want to find the component which started setting the spindown timeout since the latest stable update.

Do you happen to have tlp installed?

1 Like

I understand your motivation. I wouldn’t be able to rest until I figured out the reason either.

If you do decide to go with the hdparm solution:
man hdparm shows

FILES
     /etc/hdparm.conf

You’ll probably have to create that file yourself.

I had the same in mind.

1 Like

Thanks for your respose. I did suspect that as well, but neither tlp nor power-profiles-daemon are installed. I also tried to “override” the set timeout with udisks2 by creating a config file /etc/udisks2/TOSHIBA-MG10ACA20TE-1470A0D3F4MJ.conf with the following content

[ATA]
StandbyTimeout=0

according to arch wiki but it has no impact.

I guess some other component keeps setting the timeout value continuously.

I see the hdparm man mentioning the config but the package contents of hdparm don’t have any systemd-unit or daemon bundled to apply it.

Please provide the output of:

pacman -Ss hdparm

Now I’ve installed it to make sure it doesn’t provide any service files (it doesn’t).

> pacman -Ss hdparm
core/hdparm 9.65-3 [installed]
    A shell utility for manipulating Linux IDE drive/driver parameters
core/sdparm 1.12-1
    An utility similar to hdparm but for SCSI devices
> pacman -Ql hdparm
hdparm /usr/
hdparm /usr/bin/
hdparm /usr/bin/hdparm
hdparm /usr/bin/idectl
hdparm /usr/bin/ultrabayd
hdparm /usr/bin/wiper.sh
hdparm /usr/share/
hdparm /usr/share/doc/
hdparm /usr/share/doc/wiper/
hdparm /usr/share/doc/wiper/README.txt
hdparm /usr/share/licenses/
hdparm /usr/share/licenses/hdparm/
hdparm /usr/share/licenses/hdparm/LICENSE.TXT
hdparm /usr/share/man/
hdparm /usr/share/man/man8/
hdparm /usr/share/man/man8/hdparm.8.gz

But I’d like to refocus on my actual issue instead of discussing the package contents of hdparm, which is unrelated to the sudden spindown behaviour.

Please help me figure out why the disk keeps spinning down after latest update.

That’s what we’re (or at least I am) trying to do, but I don’t have any other ideas…

1 Like

Even after applying an appropriate udev rule and also running sudo hdparm -S 0 /dev/sda manually, the disk is still spinning down. I guess some other component constantly overwrites the timeout value.

As of now I don’t know the reason for the sudden change in behaviour and also (more importantly) cannot disable the standby feature to prevent constant spindowns.

if you insist this is after an update, dive into pacman.log to see the possible culprits.

dearly hope not so, i hope its not your HDD kicking the bucket. have look into its SMART status as well

SMART values are all healthy. I’m sure the recent update introduced the new behaviour. I looked through all installed packages but cannot find any possible indicator beside the above mentioned udisks2 and upower packages.

At this point I’m just interested in a solution to prevent my harddisk from constantly spinning down and up again.

Do you have a file /etc/hdparm.conf? If not, then perhaps you should create one with your desired settings.

I was almost going to ask you whether this was a Western Digital Green drive, because those are rubbish — they spin down and park their heads all of the time. But you appear to have a different model of HDD, so the point is moot. :thinking: