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
8,628
Reaction score
7,587
Credits
35,291
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,783
Reaction score
1,385
Credits
11,976
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
74
Reaction score
54
Credits
762
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).
 
MALIBAL Linux Laptops

Linux Laptops Custom Built for You
MALIBAL is an innovative computer manufacturer that produces high-performance, custom laptops for Linux.

For more info, visit: https://www.malibal.com

Members online


Top