# Putting my sata drive to sleep

## <3

Ok so after upgrading my kernel to use Gentoo kernel 2.6.14, using sdparm I can finally put my sata drives to sleep by issuing the command

```
#sdparm -C stop /dev/sdb

    /dev/sdb: ATA       ST3200826AS       3.02
```

now can someone please tell me how do I set it so that the SATA drive goes to sleep after x mins of inactivity like hdparm does.

----------

## <3

 *<3 wrote:*   

> can someone please tell me how do I set it so that the SATA drive goes to sleep after x mins of inactivity like hdparm does.

 

----------

## Nick W

Does anyone know the answer to this?

----------

## <3

bump, still no help?

----------

## RegisG

for 6 mns : hdparm -S72 /dev/sda

from the man page : 

```
       -S     Set the standby (spindown) timeout for the drive.  This 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  encod-

              ing  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.
```

----------

## Nick W

That would be great if we were talking about IDE drives, unfortunately, we're not.

----------

## <3

well just to update it seems as though I can set my sata drives to go into sleep mode using

```
hdparm -s <value> <hard drive>
```

it didn't work before and I guess it has something to do with me upgrading my kernel. Currently I am using gentoo-sources 2.6.16-r1

----------

## Erlend

 *Quote:*   

> well just to update it seems as though I can set my sata drives to go into sleep mode using
> 
> Code:
> 
> hdparm -s <value> <hard drive>
> ...

 

Yeah it was always the intention of Jeff Garzik to have SATA drives accessible through hdparm (sdparm was just a temporary measure). Out of curiousity which SATA controller are you using?

You should probably add [Solved] to the subject of your post now - it could be useful to others.

----------

