Announcement

Collapse
No announcement yet.

Disk wakes up after a while of using HD-IDLE!

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

    Disk wakes up after a while of using HD-IDLE!

    Hello again guys.

    I have a problem, and that is that after my hard drive stops spinning using the command:

    Code:
    sudo nano /etc/default/hd-idle
    Code:
    START_HD_IDLE=true
    HD_IDLE_OPTS="-i 180 -l /var/log/hd-idle.log"​​

    As I mentioned in a previous post, the command works perfectly and the hard drive stops spinning. But after about 20 minutes or so it spins again and never stops spinning again.

    To get it working again, I have to stop the hd-idle service and start it again.

    What could cause the disk to spin again? Could it be because after a while the user session closes?

    thanks and regards.​

    EDIT:


    I have found out that the cause is due to CRON, but I don't know the reason, I only have this configured:​

    Code:
    00 1 * * * root rtcwake -m mem -l -t "$(date -d 'today 19:30:00' '+\%s')"
    Last edited by Anjunas; Dec 28, 2023, 01:00 PM.

    #2
    (BTW, IMO cron is treacherous. Commands you've tested in a shell may not work in cron, because it's a very minimal set up. Startup shell scripts like .profile and .bashrc are not run and few environment variables are set. If one must use cron, I suggest always logging output somewhere.)

    If rtcwake does a hardware scan, it will spin up the drives. But I thought it put the laptop to sleep, but you run it at 01:00; I don't understand your use case. I'm guessing that when the laptop goes to sleep you want it to wake at 19:30.

    If the computer is waking from sleep, it will start all the hardware, thus spinning up the drives. This annoyed me, so I found a way around it. I'm not sure this will be any use to you, but this is what I use. Creat the file /lib/systemd/system-sleep/spindown with the following:
    Code:
    #!/bin/bash
    # john spin down my backup and archive drives, they drone and vibrate
    # oppressively
    
    case $1 in
    post)
    # output goes to the journal...
        echo spinning down stuff
        /sbin/hdparm -y /dev/disk/by-label/stuff
        echo spinning down the old drive with pics
        /sbin/hdparm -y /dev/disk/by-label/pics
    ​;;
    esac
    ​
    Regards, John Little

    Comment

    Working...
    X