Announcement

Collapse
No announcement yet.

Question for hdparm specialists

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Question for hdparm specialists

    I created a file in /etc/systemd/ system with the following content:

    Code:
    [Unit]
    Description=Local system resume actions
    After=suspend.target
    
    [Service]
    Type=simple
    ExecStart=hdparm -S 120 /dev/disk/by-uuid/312cb74c-ee9e-4a50-adaa-677f2a61c50b
    
    [Install]
    WantedBy=suspend.target
    Then did the following

    Code:
    systemctl enable...
    systemctl start...
    systemctl status...
    and rebooted the computer. After 10 minutes it just doesn't happen. The plate doesn't turn off.​

    Code:
    sudo systemctl status root-resume.service
    [sudo] password for gorzka:
    ○ root-resume.service - Local system resume actions
    Loaded: loaded (/etc/systemd/system/root-resume.service; enabled; preset: enabled)
    Drop-In: /usr/lib64/systemd/system/service.d
    └─10-timeout-abort.conf
    Active: inactive (dead)​
    Why is the process dead?

    Of course I can use hd-idle, but I would like to find out why it doesn't work

    #2
    ★ Does the command, run with sudo, have any effect? Ostensibly that applies a setting on the drive, and, perhaps naïvely, I would expect it to stick. Maybe hdparm -I should show the setting.

    hdparm -S doesn't work for many drives. My desktop has a 2015 WD black and a very old Seagate Barracuda and hdparm -S does not work for either, IIRC. IIRC again, it did not work for any WD drives at the time I looked into it, but did for some Seagate models. If I use hdparm -S 120 on either the command appears to run, saying "setting standby to 120 (10 minutes)" but hdparm -I says "Standby timer values: spec'd by Standard, with device specific minimum" both before and after.

    ★ I don't understand why it's "WantedBy " "suspend.target". That applies when the system is going to sleep, or has come out of it.

    ★ "Active: inactive (dead)" just means the service is not running. This is what you want, you don't want it running for more than it takes to complete the command.

    ★​ After changing systemd files anywhere, run systemctl daemon-reload or systemd might not notice.

    ★ If it was me, I'd separate getting the systemd stuff to work from the task at hand. As well, I'd always run a script that logs with timestamps that it's running and what it is doing.
    Regards, John Little

    Comment

    Working...
    X