Enable hard drive standby / Advanced Power Management on Linux

My disks don't spin down, here's how I fixed it:


To check status without waking the drive:

sudo smartctl -i -n standby /dev/sda


To check status may wake drive:

sudo hdparm -I /dev/sda


To help hard drive goto sleep:

sudo smartctl --offlineauto=off /dev/sda

Disables SMART scrubbing (automatic offline testing), which helps the drive is to enter "standby". Note: offlineauto=off value is saved in the drive, surviving reboots and power outages.


To enable Advanced Power Management :

sudo hdparm -K 1 /dev/sda

-K     Set the drive´s "keep_features_over_reset" flag.  Setting this enables the drive to retain the settings for -APSWXZ over a soft reset (as done during the error recovery sequence).  Not all drives support this feature.


To check Advanced Power Management level:

sudo hdparm -B /dev/sda

To set Advanced Power Management level:

sudo hdparm -B 1 /dev/sda

-B     Get/set Advanced Power Management feature, if the drive supports it. 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 tells hdparm to disable Advanced Power Management altogether on the drive (not all drives support disabling it, but most do).


To set spin down time:

sudo hdparm -S 120 /dev/sda

where 120 = 10mins

-S Put the drive into idle (low-power) mode, and also set the standby (spindown) timeout for the drive. This timeout value is used by the drive to determine how long to wait (with no disk activity) before turning off the spindle motor to save power. Under such circumstances, the drive may take as long as 30 seconds to respond to a subsequent disk access, though most drives are much quicker. The encoding of the timeout value is somewhat peculiar. A value of zero means "timeouts are disabled": the device will not automatically enter standby mode. Values from 1 to 240 specify multiples of 5 seconds, yielding timeouts from 5 seconds to 20 minutes. Values from 241 to 251 specify from 1 to 11 units of 30 minutes, yielding timeouts from 30 minutes to 5.5 hours. A value of 252 signifies a timeout of 21 minutes. A value of 253 sets a vendor-defined timeout period between 8 and 12 hours, and the value 254 is reserved. 255 is interpreted as 21 minutes plus 15 seconds. Note that some older drives may have very different interpretations of these values.


Apparently sdparm can be helpful if hdparm does not work. I've not tested this yet...

To install:

sudo apt install sdparm

