DaemonForums  

Go Back   DaemonForums > FreeBSD > FreeBSD General

FreeBSD General Other questions regarding FreeBSD which do not fit in any of the categories below.

Reply
 
Thread Tools Display Modes
  #1   (View Single Post)  
Old 29th April 2009
drhowarddrfine drhowarddrfine is offline
VPN Cryptographer
 
Join Date: May 2008
Posts: 358
Thanked 9 Times in 8 Posts
Default How to turn drives off after a period of time?

I can't seem to find this. I have an app that checks a web page every minute, saves a copy when it changes and faxes it somewhere. Sometimes it goes a whole day without doing anything so it's a waste to have the hard drives spinning. How can I turn the drives off after so many minutes of inactivity and have them spin up when my script tries to save to it?
Reply With Quote
  #2   (View Single Post)  
Old 29th April 2009
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 3,435
Thanked 214 Times in 189 Posts
Default

AFAIK, ATA disk spin-down is a function of APM. According to apm(4), this feature was not implemented in FreeBSD 7.

(I only know about it because of OpenBSD's atactl(8), which has an apmset command. Equivalent functionality is not available from FreeBSD's atacontrol(8) utility.)
Reply With Quote
  #3   (View Single Post)  
Old 30th April 2009
Beastie Beastie is offline
Daemonology student
 
Join Date: Jan 2009
Location: /dev/earth0
Posts: 267
Thanked 23 Times in 23 Posts
Default

Quote:
Originally Posted by jggimi View Post
Equivalent functionality is not available from FreeBSD's atacontrol(8) utility.)
Isn't that what you want: atacontrol(8)?
Quote:
spindown
Set or report timeout after which the device will be spun down. To arm the timeout the device needs at least one more request after setting the timeout. To disable spindown, set the timeout to zero. No further actions are needed in this case.

[...]

To spin down a disk after 30 minutes run
atacontrol spindown ad6 1800
dd if=/dev/ad6 of=/dev/null count=1

[...]

You can check the current setting with
atacontrol spindown ad6
__________________
May the source be with you!

Last edited by Beastie; 30th April 2009 at 07:01 AM.
Reply With Quote
  #4   (View Single Post)  
Old 30th April 2009
richardpl richardpl is offline
Spam Deminer
 
Join Date: May 2008
Location: Croatia
Posts: 284
Thanked 25 Times in 24 Posts
Default

There is also ataidle available in ports tree.
Reply With Quote
  #5   (View Single Post)  
Old 30th April 2009
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 3,435
Thanked 214 Times in 189 Posts
Default

Quote:
Originally Posted by Beastie View Post
Isn't that what you want...
My mistake, I was looking for "apm" not "spin". Thanks for the correction.
Reply With Quote
  #6   (View Single Post)  
Old 30th April 2009
drhowarddrfine drhowarddrfine is offline
VPN Cryptographer
 
Join Date: May 2008
Posts: 358
Thanked 9 Times in 8 Posts
Default

Under atacontrol:
Quote:
To spin down a disk after 30 minutes run

atacontrol spindown ad6 1800
dd if=/dev/ad6 of=/dev/null count=1
That looks like what I want to do.
Reply With Quote
  #7   (View Single Post)  
Old 1st May 2009
drhowarddrfine drhowarddrfine is offline
VPN Cryptographer
 
Join Date: May 2008
Posts: 358
Thanked 9 Times in 8 Posts
Default

As mentioned above, that functionality isn't available in FreeBSD so looks like ataidle will have to do. Thanks, Richard.
Reply With Quote
  #8   (View Single Post)  
Old 1st May 2009
richardpl richardpl is offline
Spam Deminer
 
Join Date: May 2008
Location: Croatia
Posts: 284
Thanked 25 Times in 24 Posts
Default

atacontrol spindown is same as ataidle -I (I guess)

-P flag from atailde controls APM, which is not really usefull in your case.

In other words ataidle just have few fetures more than atacontrol.

In your case running "ataidle -o" should conserve maximal energy (just make sure it got called only few times per day)
Reply With Quote
  #9   (View Single Post)  
Old 2nd May 2009
Beastie Beastie is offline
Daemonology student
 
Join Date: Jan 2009
Location: /dev/earth0
Posts: 267
Thanked 23 Times in 23 Posts
Default

Quote:
Originally Posted by drhowarddrfine View Post
As mentioned above, that functionality isn't available in FreeBSD
What do you mean? If you give it "atacontrol spindown", does it display "usage: ..." again, or what?
What FreeBSD version are you using? Because it seems to work under 7.1.

Also from the release notes:
The atacontrol(8) utility now supports a spindown command to set or report timeout after which the device will be spun down.
__________________
May the source be with you!
Reply With Quote
Old 3rd May 2009
drhowarddrfine drhowarddrfine is offline
VPN Cryptographer
 
Join Date: May 2008
Posts: 358
Thanked 9 Times in 8 Posts
Default

Then I'm wrong because I forgot to say this box is under fbsd6. That's good news cause I prefer doing it that way but I don't have the right version right now.
Reply With Quote
Reply

Thread Tools
Display Modes

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 On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Can't turn off laptop speaker GullibleJones OpenBSD General 5 22nd November 2008 03:40 AM
Yet another question about hot swapping drives PeterSteele FreeBSD General 1 13th November 2008 01:54 AM
can't access ZFS drives Bubba_HoTep FreeBSD General 6 6th November 2008 02:06 PM
Turn off daylight savings adjust?? biscuits FreeBSD General 3 24th October 2008 05:26 AM
Automounting drives jwhal OpenBSD General 4 12th June 2008 05:00 PM


All times are GMT. The time now is 06:07 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick