<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body text="#333333" bgcolor="#FFFFFF">
    <font face="Calibri">Hi,<br>
      I have had the same problem with USB connected drives on my Pis,
      but I needed the reverse. Namely, I wanted them to spin down after
      some time. The bottom line is that since the hard drive is
      connected via USB, the USB hardware itself may prevent the drive
      from spinning down (or always shut it down). But, I've had some
      success using the smartmon tools package to control how/when a
      given hard drive will spin down. The package is called smartmon
      tools, but the command itself is smartctl. A few examples:<br>
      <font face="Courier New">    <font face="Courier New">sudo
          smartctl -a /dev/sda            - display all info about drive<br>
              sudo smartctl -g all /dev/sda        - get all non-SMART
          settings (i.e. Advanced Power Mgmt setting)<br>
              sudo smartctl --set=apm,127            - set Advanced
          Power Mgmt<br>
              sudo smartctl --set=standby,241        - set standby timer
          to 30min (not sure if this superseded by apm setting)</font><br>
            </font><br>
      A low value means aggressive power management and a high value
      means better performance. Possible settings range from values 1
      through 127 (which permit spin-down), and values 128 through 254
      (which do not permit spin-down). The highest degree of power
      management is attained with a setting of 1, and the highest I/O
      performance with a setting of 254. A value of 255  disables
      Advanced Power Management altogether on the drive (not all drives
      support disabling it, but most do).<br>
      <br>
      You'll have to dig into the man pages and play around with the
      various APM settings to see if you can get things to work as you
      like.<br>
      <br>
      If all else fails you could just set up a cron job which runs a
      script every minute that simply touches a file on the drive (i.e.
      touch /some_folder/some_dummy_file.txt), which should prevent it
      from spinning down.<br>
      <br>
      Hope this helps.<br>
      Peter<br>
      <br>
      <br>
    </font><br>
    <div class="moz-cite-prefix">On 11/27/2021 9:00 PM, Jim via
      PLUG-discuss wrote:<br>
    </div>
    <blockquote type="cite"
      cite="mid:a073e3b9-5306-ad72-abd4-0515eeba101d@gmail.com">I have a
      hard drive attached via a USB adapter to my raspberry pi. The
      problem is that the disk always shuts down after a few minutes of
      inactivity.  When I want to access something on the disk or write
      to it, I have to wait for it to spin up.  How would I go about
      setting it so it doesn't spin down?  I tried to look online and
      found sdparm mentioned, but found nothing I could understand.
      Please help. Thanks
      <br>
      ---------------------------------------------------
      <br>
      PLUG-discuss mailing list - <a class="moz-txt-link-abbreviated" href="mailto:PLUG-discuss@lists.phxlinux.org">PLUG-discuss@lists.phxlinux.org</a>
      <br>
      To subscribe, unsubscribe, or to change your mail settings:
      <br>
      <a class="moz-txt-link-freetext" href="https://lists.phxlinux.org/mailman/listinfo/plug-discuss">https://lists.phxlinux.org/mailman/listinfo/plug-discuss</a><br>
    </blockquote>
    <br>
  </body>
</html>