Thursday, May 22, 2008

Spinning down hard disk

aarklon

I was reading the book "Beginning Ubuntu Linux" by thomas keir. In this book there is a tip given to spin down the hard disk. the author says that it will help a lot in power savings.

he gives the tip as follows

all modern hard disks come with the ability to spin down their motors to save energy.Then,when data is requested,the motors spin up again. There may be a slight delay while this happens, and some people
dislike using disk spin-down because of this. However on a notebook, it can lead to a substantial increase in battery life.On a desktop system ,it's worth considering.because over the lifetime of a computer, it can save a lot of electricity.

on terminal type: gksu gedit /etc/hdparm.conf

spindown_time=24

you can alter the value to anything you want.each time unit is 5 seconds,so 24 equates to 120 seconds or 2 minutes.when u are finished,save the file.Reboot for the settings to take effect

Now question is how effective is this tip ???
will it lead to substantial power savings?????


dcstar
Since Linux is constantly generating various log messages, these are written to disk on a regular basis so I have my doubts that turning off a hard disk that will be restarted to write data every few minutes may be worthwhile.

The extra power to restart a drive (as well as the "wear and tear" of the process) may well outweigh the power savings during the off time. If someone could work out a way of "quietening" Linux to minimise system/application background disk writes then this could well be worth trying (even setting up a USB stick drive for these writes would help).

Knowledge is a measure of how many answers you have, intelligence is a measure of how many questions you have.


MS3FGX
It depends if you are on a laptop or a desktop, really.A spinning HDD uses about 10 watts if I recall correctly, which is almost nothing on a desktop machine, but can make a big impact on a laptop.

J.O Aho
A hard drive consumes somewhere around 2.5-18 WATT depending on the size and age of the hard drive, compare this to a CPU which draws 80+ WATT. You will still have some energy consumption while spin down, maybe 1 WATT, so do the maths how long you have your computer on per day and how much you use the computer while it's on... while you use the computer, you won't make much of saving, while the computer is idle you may save a little bit (depends on how often your cron jobs runs).

The spin down will shorten the lifespan of the hard drive and a 24second delay for spin down after usage is a short time and the delay for spinning up is noticeable. I don't recommend any spin down times less to 5 minutes.


[H]omer
Why reboot? ~]# hdparm -S 24 /dev/
"[Microsoft] are willing to lose money for years and years just to | make sure that you don't make any money, either." - Bob Cringely.


Handover Phist

Yep. From the man page:

-S

Set the standby (spindown) timeout for the drive. This value is used by the drive to determine how long to wait (with no disk activity) before turning off the spindle motor to save power. Under such circumstances, the drive may take as long as 30 seconds to respond to a subsequent disk access, though
most drives are much quicker. The encoding of the timeout value is somewhat peculiar. A value of zero means "timeouts are disabled": the device will not automatically enter standby mode.Values from 1 to 240 specify multiples of 5 seconds, yielding timeouts from 5 seconds to 20 minutes. Values from
241 to 251 specify from 1 to 11 units of 30 minutes, yielding timeouts from 30 minutes to 5.5 hours. A value of 252 signifies a timeout of 21 minutes. A value of 253 sets a vendor- defined timeout period between 8 and 12 hours, and the value 254 is reserved. 255 is interpreted as 21 minutes plus 15
seconds. Note that some older drives may have very different interpretations of these values.

so the command:

# hdparm -S 24 /dev/[hs]d[abcd]

will set the spindown for those drives to two minutes or whatever. Ubuntu probably has the file /etc/hdparm.conf for reference by startup scripts. Slackware doesn't use that so I can't confim that it'll work
for you.

> when u are finished,save the file.

> Reboot for the settings to take effect

> Now question is how effective is this tip ???
> will it lead to substantial power savings?????

It could. For example I have four HDs on my machine, only two of which I access frequently. It'd probably ba a Good Thing to spin down the ones I dont use.
--
You LIVE in that head?


Rodney

It *could* extend battery life and or save electricity, a lot would depend on how you use the system. Keep in mind the bit about the drive needing to spin up when you need to access it for something, and that includes if the system needs to access swap or deal with a journal on a journaled file system or write any log, etc. Spining down and back up frequently has the potential to use more power than constantly spining because it takes more power to spin it up than to keep it spining (due to momentum I think). So, there is no definitive answer to the general question as you asked it, it depends. I have seen people write that they extended their battery life by an hour or more, I have no way to determine if what they write is accurate. Some systems are setup to run from a ramdisk and don't need a drive spining all the time (fast and less power). On this desktop, I spin down my data drives but the drive with my OS is usually being used, I do
note a slight lag (and hear it spin up) when I access one of the data drives. If you don't need to access a drive for long periods, I imagine you would save some electricity by spining it down until you needed it.




No comments:

Post a Comment