Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
No HDD spindown after resume from hibernation
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
DeIM
Apprentice
Apprentice


Joined: 11 Apr 2006
Posts: 268

PostPosted: Mon Jan 20, 2014 11:04 am    Post subject: No HDD spindown after resume from hibernation Reply with quote

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

I've tried this command but no success:
Code:
hdparm -B127 -S100 /dev/sdc

HDD is still spinning.
Back to top
View user's profile Send private message
Roman_Gruber
Advocate
Advocate


Joined: 03 Oct 2006
Posts: 3806
Location: Austro Bavaria

PostPosted: Wed Jan 22, 2014 5:53 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
DeIM
Apprentice
Apprentice


Joined: 11 Apr 2006
Posts: 268

PostPosted: Thu Jan 23, 2014 9:21 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
Roman_Gruber
Advocate
Advocate


Joined: 03 Oct 2006
Posts: 3806
Location: Austro Bavaria

PostPosted: Thu Jan 23, 2014 9:42 pm    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
frostschutz
Advocate
Advocate


Joined: 22 Feb 2005
Posts: 2971
Location: Germany

PostPosted: Thu Jan 23, 2014 11:38 pm    Post subject: Reply with quote

/etc/init.d/hdparm restart should work.
Back to top
View user's profile Send private message
DeIM
Apprentice
Apprentice


Joined: 11 Apr 2006
Posts: 268

PostPosted: Sat Jan 25, 2014 7:27 pm    Post subject: Reply with quote

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

frostschutz:
Thank you for reply, but it didn't help :cry:
HDDs still spinning after wake up from hibernation and spin-down after restart.
Back to top
View user's profile Send private message
toralf
Developer
Developer


Joined: 01 Feb 2004
Posts: 3723
Location: Hamburg

PostPosted: Sat Jan 25, 2014 7:37 pm    Post subject: Reply with quote

What's about trying these aggressive settings
Code:
hdparm -B 1 -S 1 /dev/sdX ?
and watching /var/log/messages for any errors ? FWIW I do have
Code:
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.
Back to top
View user's profile Send private message
frostschutz
Advocate
Advocate


Joined: 22 Feb 2005
Posts: 2971
Location: Germany

PostPosted: Sat Jan 25, 2014 9:07 pm    Post subject: Reply with quote

DeIM wrote:
Thank you for reply, but it didn't help :cry:


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
Back to top
View user's profile Send private message
DeIM
Apprentice
Apprentice


Joined: 11 Apr 2006
Posts: 268

PostPosted: Sun Jan 26, 2014 12:31 pm    Post subject: Reply with quote

Code:
# 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
Code:
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:
Back to top
View user's profile Send private message
toralf
Developer
Developer


Joined: 01 Feb 2004
Posts: 3723
Location: Hamburg

PostPosted: Sun Jan 26, 2014 12:45 pm    Post subject: Reply with quote

/etc/acpi/defaults.sh look here for an example : http://bpaste.net/show/172295/
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum