• We did not send an email asking for donations - please read this post.

How to automatically suspend HDD

Dave123

New Member
Joined
Jan 17, 2022
Messages
3
Reaction score
0
Credits
26
Hi,
I have laptop with two hard drives. First is SSD (with system) and the second is HDD with my private files. So I would like to setup to automatically power off of disk after 4 minutes. I set hdparm -S 48. It didn't work. So I set hdparm -B. If I set value 64 and lower the hard drive will be power off in few second. If I set value 65 and higher, the hard drive will never shut down...

Please, does anyone know, how to do it? Thanks
 


wizardfromoz

Administrator
Staff member
Gold Supporter
Joined
Apr 30, 2017
Messages
7,794
Reaction score
6,620
Credits
28,720
G'day @Dave123 and welcome to linux.org :)

1st up tell us what Distro and version you are using.

Then, did you specify the drive in your command, eg

hdparm -S 48 /dev/sda ?

Cheers

Chris Turner
wizardfromoz
 
OP
D

Dave123

New Member
Joined
Jan 17, 2022
Messages
3
Reaction score
0
Credits
26
Hello,
I have ubuntu 20.04. I Have WDC WD10SPZX-60Z.
This commane doesn't work, until I set up value of hdparm - B 64 and lower. But if I set this, the hard drive will power of in few seconds... So I will set 65 and in this situation, the drive will sleep never...
 

dos2unix

Well-Known Member
Joined
May 3, 2019
Messages
1,570
Reaction score
1,191
Credits
10,019
I have noticed hdparm doesn't work with nvme m.2 drives.
I suppose there are some technical reasons for this, but just the same...
 

digitaltrails

Member
Joined
Dec 18, 2021
Messages
40
Reaction score
16
Credits
382
Hi,
I have laptop with two hard drives. First is SSD (with system) and the second is HDD with my private files. So I would like to setup to automatically power off of disk after 4 minutes. I set hdparm -S 48. It didn't work. So I set hdparm -B. If I set value 64 and lower the hard drive will be power off in few second. If I set value 65 and higher, the hard drive will never shut down...

Please, does anyone know, how to do it? Thanks
To clarify... are you combining -B and -S? That's what I think you should be doing. Here is an example idle-script from my own system:

Bash:
#!/bin/bash
# This is run by a post-boot systemd timer job
set -x
# -S 1 to 240 specify multiples of 5 seconds \
# -S 241 to 251 specify multiples of 30 minutes
/sbin/hdparm -B 127 -S  60 -y /dev/sdc
# Latest Seagate ST4000DM004 has inbuilt power management so only use -S -y
/sbin/hdparm -S 241 -y /dev/sdd

You probably don't want -y.

The above is based on what I've read at: https://wiki.archlinux.org/title/Hdparm#Power_management_configuration

(But I'm actually running OpenSUSE Tumbleweed, I just like the arch documentation).
 
$100 Digital Ocean Credit
Get a free VM to test out Linux!

Linux.org Hosting Donations
Consider making a donation


Top