# Harddisk spin down

## volospin

Hi,

I emerged apmd.

How do I make the harddisk spin down like after 30 minutes of idle?

(just like setting the harddisk power off after 1 hours)

Regards,

----------

## Yarrick

to do that, you need the application hdparm. look in /sbin if to see if you have it already

```

hddparm -S n /dev/hdx

```

where n is the idle time before spindown, and hdx is the drive. n is not in seconds or minutes, but different levels. i used n=1 and it told me it would spin down in 5 seconds. so try until it suits your needs.

----------

## mksoft

You can add the hdparm command to /etc/conf.d/local.start to have it run on startup.

----------

## pilla

hdparm also installs a script in /etc/init.d

you can change it according your config and them use rc-update to have it run when you boot.

 *mksoft wrote:*   

> You can add the hdparm command to /etc/conf.d/local.start to have it run on startup.

 

----------

## mksoft

 *Bloody Bastard wrote:*   

> hdparm also installs a script in /etc/init.d
> 
> you can change it according your config and them use rc-update to have it run when you boot.

 

yes I know, but it seems an overkill to add an rc script (and calc dependencies for it) for a single command.

As for enabling dma which on IDE drives (what /etc/init.d/hdparm contains), I have it enabled in the kernel config by default, so this is not needed.

----------

## pilla

Well, that is another discussion  :Cool:   I prefer not to use local.start, because it looks too much ad hoc for me. If there is another way (for example, hdparm in init) I usually choose it.

I've edited /etc/init.d/hdparm to put my parameters (not DMA, but multicount etc)

 *mksoft wrote:*   

>  *Bloody Bastard wrote:*   hdparm also installs a script in /etc/init.d
> 
> you can change it according your config and them use rc-update to have it run when you boot. 
> 
> yes I know, but it seems an overkill to add an rc script (and calc dependencies for it) for a single command.
> ...

 

----------

## mksoft

 *Bloody Bastard wrote:*   

> Well, that is another discussion 

 

Yes, it is, so we won't go there  :Wink: 

----------

