Announcement

Collapse
No announcement yet.

howto change the drive sleep state?

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

    #16
    Seems like this:

    sudo hdparm -S /dev/sd?

    should reveal what standby time is set at. And this:

    sudo hdparm -S 200 /dev/sd?

    would set it at 200 (1000 seconds). This from the manual:

    Code:
    -S: Set the standby (spindown) timeout for the drive.
    The timeout specifies how long to wait in idle (with no disk activity) before turning off the motor to save power.
    The value of 0 disables spindown, the values from 1 to 240 specify multiples of 5 seconds and values from 241 to 251 specify multiples of 30 minutes.
    Last edited by oshunluvr; May 20, 2022, 02:34 PM.

    Please Read Me

    Comment


      #17
      Originally posted by oshunluvr View Post
      Seems like this:

      sudo hdparm -S /dev/sd?

      should reveal what standby time is set at. And this:
      That command does just state "-S: bad/missing standby-interval value (0..255)" but does not reveal the value it is set to.

      Nvm. I just learned the command to show needs -B rather than -S to show it.
      Last edited by Fred-VIE; Jun 10, 2022, 04:46 AM.

      Comment


        #18
        Originally posted by jlittle View Post

        Now hd-idle is only necessary because my drives don't do "Advanced Power Management". I can see that by running
        Code:
        sudo hdparm -B /dev/sdc
        
        /dev/sdc:
        APM_level = not supported
        If you don't have hd-idle, maybe the "Advanced Power Management" is spinning down the drives. You might run the hdparm -B command to find out.
        .
        It says my apm_level is off on the HDD. Maybe that is the reason because my SSD's show "254".

        When I set it to 140 and tried
        Code:
         sudo hdparm -B /dev/sdc
        again it still said that the apm-level is off.

        /dev/sdc:
        setting standby to 140 (11 minutes + 40 seconds)
        $ sudo hdparm -B /dev/sdc

        /dev/sdc:
        APM_level = off
        Last edited by Fred-VIE; Jun 10, 2022, 04:47 AM.

        Comment


          #19
          What is also weird is that SDA and SDB are the same drive type bought at the same time but SDA has the apm-level set while Linux says that SDB does not support APM.

          It is not really likely one of those two drives would not support APM while the other one does.

          Both are Samsung SSD 860 EVO 500GB.

          Click image for larger version

