LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Stop HDD spinning after some time - where to configure (https://www.linuxquestions.org/questions/linux-newbie-8/stop-hdd-spinning-after-some-time-where-to-configure-850713/)

Mr. Alex 12-16-2010 12:53 PM

Stop HDD spinning after some time - where to configure
 
If I use Gnome, is "gnome-power-preferences" the only place where I can configure the system to stop or not to stop spinning HDD as a power saving tool? Is there any other option outside GUI?

Dark_Helmet 12-16-2010 01:11 PM

You might want to look at the man page for hdparm.

Code:

NAME
      hdparm - get/set SATA/IDE device parameters

SYNOPSIS
      hdparm [ flags ] [device] ..

DESCRIPTION
      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.

OPTIONS
 . . .
      -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.

djtoltz 12-16-2010 01:20 PM

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.

silvyus_06 12-16-2010 01:28 PM

maybe try

Quote:

sudo udisks --set-spindown-all
to spin it down if it don't work to make it sleep

I NEVER USED THAT
I DON'T ASSUME ANY RESPONSABILITY .

Mr. Alex 12-16-2010 01:46 PM

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.

djtoltz 12-16-2010 01:52 PM

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.

Mr. Alex 12-16-2010 02:35 PM

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
?

onebuck 12-16-2010 03:10 PM

Hi,

Quote:

Originally Posted by Mr. Alex (Post 4193941)
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
?

Quote:

excerpt from 'man smartctl';

-a, --all
Prints all SMART information about the disk, or TapeAlert information
about the tape drive or changer. For ATA devices this is equivalent
to
´-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.

Elvis1357 10-11-2021 06:13 PM

Suspend Mode
 
In SATA 500 GB the suspend mode shows it has suspended but the HD is still running...why and how to stop it or put in SLEEP mode?

Regards


All times are GMT -5. The time now is 02:46 PM.