# No HDD spindown after resume from hibernation

## DeIM

Hi, I have a problem with HDD - it can't spindown after resume form hibernation.

I've tried this command but no success:

```
hdparm -B127 -S100 /dev/sdc
```

HDD is still spinning.

----------

## Roman_Gruber

Well you need to meet the requirements to spin down a harddisk.

One requirement is that no process writes on the disk and therefore some timeout is met so the disk may spin down according to the smart settings.

Usually smart handles this next to your userspace settings / software. I rather be vague because it is your software you use which writes to the disk. This also involves swap on that harddisk for example.

Tools you can use to dig deeper are for example: lsof

My personal opinion in this regard: I doubt every harddisk has a clean implementation of smart and its features. I even doubt the health states and anything else which smart reports to be honest. You can manually spin down the disk but as my experience in the past showed it instally spins up with the next write of your file system. You may use tempfs and other pieces of software to reduce writes on your harddrive.

----------

## DeIM

Hi, thank you for reply. I use SSD asi my primary HDD. sdb is used as low used swap with data partition. sdc is rarelly used backup disk. When I reboot the sdb and sdc spins down correctly. But when I wake pc up from hibernation the two disks spins without spindown.

----------

## Roman_Gruber

Have you read out those smart settings before and after hibernation. 

do something like ...

smart command >> smart_before_hibernation

... >> ..._after_hib...

so you can easily compare

----------

## frostschutz

/etc/init.d/hdparm restart should work.

----------

## DeIM

What smart command (or program) do you mean? Smartctl?

frostschutz:

Thank you for reply, but it didn't help   :Crying or Very sad: 

HDDs still spinning after wake up from hibernation and spin-down after restart.

----------

## toralf

What's about trying these aggressive settings 

```
hdparm -B 1 -S 1 /dev/sdX ?
```

 and watching /var/log/messages for any errors ? FWIW I do have 

```
hda_args="-B 1 -S 1"

sda_args="-B 1 -S 1"

```

in my /etc/conf.d/hdparm and call it every time after suspend in /etc/acpi/defaults.sh so spin down internal hard disks when I boot from an external usb drive.

----------

## frostschutz

 *DeIM wrote:*   

> Thank you for reply, but it didn't help  

 

it should help, with a /etc/conf.d/hdparm to go with it; if it was originally your bios that set hdd timeouts, and not hdparm, it won't help.

it would be news to me if hibernate/resume had something that prevented hdd sleep in general

but I guess you could check if any process is accessing the hdd regularly anyhow

----------

## DeIM

```
# hdparm -B 1 -S 1 /dev/sdc

/dev/sdc:

 setting Advanced Power Management level to 0x01 (1)

 setting standby to 1 (5 seconds)

 APM_level   = 1
```

No logs or errors in /var/log/messages.

But I found now it must be some problem with mounting partitions of my disks (sdb and sdc).

When I first executed

```
hdparm -B 1 -S 1 /dev/sdc
```

disk started to spin-down and in second it spined-up.

So I tried to umount /dev/sdc and it spined-down in 5 seconds and since that it is in stand-by mode.

When I mount disk again, it spins-down and immediately up.

So my question now is: How to have disk mounted and achieve same behavior as after reboot.

Maybe I need to umount partitions of the sdb and sdc before hibernation and mount them again after resume from hibernation. Can you please give me the clue where to give these commands?

Thank you in advance   :Wink: 

----------

## toralf

/etc/acpi/defaults.sh look here for an example : http://bpaste.net/show/172295/

----------

