I just got a HP Probook 650 G5, and installed Opensuse leap 15.6 with KDE.
Stuff is mostly working fine, but the HDD I installed keeps spinning down when the laptop charger is unplugged. The HDD is a Seagate 2TB driver. (ST2000LM015-2E8174)
Journal log when unplugging the charger, waiting for the drive to spin down and plugging back the power:
Nov 13 17:49:39 localhost plasmashell[1937]: plasma-pk-updates: acPluggedChanged onBattery: false -> true
Nov 13 17:49:39 localhost plasmashell[1937]: plasma-pk-updates: Is on battery: true
Nov 13 17:49:57 localhost kernel: sd 0:0:0:0: [sda] Synchronizing SCSI cache
Nov 13 17:49:57 localhost kernel: sd 0:0:0:0: [sda] Stopping disk
Nov 13 17:49:58 localhost kernel: ata1.00: Entering standby power mode
Nov 13 17:50:05 localhost kernel: ata1: SATA link up 6.0 Gbps (SStatus 133 SControl 300)
Nov 13 17:50:05 localhost kernel: ata1.00: Entering active power mode
Nov 13 17:50:07 localhost kernel: ata1.00: ACPI cmd f5/00:00:00:00:00:e0(SECURITY FREEZE LOCK) filtered out
Nov 13 17:50:07 localhost kernel: ata1.00: ACPI cmd b1/c1:00:00:00:00:e0(DEVICE CONFIGURATION OVERLAY) filtered out
Nov 13 17:50:08 localhost kernel: ata1.00: ACPI cmd f5/00:00:00:00:00:e0(SECURITY FREEZE LOCK) filtered out
Nov 13 17:50:08 localhost kernel: ata1.00: ACPI cmd b1/c1:00:00:00:00:e0(DEVICE CONFIGURATION OVERLAY) filtered out
Nov 13 17:50:08 localhost kernel: ata1.00: configured for UDMA/133
Nov 13 17:50:08 localhost kernel: ata2: SATA link down (SStatus 4 SControl 300)
Nov 13 17:50:08 localhost kernel: sd 0:0:0:0: [sda] Starting disk
Nov 13 17:50:08 localhost plasmashell[1937]: plasma-pk-updates: acPluggedChanged onBattery: true -> false
Nov 13 17:50:08 localhost plasmashell[1937]: plasma-pk-updates: Is on battery: false
I’d like to disable this “power saving feature”, because it is annoying when every 15-20 seconds, the hdd spins down.
I tried hdparm.
hdparm -B 255 /dev/sda - issue still the same
hdparm -B 254 /dev/sda - issue still the same
hdparm -S 0 /dev/sda - issue still the same
hdparm -Z /dev/sda - runs into error: SG_IO: bad/missing sense data
Tried uninstalling “patterns-desktop-mobile” package. I found this suggestion somewhere. But the issue is still the same.
I also looked where I thought I could change any settings, but there are no options for HDD spin down timer.
No, it is not HDD. It is kernel that decides to power off the device.
This is pattern. Uninstalling pattern does not remove any package that was installed by this pattern, so it is entirely useless for your purpose. You need to find out what causes this aggressive power saving. Providing full logs may give some hints.
issued the command “tlp start”
pulled out the power, went into battery mode, and in 15 seconds, the hdd entered power save mode again
but I found where I can modify manually
The file:
/sys/block/sda/device/power/autosuspend_delay_ms
has the actual timeout after which the hdd enters power saving mode
unfortunately, whenever there’s a switch between AC and battery power, this file gets overwritten
So I’m still trying to figure out what you suggested, the actual process that is modifying this file.
hdparm -S x causes the hard disk to be spun down after a certain period of inactivity. Replace x as follows: 0 disables this mechanism, causing the hard disk to run continuously.
The OP tried “-S 0” and apparently it did not work. That setting worked here some years ago, but have since tossed all HDDs in the trash, replaced all with SSDs. The price difference is negligible.
I tried “hdparm -B 255” and also “hdparm -B 254”. Neither worked.
Also tried “hdparm -S 0”. Also didn’t work.
But I think I found a workaround.
In KDE I can run a command when the battery power profile loads.
So when the laptop switches to battery mode, it simply executes this:
If I’m not mistaken, 60 million milliseconds is more than 16 hours. Which is way more than the battery can last before I have to charge it.
Though I would really like to know why the power saving is so aggressive and what is doing it, this is workaround is enough for me. The HDD is not spinning down anymore when the laptop is running on the battery. And this what I wanted to achieve.
Again, thank you everyone for the suggestions and the help.
Prevent autosuspend:
Write a negative value to the file to prevent the device from being suspended. For example, writing “-1” to the file has the same effect as writing “on” to the power/control file.
I don’t know what is setting it. My best guess is TLP. But I tried to configure it, and it didn’t work. So either I did it wrong, or there’s some kernel integrated stuff the I can’t change, unless I build my own custom kernel. Which I’d rather not.
I thought if it was disabled it wouldn’t interfere. I guess I was wrong. But I used to fiddle with Linux couple of years ago and back in those day when it said something was disabled, it was disabled. Not anymore it seems.
Given that the actual value was suspiciously equal to the default TLP value, it strongly suggests that something invoked (and still invokes) TLP. Educated guess is that it is invoked by systemd-udevd when power supply information switches between AC and battery. Enable TLP debug, check logs.