Name:	SDB.png
Views:	147
Size:	111.7 KB
ID:	663626
          Attached Files
          Last edited by Fred-VIE; Jun 11, 2022, 03:59 AM.

          Comment


            #20
            Just a thought. I don't know if you are trying to achieve spin down or not, but:
            Possible values are between 1 and 255, low values mean more aggressive power management and higher values mean better performance. Values from 1 to 127 permit spin-down, whereas values from 128 to 254 do not. A value of 255 completely disables the feature.
            So you might try
            Code:
            sudo hdparm -B 127 /dev/sdX
            where X is the drive letter you are trying to adjust
            I notice your command says that it is off but does not say not supported, which means it is probably turned off?
            If you do not want to enter spin down mode then this is not helpful and just ignore it in that case.

            Also, What happens when you try to get information on both drives using the -I parameter? Are they showing different capabilities?:

            Code:
            # hdparm -I /dev/sdX

            Comment


              #21
              Originally posted by rab0171610 View Post
              Just a thought. I don't know if you are trying to achieve spin down or not, but:
              So you might try
              Code:
              sudo hdparm -B 127 /dev/sdX
              I am trying to get my data drive (SDC) to spin down later because it seems to enter sleep mode too fast.

              Like I stated in #18. Even after setting that timer Linux still said that the APM_level is off. So setting the timer doesnt seem to turn the APM_level on even though the discription implies that -B (I used 140) sets the APM setting (thus should turn it on).

              While I was checking this I was checking my SSD's sleep timers and mentioned that Linux does not treat the two drives of the same type equally but says SDB supposedly does not support APM which can just be a bug because they are similar drives.

              Originally posted by rab0171610 View Post
              Also, What happens when you try to get information on both drives using the -I parameter? Are they showing different capabilities?:
              Code:
              # hdparm -I /dev/sdX
              They are not showing different capabilities.

              SDA:
              Capabilities:
              LBA, IORDY(can be disabled)
              Queue depth: 32
              Standby timer values: spec'd by Standard, no device specific minimum
              R/W multiple sector transfer: Max = 1 Current = 1
              DMA: mdma0 mdma1 mdma2 udma0 udma1 udma2 udma3 udma4 udma5 *udma6
              Cycle time: min=120ns recommended=120ns
              PIO: pio0 pio1 pio2 pio3 pio4
              Cycle time: no flow control=120ns IORDY flow control=120ns


              SDB:
              Capabilities:
              LBA, IORDY(can be disabled)
              Queue depth: 32
              Standby timer values: spec'd by Standard, no device specific minimum
              R/W multiple sector transfer: Max = 1 Current = 1
              DMA: mdma0 mdma1 mdma2 udma0 udma1 udma2 udma3 udma4 udma5 *udma6
              Cycle time: min=120ns recommended=120ns
              PIO: pio0 pio1 pio2 pio3 pio4
              Cycle time: no flow control=120ns IORDY flow control=120ns

              The full command return I put in the attached txt file.
              I made a side by side comparison and they are the same. Which is no surprise since they are the same type bought at the same time.
              Attached Files
              Last edited by Fred-VIE; Jun 11, 2022, 02:45 PM.

              Comment


                #22
                Another flag you can research is -M which if I remember correctly is an automated setting. If your drives are capable and you learn how to use this flag maybe you can try setting them automatically.
                Also, while I know there is a kde version, I recommend installing gnome-disks, then clicking on the three dots in the top right corner in the titlebar and selecting drive settings for your particular drive. This will open up a "drive settings" window with three tabs: standby, apm, and write cache. It might allow you to enable APM settings on the drive. Like I said, there is a QT/KDE version but I have had better success using the gtk gnome-disks. Give that a try if you have not already.

                Comment


                  #23
                  Originally posted by rab0171610 View Post
                  Another flag you can research is -M which if I remember correctly is an automated setting.
                  -M = Get/set acoustic management
                  I was just checking all options and found no other setting than -B xxx to set the APM so that should activate it too. But doing so does unfortunately have no effect on my HDD.


                  Originally posted by rab0171610 View Post
                  Also, while I know there is a kde version, I recommend installing gnome-disks, then clicking on the three dots in the top right corner in the titlebar and selecting drive settings for your particular drive. This will open up a "drive settings" window with three tabs: standby, apm, and write cache. It might allow you to enable APM settings on the drive. Like I said, there is a QT/KDE version but I have had better success using the gtk gnome-disks. Give that a try if you have not already.
                  Thanks I'll look into that.

                  Edit:
                  I can change the setting on my HDD with Gnome-disks. I'll better make a backup of my data drive before I change any settings.

                  The SSD's show nothing but cache settings there but I wouldnt mess with them anyways atm.
                  It would be interesting to know why the APM doesnt work for SDB even though it is similar to SDA but since I just use it in Win it is not that important. Still it is weird.
                  Last edited by Fred-VIE; Jun 11, 2022, 03:25 PM.

                  Comment


                    #24
                    It is very strange indeed. Maybe you will never know why. Well at least you can use it with WIN.

                    Comment


                      #25
                      A desperate move, a fugly approach I resort to out of frustration, is to "tickle" the offending hardware or software. To stop hard drives spinning down after 10 minutes, (it's run at least once)
                      Code:
                      nohup bash -c "while :;do touch /somepath/somefile;sync;sleep 9m;done" &>> /somepath/somefile &
                      disown
                      Adjust the /somepath/somefile to be a writable file on the drive to be kept spinning, and the time to be just less than the spin down time of the drive.

                      (BTW, I have two of these running presently: one helps keep a NIC going, and another to work around a broken socket timeout.)
                      Regards, John Little

                      Comment


                        #26
                        Originally posted by oshunluvr
                        sudo hdparm -S 200 /dev/sd?

                        would set it at 200 seconds
                        The WD and the old Seagate in my desktop do not honour this setting. IIRC the OP had the same experience.
                        Regards, John Little

                        Comment


                        • oshunluvr
                          oshunluvr commented
                          Editing a comment
                          Yeah, that was my previous post suck in the buffer, lol
                      Working...
                      X