[SOLVED] Stop HDD spinning after some time - where to configure
Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
You might want to look at the man page for hdparm.
hdparm - get/set SATA/IDE device parameters
hdparm [ flags ] [device] ..
hdparm provides a command line interface to various kernel interfaces supported by the Linux SATA/PATA/SAS "libata" subsystem and the older IDE driver subsystem. Many newer (2008 and later) USB drive enclosures now also
support "SAT" (SCSI-ATA Command Translation) and therefore may also work with hdparm. Eg. recent WD "Passport" models and recent NexStar-3 enclosures. Some options may work correctly only with the latest kernels.
. . .
-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 time‐
out 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.
Having said that, I have never used hdparm. It would be a good idea for you to read the whole man page and all options to decide if this is what you need.
There is an article on-line that describes some of the issues with power saving on a Linux machine. Unfortunately, you can't just tell your HD to go to sleep after 10 minutes and expect that to work if you've got daemons touching the disk all the time. Check this: http://www.spencerstirling.com/compu...wersaving.html for details.
Thanks guys! I need to be sure that my HDD doesn't stop spinning after some idle time. I don't need that. So if I don't have hdparm installed and "gnome-power-preferences" is configured - does it mean HDD won't stop spinning after any idle time? And thanks for link, I'll check it out.
You're in luck. It's definitely easier to turn off the spin-down than it is get the system to stop writing log files and such to the HD and waking it up. How you go about doing this will depend on the type of drive. Hopefully that link I posted will point you in the right direction. Once you figure out which file or tool is appropriate for your system, check the man or info pages of that tool/file and you should find your answer.
Thanks. How do I watch amount of start-stop spinnig of HDD with smartctl? What option is this if I do
smartctl -a /dev/sda
excerpt from 'man smartctl';
Prints all SMART information about the disk, or TapeAlert information
about the tape drive or changer. For ATA devices this is equivalent
´-H -i -c -A -l error -l selftest -l selective´
and for SCSI, this is equivalent to
´-H -i -A -l error -l selftest´.
Note that for ATA disks this does not enable the non-SMART options and
the SMART options which require support for 48-bit ATA commands.
'man command' is your friend.
Since you stated 'hdd' instead of including interface type for hdd as ide, eide, ata or sata would benefit all so as to provide specific related commands.
That way we may provide specifics. My bets are on ata or sata. I didn't include scsi storage since it's not a normal desktop user storage device.