hdparm / apm level reset to 128 after suspend

Report Bugs, Issues and non- package Requests
Message
Author
yuul
Posts: 17
Joined: Fri Dec 15, 2017 9:05 am

hdparm / apm level reset to 128 after suspend

#1 Post by yuul »

Hello, just wanted to report this 'bug', ..kind of the only problem I ran into with MX17-beta.. ~~nice distro :hug:

After every suspend (on laptop-lid-close), the hard disk's apm level is reset to 128, which makes it spin down and up again a lot !
I tried all solutions I found online, but none worked.

Setting the apm level to 254 in '/etc/hdparm.conf' worked for booting, but after suspend, it always resets to 128.


((this was about 3 weeks ago and I don't remember everything, but documented the following, most promising approaches... ((and settled for a cron job that says 'hdparm -B 254 /dev/sda' every 5min..))))

---------------------------------------------------------

1. executable script in /etc/pm/sleep.d/ containing
#!/bin/bash

case $1 in
thaw|resume) /sbin/hdparm -B 254 /dev/sda
;;
esac

-------------------------------------------------------

2. executable script in /lib/systemd/system-sleep/ containing

#!/bin/bash
/sbin/hdparm -B 254 /dev/sda

---------------------------------------------------------

3. normal file /etc/systemd/system/normal_file.service containing

[Unit]
Description=Run start_my_connection
After=suspend.target

[Service]
ExecStart=/sbin/hdparm -B 254 /dev/sda

[Install]
WantedBy=suspend.target

#then sudo 'systemctl enable normal_file.service' and restart

-----------------------------------------------------------------


Here is 'inxi -F'

Code: Select all

inxi -F
System:    Host: yuul Kernel: 4.13.0-1-amd64 x86_64 bits: 64 Desktop: Xfce 4.12.3
           Distro: MX-17.b3_x64 Horizon November 29, 2017
Machine:   Device: laptop System: LENOVO product: Lenovo G580 v: Lenovo G580 serial: N/A
           Mobo: LENOVO model: INVALID v: 00000000INVALID serial: N/A
           UEFI [Legacy]: LENOVO v: 5ECN96WW(V9.01) date: 03/14/2013
Battery    BAT1: charge: 37.8 Wh 100.0% condition: 37.8/38.9 Wh (97%)
CPU:       Dual core Intel Pentium B960 (-MCP-) cache: 2048 KB
           clock speeds: max: 2200 MHz 1: 2194 MHz 2: 2194 MHz
Graphics:  Card: Intel 2nd Generation Core Integrated Graphics Controller
           Display Server: x11 (X.Org 1.19.2 )
           drivers: modesetting (unloaded: fbdev,vesa)
           Resolution: 1366x768@59.99hz
           OpenGL: renderer: Mesa DRI Intel Sandybridge Mobile version: 3.3 Mesa 13.0.6
Audio:     Card Intel 7 Series/C216 Family High Def. Audio Controller
           driver: snd_hda_intel
           Sound: Advanced Linux Sound Architecture v: k4.13.0-1-amd64
Network:   Card-1: Qualcomm Atheros AR8162 Fast Ethernet driver: alx
           IF: eth0 state: down mac: dc:0e:a1:f5:80:f3
           Card-2: Broadcom Limited BCM4313 802.11bgn Wireless Network Adapter
           driver: wl
           IF: wlan0 state: up mac: 08:ed:b9:99:d6:25
Drives:    HDD Total Size: 200.0GB (47.4% used)
           ID-1: /dev/sda model: FUJITSU_MHY2200B size: 200.0GB
Partition: ID-1: / size: 18G used: 7.9G (49%) fs: ext4 dev: /dev/sda2
           ID-2: swap-1 size: 4.54GB used: 0.00GB (0%) fs: swap dev: /dev/sda6
Sensors:   System Temperatures: cpu: 46.0C mobo: N/A
           Fan Speeds (in rpm): cpu: N/A
Info:      Processes: 230 Uptime: 1:40 Memory: 1193.0/3821.3MB
           Client: Shell (bash) inxi: 2.3.53 

:anispider2: :party3: greetings & happy winter-time to all :happybday:



Image
Last edited by yuul on Sat Dec 16, 2017 3:08 am, edited 1 time in total.

User avatar
Eadwine Rose
Administrator
Posts: 11948
Joined: Wed Jul 12, 2006 2:10 am

Re: hdparm / apm level reset to 128 after suspend

#2 Post by Eadwine Rose »

The new MX17 Final release is out now.. do you have the same thing going on with that?
MX-23.2_x64 July 31 2023 * 6.1.0-20-amd64 ext4 Xfce 4.18.1 * 8core AMD Ryzen 7 2700
Asus TUF B450-Plus Gaming UEFI * Asus GTX 1050 Ti Nvidia 525.147.05 * 2x16Gb DDR4 2666 Kingston HyperX Predator
Samsung 860EVO * Samsung S24D330 & P2250 * HP Envy 5030

yuul
Posts: 17
Joined: Fri Dec 15, 2017 9:05 am

Re: hdparm / apm level reset to 128 after suspend

#3 Post by yuul »

:cat: Hi, just tested it with the new release, and it's working <3

The apm-level is set to 'off' from the beginning, and stays 'off' after suspend.
((However :cool: ..on 17-beta it was set to 128 from the beginning and always resetted back to 128 after suspend, so theoretically, that 'bug' could still be there -in case someone wants to set it to a certain value and it would always reset back to 'off' ^^ :happy: (but i•ve no mind for testing that atm and am really really happy with the first impression of the new release...~it's going to be my main distro for the time being... thx a lot @ all who worked on this :number1: :giveflowers:

yuul
Posts: 17
Joined: Fri Dec 15, 2017 9:05 am

Re: hdparm / apm level reset to 128 after suspend

#4 Post by yuul »

Hello again, ...this thought just wouldn't leave me alone, and so I just tested the three abovementioned ways on mx17-final, ==>same behaviour as before, only now it always resets to 'off' :p

idk, where is this being set? //and also, scripts in /lib/systemd/system-sleep/ seem to be ignored :bagoverhead:

User avatar
anticapitalista
Developer
Posts: 4165
Joined: Sat Jul 15, 2006 10:40 am

Re: hdparm / apm level reset to 128 after suspend

#5 Post by anticapitalista »

You do know that MX default does not use systemd, right?
anticapitalista
Reg. linux user #395339.

Philosophers have interpreted the world in many ways; the point is to change it.

antiX with runit - lean and mean.
https://antixlinux.com

yuul
Posts: 17
Joined: Fri Dec 15, 2017 9:05 am

Re: hdparm / apm level reset to 128 after suspend

#6 Post by yuul »

:alien: ah no^^ ..I thought it would use systemd (..glad to hear it doesn't :puppy: ) ...~in fact I thought it was very difficult to not use systemd, if the parent distro does.. =>hence the need to fork the whole thing (Artix, Devuan) if u wanna avoid it.. ((y would they do that if swapping a few packages would do the trick?)) :spinning: ..i•m no expert in this.. :cat:

((ofc this explains why the systemd-related solutions aren't working))

:heart:

User avatar
anticapitalista
Developer
Posts: 4165
Joined: Sat Jul 15, 2006 10:40 am

Re: hdparm / apm level reset to 128 after suspend

#7 Post by anticapitalista »

The parent distro for MX Linux is antiX, which is totally free from systemd.

BTW - I don't know how to solve your problem though.
anticapitalista
Reg. linux user #395339.

Philosophers have interpreted the world in many ways; the point is to change it.

antiX with runit - lean and mean.
https://antixlinux.com

male

Re: hdparm / apm level reset to 128 after suspend

#8 Post by male »

yuul wrote:Setting the apm level to 254 in '/etc/hdparm.conf' worked for booting, but after suspend, it always resets to 128.
I currently have no MX, only antiX17. ;)

You must set the level in the

Code: Select all

/etc/rc.local 
setting to perform.

So

Code: Select all

hdparm -B 254 /dev/sda
ahead of

Code: Select all

exit 0

128 to 254 explicitly prohibit spin-down while 255 does not do so in some cases.

yuul
Posts: 17
Joined: Fri Dec 15, 2017 9:05 am

Re: hdparm / apm level reset to 128 after suspend

#9 Post by yuul »

@male: hi, rc.local is not executed after suspend.. (it seems)

male

Re: hdparm / apm level reset to 128 after suspend

#10 Post by male »

Excuse me, is this
battery operation or
mains operation?

what is results

Code: Select all

apt-cache policy laptop-mode-tools

Post Reply

Return to “Bugs and Non-Package Requests Forum”