# How to put disk into suspend or what is doing it? Config?

## mansniks

Hey, 

anyone knows how can I control my HDD spinning, if I have OS in RAM and there are some long delays between using them? Would be really helpful...

----------

## energyman76b

man sdparm

sdparm -C stop /dev/sdc for example.

----------

## mansniks

Just a quick question: I started to read about it, but is not clear if SATA disks are supported too?

----------

## mansniks

But how to get the latest time value when disk was read? 

If I power it down while operated, is it dangerous? Will it be woken when reading is necessary?

----------

## energyman76b

 *mansniks wrote:*   

> Just a quick question: I started to read about it, but is not clear if SATA disks are supported too?

 

yes, sata is supported too.

 *mansniks wrote:*   

> But how to get the latest time value when disk was read? 
> 
> If I power it down while operated, is it dangerous? Will it be woken when reading is necessary?

 

it should wake up. But who knows? Just try and see. But stopping disks a lot is not healthy for them. The start/stop cycles put wear on the spindle and motor.

----------

## mansniks

I know. Just for cases when electricity fails or there are days of inactivity.

It would be interesting to see some test results for spinup times and estimate max HDD lifetime from that point of view. 

Well, but the key element is quite unanswered: how to monitor a disk usage (time since last read)?

----------

## energyman76b

turn on statistics in kernel and have a look at /proc

----------

## mansniks

I have test system on my table right now and I can't turn the disk off for more than some moment close to zero seconds! It just spins up immediately...

----------

## energyman76b

then there is some process accessing it. btw, another tool that might be helpfull is iostat. And of course lsof and fuser.

----------

## mansniks

I will take a closer look at that software later, but one is clear: turning off hard disks in Linux is not "by default". I used minimal gentoo x86 install boot and it shows me this: I can turn off unmounted disk, but I can't really turn off mounted disk. It is just mounted in a black shell, nothing is productively using it...

----------

## tarpman

```
emerge -av hdparm

$EDITOR /etc/conf.d/hdparm

rc-update add hdparm boot

/etc/init.d/hdparm start
```

```
# spin down after 60 minutes without use

all_args="-S 242"
```

Works on the SATA hard drive in my laptop.

----------

## mansniks

Sorry, does not work for me. I set -S 60, but it is always accessed, lots of files are open, though "nothing" happens.

tarpman, really working laptop with turned off disk after long standing idle?

----------

## mamac

Hi,

Did you read the Power Management guide ?

Read chapter 5.

----------

## mansniks

Well, previous time, when I did, laptop was turning its HDD on every 5 seconds. 

Really, I am quite tired of experiments, is there some known-to-work way, which you have tried on normal laptop?

----------

## tarpman

 *mansniks wrote:*   

> Well, previous time, when I did, laptop was turning its HDD on every 5 seconds. 

 

This would be because of your filesystem flushing dirty buffers to disk.  To help with this symptom, have a look at app-laptop/laptop-mode-tools.

----------

