Linux 2.4.x SCSI Disk Spin Down
The spindown program stops spinning a SCSI disk if it's idle for a
while. This program has been written for Linux 2.4.x.
The spindown program periodically looks at I/O disk activity statistics
available in /proc/stat. A disk idle condition is detected if the disk
statistics aren't changed for a while. Once a disk idle time out is
reached, the program sends a SCSI motor control command in order to
spin down the disk motor.
The spindown program has been tested on a Linksys NSLU2 network storage
platform with a FREECOM 400GB external USB disk connected to port 1.
NSLU2 has been running
the V2.3R63-uNSLUng-6.8-beta
firmware.
Download the spindown program:
A simple way to test whether the spindown program works well for your
external USB disk connected to the NSLU2 device is to go through the
following steps:
- enable telnet on NSLU2 using the WEB interface,
- copy the spindown program to the
external USB disk,
- open a telnet session and log into NSLU2 as root,
- copy the spindown file from the USB disk to the root file system,
- execute the spindown program from the root file system.
On a Linux host:
# mount -t cifs 192.168.1.77:/HDD_1_1_1 /HDD_1_1_1
# cp spindown /HDD_1_1_1
# telnet 192.168.1.77
# login: root
# Password: uNSLUng
# cp /share/hdd/data/HDD_1_1_1/spindown /opt
# /opt/spindown -d 300 /dev/sdb
# exit
Your external USB disk connected to port 1 should stop spinning in 5
minutes.
Note that if you have a flash memory
stick connected to NSLU2, it shouldn't be managed by the spindown
program. Otherwise, a motor control command failure on such a flash
stick device may cause a motor control failure on other USB disks. The
"-" option can be used, for example, to avoid the flash stick being
managed by the spindown program.