This guide shows how to automatically spindown your external hard drives connected to your NSLU2. Isn't it great to stop your external hdd when you are not using it. This will also extend the lifetime of your external hdd. I have been using this with my NTFS formatted hdd for a couple of months and I am very satisfied.
We need a program to control the harddisk connected to your NSLU2. SG3-utils will do it for us. To install write
apt-get install sg3-utils
After the installation you can try to spindown your harddrive to test if it's working.
In my case I wrote
/usr/bin/sg_start --stop /dev/sdb
If it works you are almost done. Let us automatize it now.Spindown is a daemon that spins down idle disks and so saving energy and giving the disks a longer lifetime. You can check http://code.google.com/p/spindown/ for more information. Follow the steps below to install it into your Debian machine. You may change the "spindown-0.2.2.tar.gz" parts according to the latest version.
tar xvzf spindown-0.2.2.tar.gz
After compiling and installing the spindown you still need to configure it. I prepared a sample config file for you. Create spindown.conf by typing
and copy and paste the lines below into this file.
cycle-time = 60 # Number of seconds between cycles.
idle-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) unless you
# know what you are doing.
syslog = 0 # Turn this on if you want spindown to log messages using syslog.
# You will not want to turn this on if you are trying to spindown
# the disk with the root filesystem on.
name = sdb
spindown = 1
command = sg_start --stop
You will need to change name = sdb into something else depending which drive you want to stop or you can make it stop multiple drives. Check the website I gave before for more information.
Now you have your configuration file. It is time to start the daemon, write
when you write the line below
you should see something like
You can change the spindown time from the config file. 3600 is fine if you do not know what you are doing. Hope this helps. Write comments if I miss something.