LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 09-24-2011, 11:36 PM   #1
lonesoac0
Member
 
Registered: Jan 2010
Distribution: Ubuntu
Posts: 88

Rep: Reputation: 4
Scheduling hard drive spin down


hello all,

I would like to know if I can schedule standby/sleep with crontab. I am specifically trying to spin down the hard drive for a while and then spin up the hard drive at a specified time. I found the command of
Code:
 hdparm -y /dev/sda
but it does not look like it does anything. All I see it does is:
Quote:
/dev/sda:
issuing standby command
Any help would be appreciated!
 
Old 09-25-2011, 11:03 AM   #2
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: CentOS
Posts: 1,556

Rep: Reputation: 656Reputation: 656Reputation: 656Reputation: 656Reputation: 656Reputation: 656
That's exactly what the output from hdparm should look like when it successfully spins down the drive. You were expecting something else??

In most cases you don't have to explicitly spin up the drive. The next time something tries to access the drive, the kernel will spin it up automagically.
 
Old 09-25-2011, 11:07 AM   #3
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Hanover, Germany
Distribution: Main: Gentoo Others: What fits the task
Posts: 15,615
Blog Entries: 2

Rep: Reputation: 4070Reputation: 4070Reputation: 4070Reputation: 4070Reputation: 4070Reputation: 4070Reputation: 4070Reputation: 4070Reputation: 4070Reputation: 4070Reputation: 4070
Quote:
Originally Posted by rknichols View Post
The next time something tries to access the drive, the kernel will spin it up automagically.
And exactly that may be the case when the command doesn't work for you, may be a program accesses the disk when you try to spin it down (for example the syslog daemon).
 
Old 09-25-2011, 11:39 AM   #4
lonesoac0
Member
 
Registered: Jan 2010
Distribution: Ubuntu
Posts: 88

Original Poster
Rep: Reputation: 4
Daemons maybe why the command seemingly does not work then. I have lighttpd and samba running just to name a couple off of the top of my head. So, I need to figure out how to find all active processes, kill them, and then
Code:
hdparm -y /dev/sda
Right?
 
Old 09-26-2011, 12:11 AM   #5
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: CentOS
Posts: 1,556

Rep: Reputation: 656Reputation: 656Reputation: 656Reputation: 656Reputation: 656Reputation: 656
Are you trying to spin down a drive that contains mounted file systems? It may be difficult to get that to "stick" -- too many things that can cause an access.
 
Old 09-26-2011, 08:46 AM   #6
lonesoac0
Member
 
Registered: Jan 2010
Distribution: Ubuntu
Posts: 88

Original Poster
Rep: Reputation: 4
yes, I am trying the command while both / and Swap are mounted.
 
Old 09-26-2011, 08:56 AM   #7
Mr. Alex
Senior Member
 
Registered: May 2010
Distribution: Arch + X.org + IceWM
Posts: 1,204

Rep: Reputation: Disabled
Read `man hdparm` and see hdparm -S and hdparm -B. You won't need cron. But I don't recommend you to spin down your HDDs - it's bad for the motor.
 
Old 09-26-2011, 05:19 PM   #8
lonesoac0
Member
 
Registered: Jan 2010
Distribution: Ubuntu
Posts: 88

Original Poster
Rep: Reputation: 4
How in the world can spining down hard drives be bad for my monitor??
 
Old 09-27-2011, 04:57 AM   #9
Mr. Alex
Senior Member
 
Registered: May 2010
Distribution: Arch + X.org + IceWM
Posts: 1,204

Rep: Reputation: Disabled
Smile

lonesoac0, please read more carefully what I wrote. It's "motor", not "monitor". I am talking about motor of HDD, it's better to keep it spinning constantly.
 
Old 09-28-2011, 05:15 PM   #10
lonesoac0
Member
 
Registered: Jan 2010
Distribution: Ubuntu
Posts: 88

Original Poster
Rep: Reputation: 4
Ahhhhh! Sorry about that! I will reconsider using hdparm since it could directly do the oposite of what I want. I want to try to place less strain on the hard drive not more.
 
Old 09-29-2011, 04:04 AM   #11
Mr. Alex
Senior Member
 
Registered: May 2010
Distribution: Arch + X.org + IceWM
Posts: 1,204

Rep: Reputation: Disabled
Quote:
Originally Posted by lonesoac0 View Post
I want to try to place less strain on the hard drive not more.
In this case you definitely should keep them spinning and not to turn off (unless you keep your PC off for 24 hours or more). And make sure HDDs are 35-45 С. That is also important.
 
  


Reply

Tags
crontab


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Hard drive won't spin down automatically or stay spun down when requested jsteel Linux - General 1 09-28-2010 08:02 PM
LXer: Linux Hard Drive Optimization: Tuning and Scheduling (part 2) LXer Syndicated Linux News 1 05-16-2009 05:25 AM
Can't hard drive spin-down on old hardware starling Linux - Hardware 2 04-05-2009 01:39 AM
make my laptop's hard drive spin down??? tricky_linux Linux - Hardware 2 06-17-2004 03:02 AM
Random Hard Drive Spin Ups DocKarl Linux - Software 4 08-07-2003 07:27 PM


All times are GMT -5. The time now is 11:41 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration