LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 12-18-2007, 05:56 PM   #1
hamstar
LQ Newbie
 
Registered: Oct 2004
Location: Auckland, New Zealand
Distribution: SuSE 9.3 Pro
Posts: 28

Rep: Reputation: 15
Script to put hard drives to sleep when no IO


Hey guys,

I have a little server with couple of hard drives in it and I was wanting to make a script (bash or perl is all i'm good at - probably not suited) that will put the hard drives to sleep when there is no activity.

Hence saving a bit of power and hopefully a bit of hard drive life.

I was wondering how I could check for activity cause checking for activity will probably cause activity right?

Also I was wondering what to use instead of hdparm as almost all the drives are SATA's and not PATA's.

There are 4 seagates (320x3,200x1) running off 2 sata expansion cards, and another PATA seagate 320 but that is the system drive so no use sleeping that.

Any suggestions would be appreciated.

Cheers,
Rob
 
Old 12-18-2007, 06:45 PM   #2
PatrickNew
Senior Member
 
Registered: Jan 2006
Location: Charleston, SC, USA
Distribution: Debian, Gentoo, Ubuntu, RHEL
Posts: 1,148
Blog Entries: 1

Rep: Reputation: 48
First off, bash is probably a very good choice. There is a utility called sdparm which is essentially what you want. Hrm, I'm not sure how to check for activity though.
 
Old 12-18-2007, 06:47 PM   #3
jeffschwab
LQ Newbie
 
Registered: May 2007
Posts: 8

Rep: Reputation: 0
Check out hdparm(8), and laptop-mode for the 2.6 kernel. See also:

http://www.gentoo.org/doc/en/power-m....xml#doc_chap5
 
Old 12-18-2007, 07:09 PM   #4
paulsm4
Guru
 
Registered: Mar 2004
Distribution: SusE 8.2
Posts: 5,863
Blog Entries: 1

Rep: Reputation: Disabled
Hi,

PatrickNew and jeffschwab are absolutely correct: "hdparm" and friends are what you're looking for. And you don't even need to write any "scripts" - simply download the software and setup the configuration you prefer.

Here are a couple of other links:

http://technowizah.com/2007/01/debia...anagement.html

http://gentoo-wiki.com/HOWTO_Use_hdp...ce_performance
 
Old 12-18-2007, 07:52 PM   #5
hamstar
LQ Newbie
 
Registered: Oct 2004
Location: Auckland, New Zealand
Distribution: SuSE 9.3 Pro
Posts: 28

Original Poster
Rep: Reputation: 15
Wow thanks a lot guys.

I take it most of this stuff is transferable/available to rpm systems?
 
Old 12-18-2007, 10:23 PM   #6
PatrickNew
Senior Member
 
Registered: Jan 2006
Location: Charleston, SC, USA
Distribution: Debian, Gentoo, Ubuntu, RHEL
Posts: 1,148
Blog Entries: 1

Rep: Reputation: 48
I'm sure it is. I see suse in your profile, I'd be shocked if Suse didn't provide an official [s|h]dparm package.
 
  


Reply

Tags
drive, hdparm, ide, io, sata, scripts, sdparm


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
Is it better to let computer power off and on later or put it to sleep mode ? pleasehelpme Linux - Newbie 1 12-10-2007 05:38 PM
Put Linux Disk to Sleep from Windows? benhanson Linux - Hardware 1 11-13-2007 07:47 AM
how can I put the CPU in sleep mode? asahlot Linux - Software 2 11-03-2006 10:23 AM
LXer: Put your laptop to sleep LXer Syndicated Linux News 0 08-02-2006 01:24 AM
Put a hd to sleep dr_van_nostrand Linux - Hardware 1 09-12-2003 07:29 PM


All times are GMT -5. The time now is 04:47 PM.

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