28 comments:

  1. This post gives truly quality information. Thanks a lot for sharing a wonderful piece of information keep it up and best of luck with your future article.

    aol mail login|cash app login|
    |cashappsignup|aol mail login |netgearrouterlogin

    ReplyDelete
  2. Hydrogen is a chemical element, which is known to be the lightest element in the periodic table. Hydrogen is the most widely available chemical substance in the universe, constituting roughly 75% of all baryonic mass.

    Hydrogen Production

    ReplyDelete
  3. Syngas, also known as synthesis gas, is a fuel gas. It is a mixture of gases that are composed of primarily hydrogen, carbon monoxide, and very often some carbon dioxide.

    Syngas Production

    ReplyDelete
  4. Hey! It’s me, Alan Owen! From The Social Network to Tenet to The Muppets, I have a huge watchlist. Apart from watching movies, I am also a coder and a learner of technology. Readers of blogs get the latest updates related to the technical world too.
    mcafee.com/activate
    office.com/setup
    mcafee.com/activate
    norton.com/setup
    webroot.com/safe

    ReplyDelete
  5. Obtenez la clé de produitwww office com setup 2016 gratuitement et installezsetup office com office 2019. Guide étape par étape pour setup office com download office

    ReplyDelete
  6. Mcafee is the most solid antivirus and we are giving you the full help to get it introduced in your workstations and PCs.for more details visit: www.Mcafee.com/activate today.

    Webroot antivirus is the effective security antivirus which is easy to use and also provide user friendly interface to its customer. You can install this software by going to its official site through www.webroot.com/safe

    Webroot provides the award-winning antivirus products to secure the computer and other smart devices and data. Install Webroot using webroot.com/safe and proceed for Webroot activation to prevent your device and data from viruses and threats.

    ReplyDelete

  7. Trendmicro.com/bestbuypc - Trend micro offers an ultimate virus shield protection for each system, including computers, laptops, and phones.

    We will help you in Download, Install & Setup Microsoft Office Setup 365, Office 2019 with your Microsoft office setup Product key by just only logging into www.office.com/myaccount

    AVG Antivirus and Internet Security is one of the finest Computer security programs available in the market. Installing it on your system will help you to permanently keep your Device free from virus attacks. Need help to activate Avg.com/retail antivirus via www.avg.com/activation.

    ReplyDelete
  8. I am very inspired by your blog and give valuable knowledge so it is very useful to others and you can check our blog . Our blog is about printer . It is all in one printer is ideal for both office and home . ij.start.cannon
    works on both operating system ios and windows. So you can try it.

    ReplyDelete

  9. If you are also facing trouble while conducting canon printer software download then this article may help you. Here in this article, we try to give you a full awareness post on canon printer software download. So, just read canon mg2520 printer thoroughly and learn the procedure.

    ReplyDelete
  10. When another individual tries to access an identical company file or wants to put it on another system, Quickbooks error code h202 occurs. This could be a one-of-a-kind problem involving QuickBooks' multi user operational mode.

    ReplyDelete
  11. I want to say thanks for beautiful blog sharing with us. Your blog really great resource to update my knowledge 한국야동

    Please visit once. I leave my blog address below
    야설
    일본야동

    ReplyDelete
  12. What’s up to all, it’s genuinely a fastidious for me to visit this website, it consists of priceless Information. 한국야동

    Please visit once. I leave my blog address below
    야설
    한국야동

    ReplyDelete
  13. you have done a great job. I will definitely dig it and personally recommend to my friends. I am confident they will be benefited from this site 야동

    Please visit once. I leave my blog address below
    국산야동
    일본야동

    ReplyDelete
  14. Wow! After all I got a web site from where I can actually get valuable information regarding my study and knowledge. 국산야동

    Please visit once. I leave my blog address below
    한국야동
    국산야동

    ReplyDelete
  15. Hello friends, its fantastic article about teaching and entirely explained, keep it up all the time. 한국야동

    Please visit once. I leave my blog address below
    야동
    일본야동

    ReplyDelete
  16. Nice blog.
    Quickbook is the best accounting software and best in the accounting sector they can make all work easy and done in less time . if you wanto to learn more about this so read this page.
    Quickbook database server manager

    ReplyDelete
  17. For most first-year students, finding reliable paper writing help is not as simple as it may appear. Only experienced paper helpers are aware of several essential indicators that distinguish a professional writing company from the dozens of amateur websites and high-school authors who could be found on the internet. Our paper help experts can tackle the most difficult tasks at any grade level and custom term paper writing with a team of qualified native-speaking editors and authors. We know how difficult it is to accomplish all responsibilities on time as past students, mainly when producing affordable papers, requiring much effort and expertise.

    ReplyDelete
  18. The new report by Expert Market Research titled, ‘Global Instant Noodles Market: Global Industry Trends, Share, Size, Growth, Opportunity and Forecast 2022-2027,” the global Instant Noodles Market size reached US$ 49.10 Billion in 2021. Instant noodles are one of the most popular and tasty packaged food products made using wheat flour, water palm oil and salt. These noodles are dehydrated using one of the two processes, namely flash or air frying. The major players in the market are Hebei Hualong Food Group, Master Kong (Shenyang) Instant Noodle Foodstuff Co., Ltd., Indofood Sukses Makmur, Nissin Food Products Co., Ltd., Nestlé S.A. and Acecook Vietnam Joint Stock Company and among others. We are updating our reports, If you want latest primary and secondary data (2022-2027) with Cost Module, Business Strategy, Distribution Channel, etc. You can visit our website.

    ReplyDelete
  19. Thanks for sharing this knowledgeable post. What an excellent post and outstanding article. If you want to fix Reset Spectrum Email Password then please contact roadrunner support team for solution.

    ReplyDelete