Spindown

Spindown is a system daemon that spins down idle disks and so saving energy and giving the disks a longer lifetime.
Download

Spindown Ranking & Summary

Advertisement

  • Rating:
  • License:
  • GPL v3
  • Price:
  • FREE
  • Publisher Name:
  • Dimitri Michaux
  • Publisher web site:
  • http://code.google.com/p/spindown/

Spindown Tags


Spindown Description

Spindown is a system daemon that spins down idle disks and so saving energy and giving the disks a longer lifetime. Spindown is a system daemon that spins down idle disks and so saving energy and giving the disks a longer lifetime.It works by checking how many blocks are read and written from the disks. When no blocks are read or written the disk is idle. When a disk stays idle long enough spindown uses sg_start to spin the disk down. It also works with usb disks and hotswappable disks because it doesn't watch the device name (hda, sdb, ...), but the device id. This means that it doesn't matter if the disk is swapped while the deamon is running. Requirements:? sg_startInstallationFirst you need to download the source code and compile it. Because there are no nasty dependencies (except for sg3_start), this should be no problem. $ tar xvzf spindown-x.x.x.tar.gz $ cd spindown-x.x.x.tar.gz $ make # make installConfigurationAfter compiling and installing the deamon you still need to configure it. Do this by editing the sample configuration file (spindown.conf.example) with your favorite editor. Once you are satisfied with the settings save the file and copy it to /etc/spindown.conf.The sectionsThe configuration file consists of two different sections: the general section and several disk sections. There should only be one general section, but different disk sections are allowed....The General sectionThe General section has only two parameters: cycle-time and idle-time. The cycle-time parameter defines the time in seconds between checks (looking up the device name for the disk id and updating the amount of block read and written), a good value is 60. The idle-time parameter defines how long a disk should be idle before it is spundown. Don't use a to small value for this setting, because spinning the disc up and down to much isn't good for it's health. A good value for idle-time is 3600. As of version 0.2 of spindown it is also possible to set this time per disk.cycle-time = 60 # Number of seconds between two cyclesidle-time = 3600 # The time in seconds a disk has to be idle before it is spundown. # Do not use a value that is to small (less than 3600)The Disk sectionsThere are several Disk sections allowed, but they need to have a different id or name. Each disk can have several parameters, but only the id or name parameter is obligated (not both).Id parameterThe id parameter must contain the id of the diks, this is not the device name (sda, sdb, hda, ...), but mostly a string like this ata-Hitachi_HTS54161-SB2404SJHD07JE. You can find the id of your disk by looking in /deb/disk/by-id$ ls -l /dev/disk/by-id/total 0lrwxrwxrwx 1 root root 9 2008-03-20 10:38 ata-Hitachi_HTS54161-SB2404SJHD07JE -> ../../sdalrwxrwxrwx 1 root root 10 2008-03-20 10:38 ata-Hitachi_HTS54161-SB2404SJHD07JE-part1 -> ../../sda1lrwxrwxrwx 1 root root 10 2008-03-20 10:38 ata-Hitachi_HTS54161-SB2404SJHD07JE-part2 -> ../../sda2lrwxrwxrwx 1 root root 10 2008-03-20 10:38 ata-Hitachi_HTS54161-SB2404SJHD07JE-part4 -> ../../sda4lrwxrwxrwx 1 root root 9 2008-03-20 10:38 scsi-S_SB2404SJHD07JE -> ../../sdalrwxrwxrwx 1 root root 10 2008-03-20 10:38 scsi-S_SB2404SJHD07JE-part1 -> ../../sda1lrwxrwxrwx 1 root root 10 2008-03-20 10:38 scsi-S_SB2404SJHD07JE-part2 -> ../../sda2lrwxrwxrwx 1 root root 10 2008-03-20 10:38 scsi-S_SB2404SJHD07JE-part4 -> ../../sda4Lets say you'll need to know the id of sda, in this case this is ata-Hitachi_HTS54161-SB2404SJHD07JE. Be sure not to use the id's of the partitions. When there are more entries for the same disk it shouldn't matter wich one you chose. This method is really great for swappable disks like usb drives because the device name could change when you have several.Name parameterYou can also also use the name parameter if you know you are never going to unplug the disk. Then you can just use a device name (sda, hdb) with the name parameter.Spindown parameterThe spindown parameter is boolean, it can either be 1 or 0. When it is 1 this means that disk will be spundown when it has been idle long enough. When this parameter is not given it defaults to 0.Command parameterThe command parameter tells the spindown script which parameters to use to spindown the disc with sg3_start. You should try to find these out by your self. For me it mostly is enough to use "--stop" or "--stop --pc=2". You can try these parameters by running sg_start yourself.$ sg_start --stop /dev/sdaJust replace sda with the name of your disk and make sure that there is no activity on this disk (by unmounting it or something like that). You should hear the disk spinning down when the command worked. If this parameter is not defined "--stop" is used.Idle-time parameterAs of version 0.2 of spindown it is also possible to set the idle-time per disk. This time is also given in seconds.Example of configuration fileSo your disk sections may look something like this:# Add as much disks as you want.# Only id is needed, for everything else the default values will be used.# If spindown is not specified the disk will not be spun down.# The default command is --stop.id = ata-Hitachi_HTS54161-SB2404SJHD07JEspindown = 0id = usb-Sony_Storage_Media_1A06101710143-0:0spindown = 1command = --stop --pc=2idle-time = 900name = sdaspindown = 0Disks that are not specified will not be spun down. What's New in This Release: · Spindown no longer uses multiple threads, and the init script now uses Linux Standard Base functions.


Spindown Related Software