Announcement

Collapse
No announcement yet.

How to make the hard drive turn off?

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

    How to make the hard drive turn off?

    Hi there.

    I would like my external hard drive to stop working when I am not using it.

    I've been looking for information on the forum but I can't get this to work.

    I enter the /etc/hdparm.conf file and at the end I write:​

    Code:
    /dev/sdb1 {
            apm = 120
            spindown_time = 60
    }
    But it doesn't work, it's always spinning.

    Can anybody help me?

    Thanks and regards​

    #2
    Try using the device, not a specific partition. So /dev/sdb instead of sdb1

    BUT external; drives don't always play with hdparm. Plus , something may actually be accessing the drive.
    hd-idle may be a more useful tool too look at here, but you might first check if you have smartmontools installed (you probably do). The S.M.A.R.T monitoring may be a thing that keeps the drive awake.

    Open /etc/smartd.conf and commented out the line which starts with DEVICESCAN and restart the service systemctl restart smartd and see if the drive spins down as desired. It might work with hdparm, but it might not.
    Disabling the devicescan keeps it from looking for drives, automatically, without removing the tools completely.

    Comment


      #3
      Originally posted by claydoh View Post
      BUT external; drives don't always play with hdparm.
      A way to check this is to try hdparm directly:
      Code:
      sudo hdparm -y /dev/sdb
      Anjunas, does that command spin down the drive? If it does, hd-idle will work. (I've used it for many years.) For some drives, hdparm -y works but setting the spin down time on the drive doesn't.
      Regards, John Little

      Comment


        #4
        Hello everybody.
        First of all, thank you all for helping me.


        I already changed it to this:​

        I
        Code:
        /dev/sdb {
        apm = 120
        spindown_time = 60
        }​



        Enter the /etc/smartd.conf file to modify it, but I don't really know what I have to do here.

        https://ibb.co/hyqwH88

        Just add # before DEVICESCAN to override it.
        Here I don't know if I did it right.

        Then I put the following text in the console:

        systemctl restart smartd
        And I think it gave me some kind of error.

        https://ibb.co/2Sk3n4D

        I couldn't get the hard drive to stop.

        Ok now.

        I tried this:

        Code:
        sudo hdparm -y /dev/sdb
        And yes, the hard drive stopped.

        I currently don't know what to do to make it stop when not in use.

        And as for hd-idle, I have no idea what it is. ("some help plz) "

        Thank you very much and I await your responses.

        Greetings.​​​​

        Comment


          #5
          Originally posted by Anjunas View Post

          And yes, the hard drive stopped.
          ...
          And as for hd-idle, I have no idea what it is. ("some help plz) "
          It's in the repos:
          Code:
          sudo apt install hd-idle
          then I suggest man hd-idle. From memory it installs doing nothing, and you have to edit /etc/default/hd-idle to uncomment two lines.
          Regards, John Little

          Comment


            #6
            Hello again.

            Ok, I have already installed hd-idle.
            I have edited the file /etc/default/hd-idle.

            The file is currently displayed like this:

            Code:
            HD_IDLE_OPTS="-h"
            START_HD_IDLE=true
            HD_IDLE_OPTS="-i 180 -l /var/log/hd-idle.log"​


            At the moment the hard drive is still spinning :S.

            It doesn't work, I guess I'm doing something wrong.

            Thx and regards​​

            EDIT:

            Finally, it works!​


            Could you tell me if the modification of the hd-idle file is correct? Do I have to add or delete something? Thank you.​

            Comment


              #7
              It's fine. The third line overwrites the first. The -i means spin down after 180 seconds.

              I should have pointed out that a restart, or starting the service, might have been necessary; just changing /etc/default/hd-idle doesn't do anything.
              Regards, John Little

              Comment

              Working...
              X