Problem with hard drive behavior

Hello :wink: :), I post because I have a problem that I can not solve, my knowledge being limited:

My hard drive makes a lot of noise, because every one or two minutes the hard drive makes a sort of pause (no noise, fan too), then after a few seconds it starts to spin again (while making a dirty sound, the diode which lights up to show that it works).

The noise is annoying, but itā€™s especially for the life of the hard drive that Iā€™m afraid.

I am on opensuse leap 42.3, this behavior is already done since opensuse leap 42.1.

Note that I do not have this problem with my xubuntu or windows partition.

sounds like a failing disk, where the origin might be on the openSUSE area of the disk.

No, otherwise it would do it under xubuntu and windows. On the other hand I think I found the solution:

hdparm -B /dev/sda

return

APM_level    = 96

On xubuntu APM_level =**254 !

**Then I did :

hdparm -B254 /dev/sda

For now, there does not seem to be any problem. I put in SOLVED for now.

Thanks for your reply :slight_smile:

>:( I can not keep this setting on startup, how to do ?

Thereā€™s a file where you can put commands, itā€™s the file boot.local located in directory /etc/init.d

Thereā€™s an explanatory inside the file to guide you.

I would put this in it:

hdparm -B254 /dev/sda

And reboot and see what happens

it works on reboot now with the command in boot.local :slight_smile: thanks

**But **after suspend : APM_level = 96 again ! I search on arch wiki and found this
**"APM level reset after suspend "

https://wiki.archlinux.org/index.php/hdparm

**

This does not work on opensuse. After reboot the value returns to 254, ok, but after suspend, 96 againā€¦ If you have other suggestions for after suspend wich works too ?

speculative suggestion: check if tlp is active and if so check tlp config /etc/default/tlp

tlp Is not installed.

By following the wiki of archlinux, I created this file apm.service in / etc / systemd / system / with these commands:


[Unit] Description=Local system resume actions
After=suspend.target hybrid-sleep.target hibernate.target

[Service]
Type=simple
ExecStart=/usr/bin/hdparm -B 254 /dev/sda

[Install]
WantedBy=sleep.target

But this does not work, after the computer suspend, apm level resets and resets to 96.

After opensuse is not arch, maybe there will be an another way, if you have any suggestionsā€¦

Simply creating a custom service file is not enough. Did you enable/start it? It would be useful if you showed us the statusā€¦

sudo systemctl status apm.service
systemctl status apm.service
ā— apm.service - Local system resume actions
   Loaded: loaded (/etc/systemd/system/apm.service; disabled; vendor preset: disabled)
   Active: inactive (dead)


I donā€™t know how enable/ start it :shame:

Do that with

sudo systemctl enable apm
sudo systemctl start apm

Then check itā€™s be behaviour after a suspend/resume cycle.

no, APM_level = 96 again.

The return of the command systemctl status apm.service:

systemctl status apm.service
ā— apm.service - Local system resume actions
   Loaded: loaded (/etc/systemd/system/apm.service; enabled; vendor preset: disabled)
   Active: failed (Result: exit-code) since jeu. 2017-08-03 00:50:55 CEST; 59s ago
  Process: 2909 ExecStart=/usr/bin/hdparm -B 254 /dev/sda (code=exited, status=203/EXEC)
 Main PID: 2909 (code=exited, status=203/EXEC)

aoƻt 03 00:50:55 pc-f.home systemd[1]: Started Local system resume act....
aoƻt 03 00:50:55 pc-f.home systemd[1]: apm.service: Main process exite...C
aoƻt 03 00:50:55 pc-f.home systemd[1]: apm.service: Unit entered faile....
aoƻt 03 00:50:55 pc-f.home systemd[1]: apm.service: Failed with result....
Hint: Some lines were ellipsized, use -l to show in full.


Well at least itā€™s active now :wink:

As you can see there are errors that need to be investigated furtherā€¦

journalctl -u apm

General info for viewing systemd journal via journalctlā€¦
https://www.digitalocean.com/community/tutorials/how-to-use-journalctl-to-view-and-manipulate-systemd-logs

journalctl -u apm
Journal file /var/log/journal/87d9f86908abc7d1f994775259806abc/system@000555c29a51b692-1f9a9d5a6131a485.journal~ is truncated, ignoring file.
-- Logs begin at mar. 2017-08-01 12:02:39 CEST, end at jeu. 2017-08-03 01:08:31 CEST. --
aoƻt 03 00:48:08 pc-f.home systemd[1]: Started Local system resume actions.
aoƻt 03 00:48:08 pc-f.home systemd[1]: apm.service: Main process exited, code=exited, status=203/EXEC
aoƻt 03 00:48:08 pc-f.home systemd[1]: apm.service: Unit entered failed state.
aoƻt 03 00:48:08 pc-f.home systemd[1]: apm.service: Failed with result 'exit-code'.
-- Reboot --
aoƻt 03 00:50:55 pc-f.home systemd[1]: Started Local system resume actions.
aoƻt 03 00:50:55 pc-f.home systemd[1]: apm.service: Main process exited, code=exited, status=203/EXEC
aoƻt 03 00:50:55 pc-f.home systemd[1]: apm.service: Unit entered failed state.
aoƻt 03 00:50:55 pc-f.home systemd[1]: apm.service: Failed with result 'exit-code'.


Thank you for helping me, itā€™s complicated for me, but I learn things :slight_smile:

Your path is wrongā€¦

Process: 2909 ExecStart=/usr/bin/hdparm -B 254 /dev/sda (code=exited, status=203/EXEC)
 Main PID: 2909 (code=exited, status=203/EXEC)

I getā€¦

# whereis hdparm
hdparm: /usr/sbin/hdparm /usr/lib/hdparm /sbin/hdparm /usr/share/man/man8/hdparm.8.gz

All good. One never stops learning on the Linux journey. :slight_smile:

Yes I change /usr/bin/hdparm with /usr**/sbin**/hdparm and it seems to be working :slight_smile:

Thank you to all those who helped me :):):slight_smile:

Surprise, surprise! Glad to have been of assistance. :slight_smile: