
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.
cd
mkdir xxx
cd xxx
wget http://spindown.googlecode.com/files/spindown-0.2.2.tar.gz
tar xvzf spindown-0.2.2.tar.gz
cd spindown-0.2.2
make
make install
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
nano /etc/spindown.conf
and copy and paste the lines below into this file.
[General]
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.
[Disk 0]
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
/etc/init.d/spindown start
when you write the line below
/etc/init.d/spindown status
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.
Good luck...
