NSLU2-Linux
view · edit · print · history

FAQ.SpinDownUSBHarddisks History

Hide minor edits - Show changes to markup

October 21, 2012, at 09:06 AM by AI --
Changed line 241 from:

A.I. Here is my version. It handles multiple disks, checks its argument count and make sure it's a single instance. Parameters: time interval in seconds and devices to check/spindown. For example:

to:

A.I. Here is my version. It handles multiple disks, logs spindowns, checks its argument count and makes sure it's a single instance. Parameters: time interval in seconds and devices to check/spindown. For example:

October 21, 2012, at 09:03 AM by AI -- Method 3 script
Changed lines 241-300 from:

Spindown daemon without kernel patch for Unslung

By Vladimir

The spindown daemon 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 the disk idle time out is reached, the program sends a SCSI motor control command in order to spin down the disk motor.

This solution works with Unslung 6.8 using a FREECOM External USB drive (400 GB Samsung hard drive).

See http://vladimir.grouzdev.free.fr/public/spindown.

Comment by MoD
Seems to work on a Fantec case with SAMSUNG SP1614C? in it.
Comment by BenMcDui
Vladimir, this works very well on my Iomega-USB 500GB on Port 1. Spassiba!
Comment 2 by BenMcDui
Do *not* disconnect or switch off your disk in spun down state; your Slug gets confused and you may come into trouble as it does no longer recognise your HDD. Activate the HDD first, or power down your Slug (the disk then starts up first (to say goodbye or so?)).
Comment 3 by BenMcDui
It DOES work on an ext3 disk, but NOT on an fat disk. Vladimir, any idea, could you expand your explanation a bit, how does your method compare to the other methods on this page?
Comment by Paul
Although promising and elegant solution, in contrast with Ben this does not seem to work with my Iomega-USB 500GB on Port 1 (Iomega MDHD500-UE)
BenMcDui asks
Paul, is your disk ext3, fat, ntfs?
Paul says
It's an ext3. Sorry for providing incomplete information.
BenMcDui says
I have discovered that it only works under the condition that you boot the Slug, and *only* after bootup, connect the disk.
[TheRookie]
Works with Buffalo DriveStation 500GB connected as sdb via USB Hub. After 5 minutes (300 seconds, as specified), the disk clicks and goes to standby mode.
Does not work for Seagate ST3500630AS installed into Icy-Box IB351U-BL. This is connected as sde to the same USB Hub.
bitbucket says
It's working with a Maxtor 300GB drive in a Antec MX-100 box, connected as sdb through a USB hub on Port 1. Drive spins back up when accessed. Thanks!
Comment by `florin
Works fine with Samsung HD250HJ? and Seagate ST3250823AS? in Vantec NexStar3? enclosures, and Western Digital WD5000AAKS? in BYTECC BT-380SATACOMBO enclosure.
Comment by Hendrik - Jan2009
Works fine with NSLU2 and both TrekStor? drives that I own, but with SATA WD CaviarGP? 1TB WD10EACS? "Green" Drive, 500GB, with a SATA-USB adaptor, I first thought it would work, but that was wrong. That combo was supposed to save lots of power :-) Box ads say "Cool. Quiet. Eco-friendly! and I planned to run it 24/7/365. Anyway. The drives which work fine with spindown are: TrekStor? Model:HDT725032VLAT80? Rev:1.05 (320GB) and TrekStor? Model:DataStation? 8 (160GB). And I'll continue to try to find out what is wrong with my SATA-USB adaptor. Thank you for this nice tool!

4.Method: Use sg_start to spindown usb disk

for OpenDebianSlug 3.10 2.16 kernel:

  install sg3 scsi tools: apt-get install sg3-utils

for OpenSlug get the source and make install locally using a native build environment

  e.g. download the tar.gz from here,
       wget http://ftp.de.debian.org/debian/pool/main/s/sg3-utils/sg3-utils_1.08.orig.tar.gz
       tar -xzvf sg3-utils_1.08.orig.tar.gz
       cd sg3-utils_1.08
       make install

  to powerdown a hdd: /usr/bin/sg_start --stop /dev/sda

Following the manual page sg_start sends so called "power conditions" to the external device. The example above uses only the default condition which apparently works for most drives. However, I had to use the following command to spin my external usb down: (:table border=0 width=80% bgcolor=#eeffee:)

  /usr/bin/sg_start 0 --pc=2 /dev/sda

(:tableend:) There are also other "power conditions" which might work for you. It is definetly worth checking the man page.

  The following script should spin down the idle drive using sg_start 
to:

A.I. Here is my version. It handles multiple disks, checks its argument count and make sure it's a single instance. Parameters: time interval in seconds and devices to check/spindown. For example: idle.sh 900 sda1 sdb1

Changed lines 246-261 from:
  1. !/bin/sh
  2. Script to see if external storage is being used
  3. if its not being used, place drive in idle
  4. to change to your own config, change /hd to your mount point

echo "***************`date`********" >> /var/log/power t=`fuser -c /hd` if test "$t" then echo "in use" >> /var/log/power else echo "not in use, power down." >> /var/log/power echo "`sg_start --stop /dev/sdb`" >> /var/log/power

to:
  1. !/bin/bash

if [ $# -lt 2 ]

  then
    echo "idle.sh: not enough arguments supplied"
    exit 1
Changed lines 253-254 from:

echo $t >> /var/log/power echo "" >> /var/log/power

to:

ps | grep 'idle.sh' | grep -v grep > idle.pid pids=$(cat idle.pid | cut -d ' ' -f 1) for pid in $pids do

   if [ $pid -ne $$ ]; then
      echo "idle.sh: already running, exiting"
      rm -f idle.pid
      exit 2
   fi

done rm -f idle.pid

interval=$1 sleeptime=10 shift c=1

for i do

    state[$c]=`grep " $i " /proc/diskstats`
    up[$c]=1
    count[$c]=$interval
    c=$(($c+1))

done

while [ true ]; do

   sleep $sleeptime
   c=1
   for i
   do
      count[$c]=$((${count[$c]}-$sleeptime))
      newstate[$c]=`grep " $i " /proc/diskstats`
      if [ "${state[$c]}" = "${newstate[$c]}" ]; then
         if [ "${count[$c]}" -lt 0 ]; then
            count[$c]=$interval
            if [ ${up[$c]} = 1 ]; then
               echo -e "$i spin-down\t" `date` >> idle.log
               sync
               state[$c]=`grep " $i " /proc/diskstats`
               scsi-stop /dev/$i
               up[$c]=0
            fi
         fi
      else
         count[$c]=$interval
         state[$c]=${newstate[$c]}
         up[$c]=1
      fi
   c=$(($c+1))
   done

done

Deleted lines 307-352:

Comments:

by dA

   LaCie 250GB works also with sg3-utils.

  Type: LaCie 250 GB Vendor: SEAGATE   Model: ST3250823A  Rev: 3.03 

See http://nslu2-info.de/forum/showpost.php?p=20987&postcount=42

by asys3

   Chili USb 250 GB works fine with sg3-utils:

  Vendor: USBDisk   Model: RunDisk           Rev: 1.00
  Type:   Direct-Access                      ANSI SCSI revision: 02
  Vendor: WDC WD25  Model: 00BB-00RDA0       Rev: 0000
  Type:   Direct-Access                      ANSI SCSI revision: 00

I tried everything before and nearly gave up. My Western Digital WD25 drive has definitely NO AdvancedPM(i tried it with connecting it via IDE before.). With sg3-utils it works out of the box. Wakes up after any access and spins down, when calling the script above. Works fine here under Debian 4.0 NSLU2 Linux. The last thing for me is to write a cron job to execute the script above every XY minutes. Perhaps anyone can insert a cron job here - I don't know how to write a cron job (yet).

by soapm

 Trekstor maxi g.u. (with Samsung HD204UI) works with sg3-utils

  lsusb: ID 152d:2329 JMicron Technology Corp. / JMicron USA Technology Corp. transcend storejet 25P

Method 5: Use hd-idle to spin down external disks

hd-idle will monitor disk statistics much like the perl and shell scripts above but will do so within a single, small C program. The main reason for hd-idle is to save memory (i.e. a small daemon vs. a shell or perl script and a separate executable to actually spin down the disk) and CPU time.

Please note that the benefits of running a C program vs. a shell or perl script will be most noticable when running a full [Debian] distribution from the hard disk. If both the shell and the tool to stop the disk are stored on flash memory, hd-idle will provide little advantage over the script approaches mentioned above.

More information can be found on http://hd-idle.sf.net

Method 6: Unmount disks and suspend USB port (unproven)

Some devices will not respond to spindown commands at all, but will respond to being unplugged - such as my Freecom Technologies Hard Drive 500Mb (SAMSUNG HD501LJ). In theory this can be emulated by writing to the correct sys bus file, as illustrated here: http://elliotli.blogspot.com/2009/01/safely-remove-usb-hard-drive-in-linux.html. I have got this "spindown" to work nicely on a Ubuntu laptop, but not yet on a slug - I include this here in case this triggers some ideas with experienced Linux users. The problem on the slug is that the "power/level" file doesn't appear to be there (Debian Etch). Maybe this is in Lenny?

Changed lines 310-324 from:

System modifications

A Linux system usually has many processes that access that disk from time to time. These need to be tweaked, otherwise they will cause the drive to spin up very often. Basically, you need to either disable the offending file accesses (by turning off or reconfiguring daemons), or move the files being written elsewhere, for example to a USB stick, a network mount, or a tmpfs (only for volatile data).

Here is a list of things that you may need to do, depending on your system and the packages installed:

  • Add the noatime mount option in /etc/fstab to all partitions on the disk. This will prevent the disk from waking up for cached read access, just to update the 'last access time' flag of the file. This method will not work in Unslung 6.8, since /etc/fstab is overwritten at reboot. Instead you can make a boot script (I call it /opt/etc/init.d/S90noatime) which remounts the partions with noatime. The commands you need in the script are mount -o remount,noatime /dev/sda1 and mount -o remount,sync,noatime /dev/sda2.
  • syslogd generates periodic 'MARK' timestamps unless disabled by adding the -m0 command line option (in /etc/default/syslogd on Debian systems, /etc/inittab on Unslung systems).
  • Disable or move some of the log files (in /etc/syslog.conf), but keep in mind that logs are often very useful. A nice solution is to have syslogd send everyting over the network to a remote host.
  • Change nmbd (a samba process) so that is is *not* a local master. In the file /etc/samba/smb.conf add these lines to the [global] section:
to:

Spindown daemon without kernel patch for Unslung

By Vladimir

The spindown daemon 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 the disk idle time out is reached, the program sends a SCSI motor control command in order to spin down the disk motor.

This solution works with Unslung 6.8 using a FREECOM External USB drive (400 GB Samsung hard drive).

See http://vladimir.grouzdev.free.fr/public/spindown.

Comment by MoD
Seems to work on a Fantec case with SAMSUNG SP1614C? in it.
Comment by BenMcDui
Vladimir, this works very well on my Iomega-USB 500GB on Port 1. Spassiba!
Comment 2 by BenMcDui
Do *not* disconnect or switch off your disk in spun down state; your Slug gets confused and you may come into trouble as it does no longer recognise your HDD. Activate the HDD first, or power down your Slug (the disk then starts up first (to say goodbye or so?)).
Comment 3 by BenMcDui
It DOES work on an ext3 disk, but NOT on an fat disk. Vladimir, any idea, could you expand your explanation a bit, how does your method compare to the other methods on this page?
Comment by Paul
Although promising and elegant solution, in contrast with Ben this does not seem to work with my Iomega-USB 500GB on Port 1 (Iomega MDHD500-UE)
BenMcDui asks
Paul, is your disk ext3, fat, ntfs?
Paul says
It's an ext3. Sorry for providing incomplete information.
BenMcDui says
I have discovered that it only works under the condition that you boot the Slug, and *only* after bootup, connect the disk.
[TheRookie]
Works with Buffalo DriveStation 500GB connected as sdb via USB Hub. After 5 minutes (300 seconds, as specified), the disk clicks and goes to standby mode.
Does not work for Seagate ST3500630AS installed into Icy-Box IB351U-BL. This is connected as sde to the same USB Hub.
bitbucket says
It's working with a Maxtor 300GB drive in a Antec MX-100 box, connected as sdb through a USB hub on Port 1. Drive spins back up when accessed. Thanks!
Comment by `florin
Works fine with Samsung HD250HJ? and Seagate ST3250823AS? in Vantec NexStar3? enclosures, and Western Digital WD5000AAKS? in BYTECC BT-380SATACOMBO enclosure.
Comment by Hendrik - Jan2009
Works fine with NSLU2 and both TrekStor? drives that I own, but with SATA WD CaviarGP? 1TB WD10EACS? "Green" Drive, 500GB, with a SATA-USB adaptor, I first thought it would work, but that was wrong. That combo was supposed to save lots of power :-) Box ads say "Cool. Quiet. Eco-friendly! and I planned to run it 24/7/365. Anyway. The drives which work fine with spindown are: TrekStor? Model:HDT725032VLAT80? Rev:1.05 (320GB) and TrekStor? Model:DataStation? 8 (160GB). And I'll continue to try to find out what is wrong with my SATA-USB adaptor. Thank you for this nice tool!

4.Method: Use sg_start to spindown usb disk

for OpenDebianSlug 3.10 2.16 kernel:

  install sg3 scsi tools: apt-get install sg3-utils

for OpenSlug get the source and make install locally using a native build environment

  e.g. download the tar.gz from here,
       wget http://ftp.de.debian.org/debian/pool/main/s/sg3-utils/sg3-utils_1.08.orig.tar.gz
       tar -xzvf sg3-utils_1.08.orig.tar.gz
       cd sg3-utils_1.08
       make install

  to powerdown a hdd: /usr/bin/sg_start --stop /dev/sda

Following the manual page sg_start sends so called "power conditions" to the external device. The example above uses only the default condition which apparently works for most drives. However, I had to use the following command to spin my external usb down: (:table border=0 width=80% bgcolor=#eeffee:)

  /usr/bin/sg_start 0 --pc=2 /dev/sda

(:tableend:) There are also other "power conditions" which might work for you. It is definetly worth checking the man page.

  The following script should spin down the idle drive using sg_start 
Changed line 370 from:
  1. disable local master provision so that nmbd doesn't spin up disk
to:
  1. !/bin/sh
Changed lines 372-376 from:
  1. preferred master = yes # previous setting

preferred master = no domain master = no local master = no os level = 0

to:
  1. Script to see if external storage is being used
  2. if its not being used, place drive in idle
  3. to change to your own config, change /hd to your mount point

echo "***************`date`********" >> /var/log/power t=`fuser -c /hd` if test "$t" then echo "in use" >> /var/log/power else echo "not in use, power down." >> /var/log/power echo "`sg_start --stop /dev/sdb`" >> /var/log/power fi echo $t >> /var/log/power echo "" >> /var/log/power

Changed lines 392-397 from:
  • [Unslung] Cron runs an hourly syncronization of the system clock (hwclock) and three times a day it checks if the disk is full. Whenever cron executes a job it is logged in /var/log/messages, which causes the disk to spin up. Since these jobs are not vital for your slug, you can avoid this spin up by editing /etc/crontab so the jobs are only run once a day. These lines in crontab will run hwclock and CheckDiskFull once a day (at midnight):

[@ 0 0 * * * root /usr/sbin/CheckDiskFull? &>/dev/null 1 0 * * * root /usr/sbin/hwclock -s &>/dev/null

to:

Comments:

by dA

  [@ LaCie? 250GB works also with sg3-utils.

  Type: LaCie? 250 GB Vendor: SEAGATE   Model: ST3250823A?  Rev: 3.03 
Added lines 399-464:

See http://nslu2-info.de/forum/showpost.php?p=20987&postcount=42

by asys3

   Chili USb 250 GB works fine with sg3-utils:

  Vendor: USBDisk   Model: RunDisk           Rev: 1.00
  Type:   Direct-Access                      ANSI SCSI revision: 02
  Vendor: WDC WD25  Model: 00BB-00RDA0       Rev: 0000
  Type:   Direct-Access                      ANSI SCSI revision: 00

I tried everything before and nearly gave up. My Western Digital WD25 drive has definitely NO AdvancedPM(i tried it with connecting it via IDE before.). With sg3-utils it works out of the box. Wakes up after any access and spins down, when calling the script above. Works fine here under Debian 4.0 NSLU2 Linux. The last thing for me is to write a cron job to execute the script above every XY minutes. Perhaps anyone can insert a cron job here - I don't know how to write a cron job (yet).

by soapm

 Trekstor maxi g.u. (with Samsung HD204UI) works with sg3-utils

  lsusb: ID 152d:2329 JMicron Technology Corp. / JMicron USA Technology Corp. transcend storejet 25P

Method 5: Use hd-idle to spin down external disks

hd-idle will monitor disk statistics much like the perl and shell scripts above but will do so within a single, small C program. The main reason for hd-idle is to save memory (i.e. a small daemon vs. a shell or perl script and a separate executable to actually spin down the disk) and CPU time.

Please note that the benefits of running a C program vs. a shell or perl script will be most noticable when running a full [Debian] distribution from the hard disk. If both the shell and the tool to stop the disk are stored on flash memory, hd-idle will provide little advantage over the script approaches mentioned above.

More information can be found on http://hd-idle.sf.net

Method 6: Unmount disks and suspend USB port (unproven)

Some devices will not respond to spindown commands at all, but will respond to being unplugged - such as my Freecom Technologies Hard Drive 500Mb (SAMSUNG HD501LJ). In theory this can be emulated by writing to the correct sys bus file, as illustrated here: http://elliotli.blogspot.com/2009/01/safely-remove-usb-hard-drive-in-linux.html. I have got this "spindown" to work nicely on a Ubuntu laptop, but not yet on a slug - I include this here in case this triggers some ideas with experienced Linux users. The problem on the slug is that the "power/level" file doesn't appear to be there (Debian Etch). Maybe this is in Lenny?


System modifications

A Linux system usually has many processes that access that disk from time to time. These need to be tweaked, otherwise they will cause the drive to spin up very often. Basically, you need to either disable the offending file accesses (by turning off or reconfiguring daemons), or move the files being written elsewhere, for example to a USB stick, a network mount, or a tmpfs (only for volatile data).

Here is a list of things that you may need to do, depending on your system and the packages installed:

  • Add the noatime mount option in /etc/fstab to all partitions on the disk. This will prevent the disk from waking up for cached read access, just to update the 'last access time' flag of the file. This method will not work in Unslung 6.8, since /etc/fstab is overwritten at reboot. Instead you can make a boot script (I call it /opt/etc/init.d/S90noatime) which remounts the partions with noatime. The commands you need in the script are mount -o remount,noatime /dev/sda1 and mount -o remount,sync,noatime /dev/sda2.
  • syslogd generates periodic 'MARK' timestamps unless disabled by adding the -m0 command line option (in /etc/default/syslogd on Debian systems, /etc/inittab on Unslung systems).
  • Disable or move some of the log files (in /etc/syslog.conf), but keep in mind that logs are often very useful. A nice solution is to have syslogd send everyting over the network to a remote host.
  • Change nmbd (a samba process) so that is is *not* a local master. In the file /etc/samba/smb.conf add these lines to the [global] section:
# disable local master provision so that nmbd doesn't spin up disk
#
#preferred master = yes # previous setting
preferred master = no
domain master = no
local master = no
os level = 0
Added lines 467-475:
  • [Unslung] Cron runs an hourly syncronization of the system clock (hwclock) and three times a day it checks if the disk is full. Whenever cron executes a job it is logged in /var/log/messages, which causes the disk to spin up. Since these jobs are not vital for your slug, you can avoid this spin up by editing /etc/crontab so the jobs are only run once a day. These lines in crontab will run hwclock and CheckDiskFull once a day (at midnight):
0 0 * * * root /usr/sbin/CheckDiskFull &>/dev/null
1 0 * * * root /usr/sbin/hwclock -s &>/dev/null
April 20, 2011, at 05:32 PM by Mark Vertesaljai -- modification
Changed lines 604-605 from:
  • 15 Sept 2009

[@P: Vendor=152d ProdID?=2329 Rev= 1.00

to:
  • 20 April 2011

lsusb says: ID 05e3:0718 Genesys Logic, Inc. IDE/SATA Adapter

P:  Vendor=05e3 ProdID=0718
S:  Manufacturer=Genesys Logic
S:  Product= SATA, PATA, USB Combo

Bought in e-Bay (1st try). Works with hdparm BUT NOT THROUGH USB 2.0 HUB. Tried 4 different HUBs?, none of them worked normally. It stops with hdparm -Y (and -y) but after spinup connection lost. Probably it is some timing problem: dmesg said buffer.c "paniced". Only reboot helps... Through USB 1.1 HUB or connection to root HUB it is OK.

  • 20 April 2011

lsusb says: ID 152d:2338 JMicron? Technology Corp. / JMicron? USA Technology Corp. JM20337? Hi-Speed USB to SATA & PATA Combo Bridge [@P: Vendor=152d ProdID?=2338

Added lines 620-627:

S: Product=JM20337? e-SATA, PATA, USB Combo@] Bought in e-Bay (3rd try). Works with hdparm though USB HUB, although my OpenWRT? Backfire (10.03.1-rc4, r24045)

 "HDIO_DRIVE_CMD(sleep) failed: Invalid exchange"
  • 15 Sept 2009

[@P: Vendor=152d ProdID?=2329 Rev= 1.00 S: Manufacturer=JMicron?

Deleted line 800:
Changed lines 804-812 from:
to:

20 April 2011 lsusb says: ID 14cd:6600 Super Top USB 2.0 IDE [IC Moai M110E?]

P:  Vendor=14cd ProdID=6600
S:  Manufacturer=Super Top?
S:  Product=Moai PATA, USB Combo

Bought in e-Bay (2rd try). Was not able to stop with dhparm - should check with sdparm.

October 09, 2010, at 10:09 AM by soapm --
Changed lines 352-358 from:
to:

by soapm

 Trekstor maxi g.u. (with Samsung HD204UI) works with sg3-utils

  lsusb: ID 152d:2329 JMicron Technology Corp. / JMicron USA Technology Corp. transcend storejet 25P
January 10, 2010, at 06:10 PM by MoD --
Added lines 252-253:
Comment by MoD
Seems to work on a Fantec case with SAMSUNG SP1614C? in it.
September 15, 2009, at 09:13 PM by axl --
Changed lines 596-597 from:
  • 12 april 2009

[@P: Vendor=152d ProdID?=2339 Rev= 1.00

to:
  • 15 Sept 2009

[@P: Vendor=152d ProdID?=2329 Rev= 1.00

Changed line 600 from:
to:

S: SerialNumber?=5E2F12FFFFFF

Added lines 602-610:

Another 2.5" Icy-Box enclosure (USB/eSATA) IB-290StUS-B with JMicron? USB-bridge. Used in conjunction with a Seagate Momentus 5400.6 500GB drive. Spins down flawlessly with sdparm.

  • 12 april 2009
P:  Vendor=152d ProdID=2339 Rev= 1.00
S:  Manufacturer=JMicron
S:  Product=USB to ATA/ATAPI Bridge
S:  SerialNumber=DCA3901746FF
June 03, 2009, at 07:43 PM by Adam Flippo --
Changed lines 110-111 from:
to:
  • 03.06.09 I have the NSLU2 with a WD Elements 1TB drive. At first I had unslung, but then went to debian for spindown. After my debian crashed and wouldnt come back up I chose (OK, I didn't want to take the time for another debian install...) :) to install SlugOS on a flash thumbdrive and mount the drive seperatly. Works like a charm. Every 10-15 mins. a spindown. Yay. Thanks for SlugOS!
May 26, 2009, at 10:24 PM by JNC --
Changed line 428 from:
  • Create the following mount_var_dev.sh script in /etc/init.d :
to:
  • Create the following _mount_var_dev.sh script in /etc/init.d :
Changed lines 545-546 from:
  • chmod 0755 mount_var_dev.sh
to:
  • chmod 0755 _mount_var_dev.sh
Changed line 550 from:
  • ln -s /etc/init.d/mount_var_dev.sh S37mount_var_dev.sh
to:
  • ln -s /etc/init.d/_mount_var_dev.sh S37mount_var_dev.sh
May 26, 2009, at 10:21 PM by JNC -- Change a script to let it be cleaner
Changed lines 413-414 from:

The challenge is to create a script that will copy all files from /dev and /var into the RAM resources you created, each time you boot the NSLU2.

to:

The challenge is to create a script that will copy all files from /dev and /var/log (or /var) into the RAM resources you created, each time you boot the NSLU2.

Some arguments

  • Some prefer to mount the full /var into ramfs. Other prefer to mount only /var/log

Make your own choice and change the VARMOUNTPOINT variable to choose which directory to mount

  • Some commands should be run for debian slug only

Change the DEBIANSLUG variable to choose.

  • Some commands should be run to optimize the swap but are not accessible from all slugs

Change the RUNFULLSWAPCOMMAND variable to choose.

The procedure

Changed line 432 from:
  1. /etc/init.d/mount_var_dev.sh
to:
  1. /etc/init.d/_mount_var_dev.sh
Changed lines 435-436 from:
  1. disable the oom-killer to use the full swap

/sbin/sysctl -w vm.overcommit_memory=1

to:
  1. Constants
  2. The directores that will be mounted in ramfs
  3. -------------------------------------------

VARMOUNTPOINT=/var/log

  1. should be /var or /var/log
  2. do not end the path with /

DEVMOUNTPOINT=/dev

  1. Booleans indicating whether local ${VARMOUNTPOINT} and ${DEVMOUNTPOINT} should still be accessible
  2. --------------------------------------------------------------------------------------------------

KEEPVARACCESSIBLE=0 TARGETLOCALVAR=${VARMOUNTPOINT}.state

KEEPDEVACCESSIBLE=0 TARGETLOCALDEV=${DEVMOUNTPOINT}.state

  1. 0 if you do not want to access the local directories, 1 otherwise
  2. The local directories can be accessed through /dev.state and ${VARMOUNTPOINT}.state
  3. Boolean indicating whether to run a command to use the full swap (/sbin/sysctl -w vm.overcommit_memory=1)
  4. ----------------------------------------------------------------

RUNFULLSWAPCOMMAND=0

  1. 0 if you do not want to run the given command, 1 otherwise
Changed lines 465-467 from:
  1. better only use /var/log then the full /var
  2. following lines might need to be adjusted according to your OS and/or installed services

/bin/echo "Creating ramfs for /var/log:"

to:
  1. Boolean indicating whether to run command dedicated for debian slug (mount devpts /dev/pts -t devpts)
  2. -------------------------------------------------------------------

DEBIANSLUG=0

  1. 0 if NOT running Debianslug, 1 otherwise
  2. disable the oom-killer to use the full swap

if [ ${RUNFULLSWAPCOMMAND} -ne 0 ] then

        echo "Running the full swap command"
        /sbin/sysctl -w vm.overcommit_memory=1

else

        echo "Skipping the full swap command"

fi

  1. Mount ${VARMOUNTPOINT} to ramfs

/bin/echo "Creating ramfs for ${VARMOUNTPOINT}"

Changed lines 486-488 from:

/bin/cp -rp /var/log/* /mnt/ /bin/mount -o bind /var/log /var/log.state (comment from ObiYawn?: This allows you to access the original /var/log/ directory under /var/log.state/, which the one in the ramfs is modeled after during every boot.) /bin/mount -o bind /mnt /var/log

to:

echo "Copying files from ${VARMOUNTPOINT} to ramfs" /bin/cp -rp ${VARMOUNTPOINT}/* /mnt/

  1. keep the original ${VARMOUNTPOINT} accessible if requested

if [ ${KEEPVARACCESSIBLE} -ne 0 ] then

        echo "Original ${VARMOUNTPOINT} is still accessible in ${TARGETLOCALVAR}"
        /bin/mount -o bind ${VARMOUNTPOINT} ${TARGETLOCALVAR}

else

        echo "Original ${VARMOUNTPOINT} is not accesible any longer"

fi

  1. Mount the ramfs to the given directory

/bin/mount -o bind /mnt ${VARMOUNTPOINT}

Changed lines 503-506 from:

/bin/echo "Creating ramfs for /dev:"

to:
  1. Mount ${DEVMOUNTPOINT} to ramfs

/bin/echo "Creating ramfs for ${DEVMOUNTPOINT}"

Added lines 508-509:

echo "Copying files from ${DEVMOUNTPOINT} to ramfs"

Deleted line 510:
  1. find . -print0 -mount | cpio -p -0 -d -m -u /mnt (from JNC : the -mount option produces an error and is not necessary)
Changed lines 513-522 from:

/bin/mount -o bind /dev /dev.state (comment from ObiYawn?: Same reason as above -- see my other comment)

to:

if [ ${KEEPDEVACCESSIBLE} -ne 0 ] then

        echo "Original ${DEVMOUNTPOINT} is still accessible in ${TARGETLOCALDEV}"
        /bin/mount -o bind /dev /dev.state

else

        echo "Original ${DEVMOUNTPOINT} is not accessible any longer"

fi

  1. Mount the ramfs to the given directory
Changed lines 526-528 from:
  1. Uncomment the following line when using debianslug
  2. mount devpts /dev/pts -t devpts
to:
  1. Run dedicated commands for Debian slug if requested

if [ ${DEBIANSLUG} -ne 0 ] then

        echo "Running dedicated commands for Debian slug"
        mount devpts /dev/pts -t devpts

else

        echo "Dedicated commands for Debian slug are not run"

fi

Added line 539:
Added line 541:
April 11, 2009, at 10:10 PM by P van Voorst -- Drive added
Changed lines 504-508 from:
  • 30 Jan 2009

Buffalo TurboUSB DriveStation 1TB. Spin down works with sdparm.

  • 03 Jan 2009

[@P: Vendor=1e68 ProdID?=001b Rev= 0.00

to:
  • 12 april 2009

[@P: Vendor=152d ProdID?=2339 Rev= 1.00

Changed lines 507-508 from:

S: Product= DS maxi g.u S: SerialNumber?=200810211D18

to:

S: Product=USB to ATA/ATAPI Bridge S: SerialNumber?=DCA3901746FF?

Added lines 510-520:

This is an el-cheapo external USB-Sata case with an Western Digital WDC-WD50? (model 00AAKS) 500Gb SATA-II drive in it. It spins down perfectly with sdparm and spins-up when accessed.

  • 30 Jan 2009

Buffalo TurboUSB DriveStation 1TB. Spin down works with sdparm.

  • 03 Jan 2009
P:  Vendor=1e68 ProdID=001b Rev= 0.00
S:  Manufacturer=JMicron
S:  Product= DS maxi g.u
S:  SerialNumber=200810211D18
April 05, 2009, at 02:59 PM by ObiYawn -- Uncommented valid mount lines that other user previously commented out.
Changed line 432 from:
  1. /bin/mount -o bind /var/log /var/log.state (commented by JNC : can not see the use for this line)
to:

/bin/mount -o bind /var/log /var/log.state (comment from ObiYawn?: This allows you to access the original /var/log/ directory under /var/log.state/, which the one in the ramfs is modeled after during every boot.)

Changed line 442 from:
  1. /bin/mount -o bind /dev /dev.state (commented by JNC : can not see the use for this line)
to:

/bin/mount -o bind /dev /dev.state (comment from ObiYawn?: Same reason as above -- see my other comment)

February 21, 2009, at 10:13 AM by JonH --
Changed lines 34-35 from:
  • Method 6: Unmount disks and suspend USB port [not sure of support yet]
to:
  • Method 6: Unmount disks and suspend USB port [NSLU2 support not discovered yet]
Changed lines 359-361 from:

Method 6: Unmount disks and suspend USB port

Some devices will not respond to spindown commands at all, but will respond to being unplugged - such as my Freecom Technologies Hard Drive 500Mb (SAMSUNG HD501LJ). This can be emulated by writing to the correct sys bus file, as illustrated here: http://elliotli.blogspot.com/2009/01/safely-remove-usb-hard-drive-in-linux.html. Naturally all mounts must be unmounted first - not sure what the consequences are if you don't! I have got this "spindown" to work where everything else has failed, but I have not tested it over the long term so can't vouch (yet) for its safety etc.

to:

Method 6: Unmount disks and suspend USB port (unproven)

Some devices will not respond to spindown commands at all, but will respond to being unplugged - such as my Freecom Technologies Hard Drive 500Mb (SAMSUNG HD501LJ). In theory this can be emulated by writing to the correct sys bus file, as illustrated here: http://elliotli.blogspot.com/2009/01/safely-remove-usb-hard-drive-in-linux.html. I have got this "spindown" to work nicely on a Ubuntu laptop, but not yet on a slug - I include this here in case this triggers some ideas with experienced Linux users. The problem on the slug is that the "power/level" file doesn't appear to be there (Debian Etch). Maybe this is in Lenny?

February 20, 2009, at 10:18 PM by JonH -- Unlink a wiki link
Changed lines 360-361 from:

Some devices will not respond to spindown commands at all, but will respond to being unplugged - such as my Freecom Technologies Hard Drive 500Mb (SAMSUNG HD501LJ?) [JonH?]. This can be emulated by writing to the correct sys bus file, as illustrated here: http://elliotli.blogspot.com/2009/01/safely-remove-usb-hard-drive-in-linux.html. Naturally all mounts must be unmounted first - not sure what the consequences are if you don't! I have got this "spindown" to work where everything else has failed, but I have not tested it over the long term so can't vouch (yet) for its safety etc.

to:

Some devices will not respond to spindown commands at all, but will respond to being unplugged - such as my Freecom Technologies Hard Drive 500Mb (SAMSUNG HD501LJ). This can be emulated by writing to the correct sys bus file, as illustrated here: http://elliotli.blogspot.com/2009/01/safely-remove-usb-hard-drive-in-linux.html. Naturally all mounts must be unmounted first - not sure what the consequences are if you don't! I have got this "spindown" to work where everything else has failed, but I have not tested it over the long term so can't vouch (yet) for its safety etc.

February 20, 2009, at 10:16 PM by JonH -- Add anchor link in for method 6
Added line 358:

February 20, 2009, at 10:15 PM by JonH -- Add titles in for method 6 change
Added line 11:
Added lines 34-35:
  • Method 6: Unmount disks and suspend USB port [not sure of support yet]
February 20, 2009, at 10:12 PM by JonH -- New method to spin external disks down - suspend usb port
Added lines 355-357:

Method 6: Unmount disks and suspend USB port

Some devices will not respond to spindown commands at all, but will respond to being unplugged - such as my Freecom Technologies Hard Drive 500Mb (SAMSUNG HD501LJ?) [JonH?]. This can be emulated by writing to the correct sys bus file, as illustrated here: http://elliotli.blogspot.com/2009/01/safely-remove-usb-hard-drive-in-linux.html. Naturally all mounts must be unmounted first - not sure what the consequences are if you don't! I have got this "spindown" to work where everything else has failed, but I have not tested it over the long term so can't vouch (yet) for its safety etc.

February 18, 2009, at 08:30 PM by JNC -- Scripting optimization
Changed line 425 from:

/bin/mount -o bind /var/log /var/log.state

to:
  1. /bin/mount -o bind /var/log /var/log.state (commented by JNC : can not see the use for this line)
Changed lines 432-433 from:

find . -print0 -mount | cpio -p -0 -d -m -u /mnt

to:
  1. find . -print0 -mount | cpio -p -0 -d -m -u /mnt (from JNC : the -mount option produces an error and is not necessary)

find . -print0 | cpio -p -0 -d -m -u /mnt

Changed line 435 from:

/bin/mount -o bind /dev /dev.state

to:
  1. /bin/mount -o bind /dev /dev.state (commented by JNC : can not see the use for this line)
Changed lines 454-455 from:
  • chmod 0755 S37mount_var_dev.sh
to:
January 30, 2009, at 03:44 PM by EB --
Changed lines 498-499 from:

Buffalo TurboUSB? DriveStation 1TB. Spin down works with sdparm.

to:

Buffalo TurboUSB DriveStation 1TB. Spin down works with sdparm.

January 30, 2009, at 03:43 PM by EB --
Changed lines 498-499 from:

Buffalo TurboUSB? DriveStation 1TB. Spin down works with sdparm.

to:

Buffalo TurboUSB? DriveStation 1TB. Spin down works with sdparm.

January 30, 2009, at 03:42 PM by EB --
Added lines 497-499:
  • 30 Jan 2009

Buffalo TurboUSB? DriveStation 1TB. Spin down works with sdparm.

January 29, 2009, at 09:39 PM by JNC --
January 29, 2009, at 09:39 PM by JNC --
January 29, 2009, at 09:39 PM by JNC --
Changed lines 455-457 from:
  • edit /etc/syslog.conf and remove the /dev/xconsole entry (only used for X11 logging)
to:

* edit /etc/syslog.conf and remove the /dev/xconsole entry (only used for X11 logging)

January 17, 2009, at 12:42 PM by Hendrik --
Changed lines 269-272 from:
Comment by Hendrik
Works fine with NSLU2 and both TrekStor? drives that I own, but with SATA WD CaviarGP? 1TB WD10EACS? "Green" Drive, 500GB, with a SATA-USB adaptor, I first thought it would work, but that was wrong. That combo was supposed to save lots of power :-) Box ads say "Cool. Quiet. Eco-friendly! and I planned to run it 24/7/365. Anyway. The drives which work fine with spindown

are: TrekStor? Model:HDT725032VLAT80? Rev:1.05 (320GB) and TrekStor? Model:DataStation? 8 (160GB). And I'll continue to try to find out what is wrong with my SATA-USB adaptor. Thank you for this nice tool!

to:
Comment by Hendrik - Jan2009
Works fine with NSLU2 and both TrekStor? drives that I own, but with SATA WD CaviarGP? 1TB WD10EACS? "Green" Drive, 500GB, with a SATA-USB adaptor, I first thought it would work, but that was wrong. That combo was supposed to save lots of power :-) Box ads say "Cool. Quiet. Eco-friendly! and I planned to run it 24/7/365. Anyway. The drives which work fine with spindown are: TrekStor? Model:HDT725032VLAT80? Rev:1.05 (320GB) and TrekStor? Model:DataStation? 8 (160GB). And I'll continue to try to find out what is wrong with my SATA-USB adaptor. Thank you for this nice tool!
January 17, 2009, at 12:40 PM by Hendrik --
Changed lines 269-270 from:
Comment by Hendrik
Works fine with NSLU2 and SATA WD CaviarGP? 1TB WD10EACS? "Green" Drive, 500GB, with a SATA-USB adaptor. That combo is supposed to save lots of power :-) Box ads say "Cool. Quiet. Eco-friendly! and I am going to run it 24/7/365. Thank you for this nice tool!
to:
Comment by Hendrik
Works fine with NSLU2 and both TrekStor? drives that I own, but with SATA WD CaviarGP? 1TB WD10EACS? "Green" Drive, 500GB, with a SATA-USB adaptor, I first thought it would work, but that was wrong. That combo was supposed to save lots of power :-) Box ads say "Cool. Quiet. Eco-friendly! and I planned to run it 24/7/365. Anyway. The drives which work fine with spindown

are: TrekStor? Model:HDT725032VLAT80? Rev:1.05 (320GB) and TrekStor? Model:DataStation? 8 (160GB). And I'll continue to try to find out what is wrong with my SATA-USB adaptor. Thank you for this nice tool!

January 11, 2009, at 03:41 AM by sdub -- Added location of syslogd executable on unslung
Changed lines 366-367 from:
  • syslogd generates periodic 'MARK' timestamps unless disabled by adding the -m0 command line option (in /etc/default/syslogd on Debian systems).
to:
  • syslogd generates periodic 'MARK' timestamps unless disabled by adding the -m0 command line option (in /etc/default/syslogd on Debian systems, /etc/inittab on Unslung systems).
January 10, 2009, at 09:23 PM by Hendrik --
Changed lines 269-272 from:
Comment by Hendrik
Works fine with NSLU2 and SATA WD CaviarGP? 1TB WD10EACS? "Green" Drive, 500GB, with a SATA-USB adaptor.

That combo is supposed to save lots of power :-) Box ads say "Cool. Quiet. Eco-friendly! and I am going to run it 24/7/365. Thank you for this nice tool!

to:
Comment by Hendrik
Works fine with NSLU2 and SATA WD CaviarGP? 1TB WD10EACS? "Green" Drive, 500GB, with a SATA-USB adaptor. That combo is supposed to save lots of power :-) Box ads say "Cool. Quiet. Eco-friendly! and I am going to run it 24/7/365. Thank you for this nice tool!
January 10, 2009, at 09:21 PM by Hendrik --
Changed line 268 from:

to:
Changed lines 271-272 from:

Thank you for this nice tool.

to:

Thank you for this nice tool!


January 10, 2009, at 09:19 PM by Hendrik -- spindown works for me on NSLU2 with SATA drive +USB adaptor
Changed lines 269-272 from:
to:
Comment by Hendrik
Works fine with NSLU2 and SATA WD CaviarGP? 1TB WD10EACS? "Green" Drive, 500GB, with a SATA-USB adaptor.

That combo is supposed to save lots of power :-) Box ads say "Cool. Quiet. Eco-friendly! and I am going to run it 24/7/365. Thank you for this nice tool.

January 03, 2009, at 06:38 PM by Michael -- added one hd model to list
Added lines 494-503:
  • 03 Jan 2009
P:  Vendor=1e68 ProdID=001b Rev= 0.00
S:  Manufacturer=JMicron
S:  Product= DS maxi g.u
S:  SerialNumber=200810211D18

This is a "TrekStor? DataStation? maxi g.u" (external case comes with harddisk installed). The disk size is 1 TB. If someone tells me how to find out the model of the disk, I will post it. (Cannot open case -- warranty loss.) Works perfectly with scsi-stop /dev/sdX, and also "Spindown daemon without kernel patch for Unslung by Vladimir" (see above). I also have the 500 GB version of this device, same results.

December 13, 2008, at 04:00 PM by macnet -- added list of WD that spin down after 10mins
Changed lines 106-107 from:
to:
  • 13.12.08 List of | Western Digital USB external disks that spin down after 10 mins of inactivity.
November 19, 2008, at 03:41 PM by florin --
Changed line 266 from:

Works fine with Samsung HD250HJ? and Seagate ST3250823AS? in Vantec NexStar3? enclosures, and Western Digital WD5000AAKS? in BYTECC BT-380SATACOMBO enclosure.

to:
Comment by `florin
Works fine with Samsung HD250HJ? and Seagate ST3250823AS? in Vantec NexStar3? enclosures, and Western Digital WD5000AAKS? in BYTECC BT-380SATACOMBO enclosure.
November 19, 2008, at 03:38 PM by florin --
Added line 266:

Works fine with Samsung HD250HJ? and Seagate ST3250823AS? in Vantec NexStar3? enclosures, and Western Digital WD5000AAKS? in BYTECC BT-380SATACOMBO enclosure.

November 03, 2008, at 08:16 PM by fedor -- formatting
Changed line 632 from:

[P: Vendor=152d ProdID?=2336 Rev= 1.00

to:

[@P: Vendor=152d ProdID?=2336 Rev= 1.00

Changed line 634 from:

S: Product=JM20336? SATA, USB Combo]

to:

S: Product=JM20336? SATA, USB Combo@]

November 03, 2008, at 08:15 PM by fedor -- digitus enclosure with jmicron chipset added
Added lines 630-638:

DIGITUS 3.5" external HDD enclosure SATA to eSATA / USB 2.0 DA-70580 [P: Vendor=152d ProdID?=2336 Rev= 1.00 S: Manufacturer=JMicron? S: Product=JM20336? SATA, USB Combo] Although this one has a JMicron? chipset (see below), this one spins down perfectly, at least with a Hitachi HDP725050GLA360? 500G SATA disk.

Changed lines 648-649 from:

Appears that JMicron? chip doesn't support stop/start

to:

Appears that JMicron? chip doesn't support stop/start. See above for an Digitus enclosure with a JMicron? chipset that does.

October 31, 2008, at 03:34 AM by A Hagge --
Changed line 636 from:

P: Vendor=152d ProdID?=2336 Rev= 1.00

to:

[@P: Vendor=152d ProdID?=2336 Rev= 1.00

Changed line 638 from:

S: Product=JM20336? SATA, USB Combo

to:

S: Product=JM20336? SATA, USB Combo@]

October 31, 2008, at 03:32 AM by A Hagge -- Added Kingwin Z1 to adapters not supporting start/stop
Added lines 633-640:

30 October 2008

  • Kingwin Z1-35EU-BK

P: Vendor=152d ProdID?=2336 Rev= 1.00 S: Manufacturer=JMicron? S: Product=JM20336? SATA, USB Combo Appears that JMicron? chip doesn't support stop/start

September 27, 2008, at 05:48 PM by ciVic -- added new disk
Added lines 492-499:
  • 27 Sep 2008
P:  Vendor=0c0b ProdID=b159 Rev= 1.03
S:  Manufacturer=Trekstor
S:  Product=DataStation maxi m.u
S:  SerialNumber=00DEBB3a

sg_start works

September 14, 2008, at 06:02 AM by bitbucket --
Changed lines 264-265 from:
"bitbucket says"
It's working with a Maxtor 300GB drive in a Antec MX-100 box, connected as sdb through a USB hub on Port 1. Drive spins back up when accessed. Thanks!
to:
bitbucket says
It's working with a Maxtor 300GB drive in a Antec MX-100 box, connected as sdb through a USB hub on Port 1. Drive spins back up when accessed. Thanks!
September 14, 2008, at 06:01 AM by bitbucket --
Added lines 264-265:
"bitbucket says"
It's working with a Maxtor 300GB drive in a Antec MX-100 box, connected as sdb through a USB hub on Port 1. Drive spins back up when accessed. Thanks!
September 01, 2008, at 12:42 AM by Marco -- url edit
Changed lines 320-321 from:

See http://nslu2-info.de/showpost.php?p=20987&postcount=42

to:

See http://nslu2-info.de/forum/showpost.php?p=20987&postcount=42

August 28, 2008, at 08:27 PM by klinker --
Changed lines 609-610 from:

S: Manufacturer=Prolific Technology Inc.<br> Chip: Prolific PL-2506<br>

to:
S:  Manufacturer=Prolific Technology Inc.
Chip: Prolific PL-2506<
Changed line 615 from:

P: Vendor=0471 ProdID?=200e Rev= 1.00

to:

[@P: Vendor=0471 ProdID?=200e Rev= 1.00

Changed line 617 from:

S: Product=Philips Harddisk

to:

S: Product=Philips Harddisk@]

August 28, 2008, at 08:25 PM by klinker -- philips hd added to list of working disks
Added lines 613-619:

28 August 2008

P: Vendor=0471 ProdID?=200e Rev= 1.00 S: Manufacturer=Philips S: Product=Philips Harddisk works well with hd-idle

August 22, 2008, at 09:01 AM by Fnord --
Added lines 686-693:

22 August 2008

  • Icy Box IB-351AStU-B
P:  Vendor=152d ProdID=2338 Rev= 1.0
S:  Manufacturer=JMicron
S:  Product=USB to ATA/ATAPI Bridge
  • Neither sdparm nor sg_start works.
August 22, 2008, at 07:30 AM by JonBoy --
Changed line 514 from:
  • 22 August 2008 by JonBoy?: WD CaviarŪ Blue SATA 500GB - WD5000AAKS in ICY BOX IB-351StUS-B (SATA to USB case)
to:
  • 22 August 2008 by JonBoy: WD CaviarŪ Blue SATA 500GB - WD5000AAKS in ICY BOX IB-351StUS-B (SATA to USB case)
Changed lines 516-517 from:

system: Linux Marius 2.6.21.7 #1 PREEMPT Mon Dec 24 23:12:24 UTC 2007 armv5teb unknown [@P: Vendor=04fc ProdID?=0c15 Rev=c5.bd

to:

[@system: Linux Marius 2.6.21.7 #1 PREEMPT Mon Dec 24 23:12:24 UTC 2007 armv5teb unknown

 P:   Vendor=04fc ProdID?=0c15 Rev=c5.bd
August 22, 2008, at 07:29 AM by JonBoy -- Added IcyBox / Western Digital HDD to list of working hardware
Added lines 514-522:
  • 22 August 2008 by JonBoy?: WD CaviarŪ Blue SATA 500GB - WD5000AAKS in ICY BOX IB-351StUS-B (SATA to USB case)

Works using sdparm --command=stop on slugOS 4.8 beta system: Linux Marius 2.6.21.7 #1 PREEMPT Mon Dec 24 23:12:24 UTC 2007 armv5teb unknown [@P: Vendor=04fc ProdID?=0c15 Rev=c5.bd

 S:  Manufacturer=Sunplus Technology Inc.
 S:  Product=USB to Serial-ATA bridge
 S:  SerialNumber?=WDC WD5000?     WD-WMAPW1137424?
August 08, 2008, at 02:29 PM by fcarolo -- fixed false wikilnks, typos
Changed line 676 from:
  • With "Maxtor 7 L250R0?". Tried hdparm, sdparm, sg_start
to:
  • With "Maxtor 7 L250R0". Tried hdparm, sdparm, sg_start
August 08, 2008, at 02:29 PM by fcarolo -- fixed false wikilnks, typos
Changed line 101 from:
  • 27.12.2007: Western Digital Elements 500 GB USB 2.0 / 3.5" (WDE1U5000?) spins down after a few minutes of inactivity on the NSLU2 as well as my desktop. Additionally I can use "sg_start --stop /dev/sda", "sdparm --command=stop /dev/sda" or "hd-idle -t sda" to spin it down anytime.
to:
  • 27.12.2007: Western Digital Elements 500 GB USB 2.0 / 3.5" (WDE1U5000) spins down after a few minutes of inactivity on the NSLU2 as well as my desktop. Additionally I can use "sg_start --stop /dev/sda", "sdparm --command=stop /dev/sda" or "hd-idle -t sda" to spin it down anytime.
Changed line 104 from:
  • 25.03.2008: Western Digital Elements (www.wdc.com), WD Elements external hard drive 500GB, USB 2.0, MDL:WD5000E035?-00, R/N:A5G?, S/N: WCASU0052829?, Formatet as EXT3? from NSLU2, Spin down automaticaly after a while without any setup or changes.
to:
  • 25.03.2008: Western Digital Elements (www.wdc.com), WD Elements external hard drive 500GB, USB 2.0, MDL:WD5000E035-00, R/N:A5G, S/N: WCASU0052829, Formated as EXT3 from NSLU2, Spin down automaticaly after a while without any setup or changes.
Changed lines 132-133 from:

2008-05-01: I have a WD My Elements 250Gb drive. I have tried several times using instructions on this page, but it would never spin down. At last i wrote to WD. The answer form WD customer service and support was: "WD MyBook? drives are the only externals we make with automatic spin down functionality. We did not implement that feature in our Passports and Elements drives." The answer seems to be in contrary to the expieriences listed above.

to:

2008-05-01: I have a WD My Elements 250Gb drive. I have tried several times using instructions on this page, but it would never spin down. At last i wrote to WD. The answer form WD customer service and support was: "WD MyBook drives are the only externals we make with automatic spin down functionality. We did not implement that feature in our Passports and Elements drives." The answer seems to be in contrary to the expieriences listed above.

Changed lines 500-501 from:

Thermaltake MAX 4 N0003US - Same chipset as the ICY BOX described underneath; worked just fine with sdparm from NSLU2. HDD used was a Samsung HD501LJ?

to:

Thermaltake MAX 4 N0003US - Same chipset as the ICY BOX described underneath; worked just fine with sdparm from NSLU2. HDD used was a Samsung HD501LJ

Changed line 655 from:
  • 2008/01/29: no way to power down the disk (Hitachi HTS541640J9SA00?); tried sdparm and other methods, always got an error message.
to:
  • 2008/01/29: no way to power down the disk (Hitachi HTS541640J9SA00); tried sdparm and other methods, always got an error message.
Changed lines 666-669 from:
  • Logilink UA0040? enclosure for 2,5" disks

http://www.logilink.org/showproduct/UA0040.htm S: Manufacturer=Moai Electronics Corp.<br> Chip: Moai M110E?.<br>

to:
  • Logilink UA0040 enclosure for 2,5" disks http://www.logilink.org/showproduct/UA0040.htm
S:  Manufacturer=Moai Electronics Corp.
Chip: Moai M110E.
August 06, 2008, at 02:20 PM by sluggy -- 067b:2507 PL2507
Changed lines 556-558 from:
  • Iomega Hi-Speed USB 2.0 Desktop Hard Drive (250 Gbyte) uses the Prolific PL-2506 chipset and supports start/stop nicely. (Power consumption active 9W, standby 2W).

[@ P: Vendor=067b ProdID?=2507 Rev= 0.00

to:
  • Iomega Hi-Speed USB 2.0 Desktop Hard Drive (250 Gbyte) uses the Prolific PL-2507 chipset and supports start/stop nicely. (Power consumption active 9W, standby 2W).

[@ P: Vendor=067b ProdID?=2507 Rev= 0.00

Changed lines 561-564 from:

S: Product=PL-2506 USB Storage Device S: SerialNumber?=0620000022C5@]

to:

S: Product=PL-2507 USB Storage Device S: SerialNumber?=0620000022C5 Every Disk with a PL2507? should support spindown via scsi command with at least sg_start --stop @]

July 17, 2008, at 09:32 AM by MicRo --
Changed lines 253-254 from:
Comment by Paul
: Although promising and elegant solution, in contrast with Ben this does not seem to work with my Iomega-USB 500GB on Port 1 (Iomega MDHD500-UE)
to:
Comment by Paul
Although promising and elegant solution, in contrast with Ben this does not seem to work with my Iomega-USB 500GB on Port 1 (Iomega MDHD500-UE)
July 17, 2008, at 09:30 AM by MicRo --
Changed lines 249-250 from:
''Comment 2 by BenMcDui
Do *not* disconnect or switch off your disk in spun down state; your Slug gets confused and you may come into trouble as it does no longer recognise your HDD. Activate the HDD first, or power down your Slug (the disk then starts up first (to say goodbye or so?)).
to:
Comment 2 by BenMcDui
Do *not* disconnect or switch off your disk in spun down state; your Slug gets confused and you may come into trouble as it does no longer recognise your HDD. Activate the HDD first, or power down your Slug (the disk then starts up first (to say goodbye or so?)).
Changed lines 255-258 from:

BenMcDui asks : Paul, is your disk ext3, fat, ntfs?

''Paul says
It's an ext3. Sorry for providing incomplete information.
to:
BenMcDui asks
Paul, is your disk ext3, fat, ntfs?
Paul says
It's an ext3. Sorry for providing incomplete information.
July 17, 2008, at 09:28 AM by MicRo --
Changed lines 247-261 from:

Comment by BenMcDui: Vladimir, this works very well on my Iomega-USB 500GB on Port 1. Spassiba!

Comment 2 by BenMcDui: Do *not* disconnect or switch off your disk in spun down state; your Slug gets confused and you may come into trouble as it does no longer recognise your HDD. Activate the HDD first, or power down your Slug (the disk then starts up first (to say goodbye or so?)).

Comment 3 by BenMcDui: It DOES work on an ext3 disk, but NOT on an fat disk. Vladimir, any idea, could you expand your explanation a bit, how does your method compare to the other methods on this page?

Comment by Paul: Although promising and elegant solution, in contrast with Ben this does not seem to work with my Iomega-USB 500GB on Port 1 (Iomega MDHD500-UE)

BenMcDui asks: Paul, is your disk ext3, fat, ntfs?

Paul says: It's an ext3. Sorry for providing incomplete information.

BenMcDui says: I have discovered that it only works under the condition that you boot the Slug, and *only* after bootup, connect the disk.

[TheRookie] Works with Buffalo DriveStation 500GB connected as sdb via USB Hub. After 5 minutes (300 seconds, as specified), the disk clicks and goes to standby mode.\\

to:
Comment by BenMcDui
Vladimir, this works very well on my Iomega-USB 500GB on Port 1. Spassiba!
''Comment 2 by BenMcDui
Do *not* disconnect or switch off your disk in spun down state; your Slug gets confused and you may come into trouble as it does no longer recognise your HDD. Activate the HDD first, or power down your Slug (the disk then starts up first (to say goodbye or so?)).
Comment 3 by BenMcDui
It DOES work on an ext3 disk, but NOT on an fat disk. Vladimir, any idea, could you expand your explanation a bit, how does your method compare to the other methods on this page?
Comment by Paul
: Although promising and elegant solution, in contrast with Ben this does not seem to work with my Iomega-USB 500GB on Port 1 (Iomega MDHD500-UE)

BenMcDui asks : Paul, is your disk ext3, fat, ntfs?

''Paul says
It's an ext3. Sorry for providing incomplete information.
BenMcDui says
I have discovered that it only works under the condition that you boot the Slug, and *only* after bootup, connect the disk.
[TheRookie]
Works with Buffalo DriveStation 500GB connected as sdb via USB Hub. After 5 minutes (300 seconds, as specified), the disk clicks and goes to standby mode.\\
July 17, 2008, at 09:22 AM by MicRo --
Changed line 597 from:

http://www.reichelt.de/?;ACTION=3;LA=4;GROUP=EA4;GROUPID=750;ARTICLE=63681;START=0;SORT=artnr;OFFSET=16;SID=310qQeL6wQAR8AAHgm9hUff56a105b30073689c4969d94b3e8eca

to:

http://www.reichelt.de/?;ACTION=3;LA=4;GROUP=EA4;GROUPID=750;ARTICLE=63681;START=0;SORT=artnr;OFFSET=16

July 17, 2008, at 09:16 AM by MicRo --
Changed lines 253-255 from:

Comment by Paul: Although promising and elegant solution, in contrast with Ben this does not seem to work with my Iomega-USB 500GB on Port 1 (Iomega MDHD500-UE)

by 'BenMcDui?: Paul, is your disk ext3, fat, ntfs?

to:

Comment by Paul: Although promising and elegant solution, in contrast with Ben this does not seem to work with my Iomega-USB 500GB on Port 1 (Iomega MDHD500-UE)

BenMcDui asks: Paul, is your disk ext3, fat, ntfs?

Changed lines 261-263 from:

[TheRookie?] Works with Buffalo DriveStation 500GB connected as sdb via USB Hub. After 5 minutes (300 seconds, as specified), the disk clicks and goes to standby mode. Does not work for Seagate ST3500630AS? installed into Icy-Box IB351U?-BL. This is connected as sde to the same USB Hub.

to:

[TheRookie] Works with Buffalo DriveStation 500GB connected as sdb via USB Hub. After 5 minutes (300 seconds, as specified), the disk clicks and goes to standby mode.
Does not work for Seagate ST3500630AS installed into Icy-Box IB351U-BL. This is connected as sde to the same USB Hub.

June 23, 2008, at 08:33 PM by Karl --
Changed lines 105-106 from:
  • 24.06.2008: Welland GreenStar enclosure spins down after 3 minutes and powers off after another 2 minutes. (Any hard drive should behave similarly but tested with Samsung HD321KJ?.)
to:
  • 24.06.2008: Welland GreenStar enclosure spins down after 3 minutes and powers off after another 2 minutes. (Any hard drive should behave similarly but tested with Samsung HD321KJ.)
June 23, 2008, at 08:28 PM by Karl -- Welland Greenstar
Changed lines 105-106 from:
to:
  • 24.06.2008: Welland GreenStar enclosure spins down after 3 minutes and powers off after another 2 minutes. (Any hard drive should behave similarly but tested with Samsung HD321KJ?.)
June 04, 2008, at 04:51 PM by TheRookie --
Changed lines 260-261 from:
to:

Does not work for Seagate ST3500630AS? installed into Icy-Box IB351U?-BL. This is connected as sde to the same USB Hub.

June 04, 2008, at 03:47 PM by TheRookie --
Added lines 259-260:

[TheRookie?] Works with Buffalo DriveStation 500GB connected as sdb via USB Hub. After 5 minutes (300 seconds, as specified), the disk clicks and goes to standby mode.

May 01, 2008, at 06:18 PM by njr -- Added comment re WD disks without support for spindown
Added lines 131-132:

2008-05-01: I have a WD My Elements 250Gb drive. I have tried several times using instructions on this page, but it would never spin down. At last i wrote to WD. The answer form WD customer service and support was: "WD MyBook? drives are the only externals we make with automatic spin down functionality. We did not implement that feature in our Passports and Elements drives." The answer seems to be in contrary to the expieriences listed above.

April 28, 2008, at 09:31 PM by craigpratt -- Added VanTec CB-ISATAU2 to adapters_whith_support_not_ok list
Changed lines 635-637 from:
  • [name??]

[@P: Vendor=152d ProdID?=2339

to:
  • VanTec CB-ISATAU2

[@P: Vendor=152d ProdID?=2338 Rev= 1.00

Added lines 639-644:
  • 2008/04/01: Could not spin down a variety of drives with "sdparm --command=stop".
  • [name??]
P:  Vendor=152d ProdID=2339 
S:  Manufacturer=JMicron
S:  Product=USB to ATA/ATAPI Bridge
Added line 649:
April 16, 2008, at 06:43 AM by emmis --
Added line 358:
Changed lines 368-369 from:
to:
Added line 371:
Added line 378:
Changed lines 386-389 from:

Note: It seems to be overkill to move all of /var to RAM. It may be better to follow the instructions above, and handle the remaining offending processes one by one. Also, if you use udev (like Debian does) then /dev is no longer on disk.

Debianslug: The script works with debianslug so long as you uncomment the highlighted line (devpts needs to be remounted otherwise on login ssh can not start a shell giving a 'Server refused to allocate pty' error). The script only copies /dev and /var/log but you would do well to tweak /etc/syslog.conf and /etc/logrotate* to be as economical as possible.

to:

Note: It seems to be overkill to move all of /var to RAM. It may be better to follow the instructions above, and handle the remaining offending processes one by one. Also, if you use udev (like Debian does) then /dev is no longer on disk. See above for the built in method for Debian to move /var.

Debianslug: See above. For historic interest the script below works with debianslug so long as you uncomment the highlighted line (devpts needs to be remounted otherwise on login ssh can not start a shell giving a 'Server refused to allocate pty' error). The script only copies /dev and /var/log but you would do well to tweak /etc/syslog.conf and /etc/logrotate* to be as economical as possible.

April 16, 2008, at 06:29 AM by emmis -- mnbd spins up the disc
Changed lines 366-367 from:

]@

to:

@]

April 16, 2008, at 06:28 AM by emmis -- nmbd spins disc up
Changed line 11 from:
to:
Added lines 19-20:

First you need to get a hard disc to spindown (the easiest way is to buy a disc which spins down itself). Second you need to tweak/add various system files to reduce disk access.

Changed lines 356-357 from:
  • [Unslung] Cron runs an hourly syncronization of the system clock (hwclock) and three times a day it checks if the disk is full. Whenever cron executes a job it is logged in /var/log/messages, which causes the disk to spin up. Since these jobs are not vital for your slug, you can avoid this spin up by editing /etc/crontab so the jobs are only run once a day. These lines in crontab will run hwclock and CheckDiskFull once a day (at midnight):
to:
  • Change nmbd (a samba process) so that is is *not* a local master. In the file /etc/samba/smb.conf add these lines to the [global] section:
Added lines 359-370:
  1. disable local master provision so that nmbd doesn't spin up disk
  2. preferred master = yes # previous setting

preferred master = no domain master = no local master = no os level = 0 ]@

  • [Unslung] Cron runs an hourly syncronization of the system clock (hwclock) and three times a day it checks if the disk is full. Whenever cron executes a job it is logged in /var/log/messages, which causes the disk to spin up. Since these jobs are not vital for your slug, you can avoid this spin up by editing /etc/crontab so the jobs are only run once a day. These lines in crontab will run hwclock and CheckDiskFull once a day (at midnight):

[@

March 25, 2008, at 05:21 PM by japping -- Automaticaly spin down of USB Harddisk.
Changed lines 102-103 from:
to:
  • 25.03.2008: Western Digital Elements (www.wdc.com), WD Elements external hard drive 500GB, USB 2.0, MDL:WD5000E035?-00, R/N:A5G?, S/N: WCASU0052829?, Formatet as EXT3? from NSLU2, Spin down automaticaly after a while without any setup or changes.
March 16, 2008, at 10:55 PM by espen at gyfgafgufdk -- Notice on installing scsi-idle
Changed lines 130-131 from:

Robert Demski provided a kernel patch as well as a user-space package to be used on the slug. See also this blog post. (The scsi-idle patch is now included in the SlugOS kernels.)

to:

Robert Demski provided a kernel patch as well as a user-space package to be used on the slug. Install the scsi-idle package to use this method. See also this blog post. (The scsi-idle patch is now included in the SlugOS kernels.)

March 16, 2008, at 10:49 PM by espen at gyfgafgufdk -- Install the scsi-idle package as it says above
Deleted lines 229-242:

BenMcDui: HELP NEEDED: In Unslung 6.3, there is no such command as:

scsi-stop

This is what I get when I try it:

# scsi-stop /dev/sdb

scsi-stop: No such file or directory

I have tried to locate the file anywhere on the system to no avail.

Has anyone got an idea where to find it or how to install it?

March 07, 2008, at 04:10 PM by tw --
Changed lines 656-657 from:

S: Product=USB2?.0 Storage Device]

to:

S: Product=USB2?.0 Storage Device@]

  • With "Maxtor 7 L250R0?". Tried hdparm, sdparm, sg_start
March 07, 2008, at 04:08 PM by tw --
Changed lines 652-656 from:
to:

7 March 2008

  • Icy Box IB-351U with

[@P: Vendor=04b4 ProdID?=6830 Rev= 0.01 S: Manufacturer=Cypress Semiconductor S: Product=USB2?.0 Storage Device]

March 04, 2008, at 01:30 PM by heinrichh --
Changed lines 586-587 from:

Chip: Prolific PL-2506

to:

S: Manufacturer=Prolific Technology Inc.<br> Chip: Prolific PL-2506<br>

Changed lines 648-649 from:

Chip: Moai M110E?

to:

S: Manufacturer=Moai Electronics Corp.<br> Chip: Moai M110E?.<br>

March 04, 2008, at 01:24 PM by heinrichh --
Changed lines 583-588 from:
to:

4 March 2008

  • Evertech enclosure for 2,5" disks

http://www.reichelt.de/?;ACTION=3;LA=4;GROUP=EA4;GROUPID=750;ARTICLE=63681;START=0;SORT=artnr;OFFSET=16;SID=310qQeL6wQAR8AAHgm9hUff56a105b30073689c4969d94b3e8eca Chip: Prolific PL-2506 works well with hd-idle.

Added lines 644-650:

4 March 2008

  • Logilink UA0040? enclosure for 2,5" disks

http://www.logilink.org/showproduct/UA0040.htm Chip: Moai M110E? Looks nice but does not support any of the methods mentioned above, despite of the fact that the chip has a suspend state itself, regarding or not regarding the state of the disk...

February 21, 2008, at 03:30 PM by Rutger -- Added succes status for sdparm/wdc
Added lines 478-486:
  • 21 Feb 2008 by Rutger
P:  Vendor=067b ProdID=2506 Rev= 1.00
S:  Manufacturer=Prolific Technology Inc.
S:  Product=Mass Storage Device
S:  SerialNumber=0
Holding a WDC WD25  Model: 00AAJB-00WGA0 Rev: 00.0 in an eMagic USB2/IDE housing
sdparm --command=stop /dev/sdX works perfect
February 20, 2008, at 06:42 PM by BenMcDui --
Added line 237:
February 20, 2008, at 06:41 PM by BenMcDui --
Deleted line 236:
February 20, 2008, at 06:40 PM by BenMcDui -- layout improved
Changed lines 236-238 from:

''# scsi-stop /dev/sdb scsi-stop: No such file or directory''

to:

# scsi-stop /dev/sdb

scsi-stop: No such file or directory

February 20, 2008, at 06:39 PM by BenMcDui -- layout improved
Changed lines 231-232 from:

''scsi-stop

to:

scsi-stop

Added line 235:
Changed lines 237-238 from:

''scsi-stop: No such file or directory

to:

scsi-stop: No such file or directory''

February 20, 2008, at 06:38 PM by BenMcDui -- added question at the end of chapter \"Shell-only scsi-idle without kernel patch\"
Changed lines 230-237 from:

BenMcDui: HELP NEEDED: With Unslung, /proc/stat contains a line like:

disk_io: (8,0):(214370,140641,3248076,73729,962988) (8,1):(150790,136301,7670518,14489,204946)

I have figured out that I need to isolate the figure (or the rest of the line) directly after (8,1), which tells me about the activity on dev/sdb, being the HDD I want to spin down. Has anybody got a suggestion as to how to do this? Preferrably as a perl script language command/construct?

to:

BenMcDui: HELP NEEDED: In Unslung 6.3, there is no such command as: ''scsi-stop

This is what I get when I try it: ''# scsi-stop /dev/sdb ''scsi-stop: No such file or directory I have tried to locate the file anywhere on the system to no avail.

Has anyone got an idea where to find it or how to install it?

February 19, 2008, at 09:54 AM by Florian Bomers -- formatting
Changed lines 622-623 from:

This nice looking external USB drive does not support any of the presented methods for spinning down.

to:
  • 2008/02/19: This nice looking external USB drive does not support any of the presented methods for spinning down.
February 19, 2008, at 09:53 AM by Florian Bomers -- formatting
Changed line 613 from:

S: Product=USB to ATA/ATAPI Bridge

to:

S: Product=USB to ATA/ATAPI Bridge@]

Changed line 619 from:

P: Vendor=152d ProdID?=2339 Rev= 1.00

to:

[@P: Vendor=152d ProdID?=2339 Rev= 1.00

Changed line 621 from:

S: Product=USB to ATA/ATAPI Bridge

to:

S: Product=USB to ATA/ATAPI Bridge@]

February 19, 2008, at 09:51 AM by Florian Bomers -- Added TEAC external drive
Added lines 618-623:
  • TEAC HD-15PUK-B-200

P: Vendor=152d ProdID?=2339 Rev= 1.00 S: Manufacturer=JMicron? S: Product=USB to ATA/ATAPI Bridge This nice looking external USB drive does not support any of the presented methods for spinning down.

February 19, 2008, at 04:12 AM by Vlad Petric -- Add entry for Thermaltake MAX 4
Added lines 472-474:
  • 18 Feb 2008 by `Impaler:

Thermaltake MAX 4 N0003US - Same chipset as the ICY BOX described underneath; worked just fine with sdparm from NSLU2. HDD used was a Samsung HD501LJ?

February 17, 2008, at 06:46 PM by BenMcDui -- Added response
Added lines 260-261:

BenMcDui says: I have discovered that it only works under the condition that you boot the Slug, and *only* after bootup, connect the disk.

February 04, 2008, at 08:32 PM by fcarolo -- removed false wikilink
Changed lines 559-560 from:
edit: it doesn't work for my LaCie? 500 with SEAGATE ST3500830A?, either with sdparm or sg_start. No reaction...
to:
edit: it doesn't work for my LaCie 500 with SEAGATE ST3500830A, either with sdparm or sg_start. No reaction...
January 31, 2008, at 06:31 PM by pascal -- correction on LaCie 500
Changed lines 559-560 from:
to:
edit: it doesn't work for my LaCie? 500 with SEAGATE ST3500830A?, either with sdparm or sg_start. No reaction...
January 30, 2008, at 10:09 AM by marc --
Changed lines 101-102 from:
  • 30.01.2008: Seagate FreeAgent? Pro 750 GB comes with a pre-defined spindown of 5 minutes. The Seagate Tools allow to change this time - but only when connected directly to a Windows Box.
to:
  • 30.01.2008: Seagate Freeagent Pro 750 GB comes with a pre-defined spindown of 5 minutes. The Seagate Tools allow to change this time - but only when connected directly to a Windows Box, and the drive doesn't remember the settings itself: when connecting it to another computer it reverts to 5 minutes.
January 30, 2008, at 10:06 AM by marc -- added Seagate FreeAgent Pro 750 GB
Changed lines 101-102 from:
to:
  • 30.01.2008: Seagate FreeAgent? Pro 750 GB comes with a pre-defined spindown of 5 minutes. The Seagate Tools allow to change this time - but only when connected directly to a Windows Box.
January 28, 2008, at 11:10 PM by jj goessens --
Changed lines 603-604 from:
  • Fantec LD-U35US

[@P: Vendor=152d ProdID?=2339 Rev= 1.00

to:
  • [name??]

[@P: Vendor=152d ProdID?=2339

January 28, 2008, at 11:09 PM by jj goessens -- add 152d:2339 device
Added lines 603-610:
  • Fantec LD-U35US

[@P: Vendor=152d ProdID?=2339 Rev= 1.00 S: Manufacturer=JMicron? S: Product=USB to ATA/ATAPI Bridge found in a 2.5" USB to SATA enclosure. only supports SATA disks.

  • 2008/01/29: no way to power down the disk (Hitachi HTS541640J9SA00?); tried sdparm and other methods, always got an error message.

JJ

January 28, 2008, at 04:55 PM by Jonathan Cohen --
January 28, 2008, at 04:55 PM by Jonathan Cohen --
Changed lines 3-4 from:

Warning: As described here, most disks do not tolerate a large number of spinups.

to:

Warning: As described here, most disks do not tolerate a large number of spinups. So you may not want to spin down if spinups will be more than every hour or so.

January 28, 2008, at 04:52 PM by Jonathan Cohen --
Changed lines 122-123 from:

Firmware Version: V2.3R63-uNSLUng-6.8-beta with Western digital 500GB Essential model formatted as NTFS. Automatically spins down in about 10 minutes.

to:
  • Firmware Version: V2.3R63-uNSLUng-6.8-beta with Western digital 500GB Essential model formatted as NTFS. Automatically spins down in about 10 minutes.
Changed lines 125-126 from:

Firmware: uNSLUng-6.10-beta. Unslung to Western Digital 1TB MyBook Essential on Port2. Spins down after 10 minutes using scripts from SetSpinDownTimeOnMaxtorOneTouch (with "return 1" uncommented and killall modifications).

to:
  • Firmware: uNSLUng-6.10-beta. Unslung to Western Digital 1TB MyBook Essential on Port2. Spins down after 10 minutes using scripts from SetSpinDownTimeOnMaxtorOneTouch (with "return 1" uncommented and killall modifications).
January 28, 2008, at 04:50 PM by Jonathan Cohen --
Changed lines 81-82 from:

For Maxtor OneTouch drives (also for Western Digital MyBook? drives) see the Maxtor OneTouch HOWTO.

to:

For Maxtor OneTouch drives (also for Western Digital MyBook drives) see the Maxtor OneTouch HOWTO.

Changed lines 125-126 from:

Firmware: uNSLUng-6.10-beta. Unslung to Western Digital 1TB MyBook? Essential on Port2. Spins down after 10 minutes using scripts from SetSpinDownTimeOnMaxtorOneTouch (with "return 1" uncommented and killall modifications).

to:

Firmware: uNSLUng-6.10-beta. Unslung to Western Digital 1TB MyBook Essential on Port2. Spins down after 10 minutes using scripts from SetSpinDownTimeOnMaxtorOneTouch (with "return 1" uncommented and killall modifications).

January 28, 2008, at 04:46 PM by Jonathan Cohen -- (oops -- still learning editing conventions -- preview doesn\\
Changed lines 81-82 from:

For Maxtor OneTouch drives (also for Western Digital MyBook drives) see the Maxtor OneTouch HOWTO.

to:

For Maxtor OneTouch drives (also for Western Digital MyBook? drives) see the Maxtor OneTouch HOWTO.

Changed lines 125-126 from:

Firmware: uNSLUng-6.10-beta. Unslung to Western Digital 1TB MyBook? Essential on Port2. Spins down after 10 minutes using scripts from [[SetSpinDownTimeOnMaxtorOneTouch|Maxtor OneTouch HOWTO] (with return 1 uncommented and killall modifications).

to:

Firmware: uNSLUng-6.10-beta. Unslung to Western Digital 1TB MyBook? Essential on Port2. Spins down after 10 minutes using scripts from SetSpinDownTimeOnMaxtorOneTouch (with "return 1" uncommented and killall modifications).

January 28, 2008, at 04:43 PM by Jonathan Cohen -- recent experience on WD MyBook
Changed lines 81-82 from:

For Maxtor OneTouch drives see the Maxtor OneTouch HOWTO.

to:

For Maxtor OneTouch drives (also for Western Digital MyBook drives) see the Maxtor OneTouch HOWTO.

Added lines 124-126:

2008-01-28 Firmware: uNSLUng-6.10-beta. Unslung to Western Digital 1TB MyBook? Essential on Port2. Spins down after 10 minutes using scripts from [[SetSpinDownTimeOnMaxtorOneTouch|Maxtor OneTouch HOWTO] (with return 1 uncommented and killall modifications).

January 16, 2008, at 08:10 AM by PaulBrandt -- answered a question directed to me
Changed lines 254-255 from:
to:

Paul says: It's an ext3. Sorry for providing incomplete information.

January 14, 2008, at 02:55 PM by fcarolo -- formatting
Changed lines 469-470 from:
 S:  Serialnumber=100
to:
 S:  Serialnumber=100@]
January 13, 2008, at 09:38 PM by KenP -- Pointing out the lack of sysctl in recent BusyBox implementations
Changed lines 386-387 from:
to:
  1. From KenP?: doesn't work on V2.3R63-uNSLUng-6.10-beta either, I think it fell out of BusyBox? somewhere along the road...
January 12, 2008, at 07:02 PM by frapex -- fix layout
Changed lines 464-465 from:
  • 12 Jan 2008

No-Name / Myson Century, Inc (board: uf-3501). Seems to offer a Prolific PL3507?. Drive spinsdown with 'sg_start 0 --pc=3 /dev/sdd'

to:
  • 12 Jan 2008: No-Name / Myson Century, Inc (board: uf-3501). Seems to offer a Prolific PL3507?. Drive spinsdown with 'sg_start 0 --pc=3 /dev/sdd'
January 12, 2008, at 07:01 PM by frapex --
Added lines 464-470:
  • 12 Jan 2008

No-Name / Myson Century, Inc (board: uf-3501). Seems to offer a Prolific PL3507?. Drive spinsdown with 'sg_start 0 --pc=3 /dev/sdd' [@P: Vendor ID=04cf Product ID=8818 Revision=b0.07

 S:  Manufacturer=Myson Century, Inc.
 S:  Product=USB Mass Storage Device
 S:  Serialnumber=100
January 09, 2008, at 05:03 PM by BenMcDui -- respons eto Paul
Added lines 253-254:

by 'BenMcDui?: Paul, is your disk ext3, fat, ntfs?

January 09, 2008, at 01:10 PM by Simula77 -- Added info about successful spin down with WD Elements 320 GB
Changed lines 100-101 from:
to:
  • 08.01.2008: Western Digital Elements 320 GB USB 2.0 / 3.5" spins down successfully on Unslung 6.8 beta.
December 27, 2007, at 04:35 PM by anonymous -- Added Fantec adapter
Changed lines 582-588 from:
to:
  • Fantec LD-U35US
P:  Vendor=152d ProdID=2338 Rev= 1.00
S:  Manufacturer=OTB-HDD-NT68320
S:  Product=USB Mass Storage
  • 2007/12/27: found no way to power down any IDE disk in this enclosure. Tried Maxtor, Quantum and Seagate with sg_start, sdparm and hd-idle (all of these three commands work with my other USB disk). The adapter also supports SATA drives but I didn't have one for testing.
December 27, 2007, at 04:25 PM by anonymous -- Added Western Digital Elements to disks that spin down themselves
Changed lines 99-100 from:
to:
  • 27.12.2007: Western Digital Elements 500 GB USB 2.0 / 3.5" (WDE1U5000?) spins down after a few minutes of inactivity on the NSLU2 as well as my desktop. Additionally I can use "sg_start --stop /dev/sda", "sdparm --command=stop /dev/sda" or "hd-idle -t sda" to spin it down anytime.
December 12, 2007, at 01:53 PM by fcarolo -- fixed false wikilinks
Changed lines 249-250 from:

Comment by Paul: Although promising and elegant solution, in contrast with Ben this does not seem to work with my Iomega-USB 500GB on Port 1 (Iomega MDHD500?-UE)

to:

Comment by Paul: Although promising and elegant solution, in contrast with Ben this does not seem to work with my Iomega-USB 500GB on Port 1 (Iomega MDHD500-UE)

Changed line 319 from:

My Western Digital WD25? drive has definitely NO AdvancedPM?(i tried it with connecting it via IDE before.).

to:

My Western Digital WD25 drive has definitely NO AdvancedPM(i tried it with connecting it via IDE before.).

December 11, 2007, at 09:32 PM by PaulBrandt --
Changed lines 304-305 from:
  Type: LaCie? 250 GB Vendor: SEAGATE   Model: ST3250823A?  Rev: 3.03 @]
to:
  Type: LaCie? 250 GB Vendor: SEAGATE   Model: ST3250823A?  Rev: 3.03 

@]

Changed lines 316-317 from:
to:

@]

December 11, 2007, at 09:30 PM by PaulBrandt --
Changed lines 249-250 from:

Comment by Paul: Although promising and elegant solution, in contrast with Ben this does not seem to work with my Iomega-USB 500GB on Port 1 (Iomega MDHD500?-UE)

to:

Comment by Paul: Although promising and elegant solution, in contrast with Ben this does not seem to work with my Iomega-USB 500GB on Port 1 (Iomega MDHD500?-UE)

December 11, 2007, at 09:21 PM by PaulBrandt -- Spindown deamon by Vladimir - doesn\'t work with Iomega MDHD500-UE so it seems
Added lines 249-250:

Comment by Paul: Although promising and elegant solution, in contrast with Ben this does not seem to work with my Iomega-USB 500GB on Port 1 (Iomega MDHD500?-UE)

December 05, 2007, at 04:10 PM by asys3 -- Another usb harddisk combination that works with sg3-utils
Added lines 306-322:

by asys3

  [@ Chili USb? 250 GB works fine with sg3-utils:

  Vendor: USBDisk?   Model: RunDisk?           Rev: 1.00
  Type:   Direct-Access                      ANSI SCSI revision: 02
  Vendor: WDC WD25?  Model: 00BB-00RDA0       Rev: 0000
  Type:   Direct-Access                      ANSI SCSI revision: 00

I tried everything before and nearly gave up. My Western Digital WD25? drive has definitely NO AdvancedPM?(i tried it with connecting it via IDE before.). With sg3-utils it works out of the box. Wakes up after any access and spins down, when calling the script above. Works fine here under Debian 4.0 NSLU2 Linux. The last thing for me is to write a cron job to execute the script above every XY minutes. Perhaps anyone can insert a cron job here - I don't know how to write a cron job (yet).

November 27, 2007, at 08:34 PM by BenMcDui --
Changed lines 224-225 from:
 BenMcDui: HELP NEEDED: With Unslung, /proc/stat contains a line like:
to:

BenMcDui: HELP NEEDED: With Unslung, /proc/stat contains a line like:

[@

Changed lines 228-229 from:
to:

@]

November 27, 2007, at 08:32 PM by BenMcDui -- added request for help
Added lines 224-229:
 BenMcDui: HELP NEEDED: With Unslung, /proc/stat contains a line like:

disk_io: (8,0):(214370,140641,3248076,73729,962988) (8,1):(150790,136301,7670518,14489,204946)

I have figured out that I need to isolate the figure (or the rest of the line) directly after (8,1), which tells me about the activity on dev/sdb, being the HDD I want to spin down. Has anybody got a suggestion as to how to do this? Preferrably as a perl script language command/construct?

November 25, 2007, at 08:44 AM by Mangusta --
Changed lines 116-118 from:
  • 2007-11-02

Firmware Version: V2.3R63-uNSLUng-6.8-beta with Western digital 750gB Essential model WD7500c032: no problem about spin down of HD. It turns on/off automatically when needed.

to:

2007-11-02

  • Firmware Version: V2.3R63-uNSLUng-6.8-beta with Western digital 750GB Essential model WD7500c032: no problem about spin down of HD. It turns on/off automatically when needed.
November 25, 2007, at 08:43 AM by Mangusta --
Changed lines 116-117 from:
  • 2007-11-02 Firmware Version: V2.3R63-uNSLUng-6.8-beta with Western digital 750gB Essential model WD7500c032: no problem about spin down of HD. It turns on/off automatically when needed.
to:
  • 2007-11-02

Firmware Version: V2.3R63-uNSLUng-6.8-beta with Western digital 750gB Essential model WD7500c032: no problem about spin down of HD. It turns on/off automatically when needed.

November 24, 2007, at 02:40 PM by BenMcDui -- typograpic
Changed lines 238-239 from:

''Comment 3 by BenMcDui: It DOES work on an ext3 disk, but NOT on an fat disk. Vladimir, any idea, could you expand your explanation a bit, how does your method compare to the other methods on this page?

to:

Comment 3 by BenMcDui: It DOES work on an ext3 disk, but NOT on an fat disk. Vladimir, any idea, could you expand your explanation a bit, how does your method compare to the other methods on this page?

November 24, 2007, at 02:39 PM by BenMcDui -- typographic
Changed lines 238-239 from:

''Comment 3 by 'BenMcDui?: It DOES work on an ext3 disk, but NOT on an fat disk. Vladimir, any idea, could you expand your explanation a bit, how does your method compare to the other methods on this page?

to:

''Comment 3 by BenMcDui: It DOES work on an ext3 disk, but NOT on an fat disk. Vladimir, any idea, could you expand your explanation a bit, how does your method compare to the other methods on this page?

November 24, 2007, at 02:38 PM by BenMcDui -- added Comment 3 to \"Spindown daemon without kernel patch for Unslung\"
Added lines 238-239:

''Comment 3 by 'BenMcDui?: It DOES work on an ext3 disk, but NOT on an fat disk. Vladimir, any idea, could you expand your explanation a bit, how does your method compare to the other methods on this page?

November 24, 2007, at 02:34 PM by BenMcDui -- added Comment 3 to \"Spindown daemon without kernel patch for Unslung\"
November 19, 2007, at 05:32 PM by vivekv -- Added my WD
Changed lines 118-120 from:
to:

2007-11-19 Firmware Version: V2.3R63-uNSLUng-6.8-beta with Western digital 500GB Essential model formatted as NTFS. Automatically spins down in about 10 minutes.

November 19, 2007, at 04:39 PM by fcarolo -- formatting
Changed lines 232-233 from:

Comment by BenMcDui?: Vladimir, this works very well on my Iomega-USB 500GB on Port 1. Spassiba! Comment 2 by BenMcDui?: Do *not* disconnect or switch off your disk in spun down state; your Slug gets confused and you may come into trouble as it does no longer recognise your HDD. Activate the HDD first, or power down your Slug (the disk then starts up first (to say goodbye or so?)).

to:

Comment by BenMcDui: Vladimir, this works very well on my Iomega-USB 500GB on Port 1. Spassiba!

Comment 2 by BenMcDui: Do *not* disconnect or switch off your disk in spun down state; your Slug gets confused and you may come into trouble as it does no longer recognise your HDD. Activate the HDD first, or power down your Slug (the disk then starts up first (to say goodbye or so?)).

November 18, 2007, at 01:08 PM by BenMcDui -- added comment to \\\"Spindown daemon without kernel patch for Unslung\\\"
Added line 233:

Comment 2 by BenMcDui?: Do *not* disconnect or switch off your disk in spun down state; your Slug gets confused and you may come into trouble as it does no longer recognise your HDD. Activate the HDD first, or power down your Slug (the disk then starts up first (to say goodbye or so?)).

November 15, 2007, at 07:15 PM by BenMcDui -- Added comment/question to \\\"Spindown daemon without kernel patch for Unslung\\\"
Added line 232:

Comment by BenMcDui?: Vladimir, this works very well on my Iomega-USB 500GB on Port 1. Spassiba!

November 14, 2007, at 04:15 PM by fcarolo -- fixed false wikilinks
Changed line 422 from:
  • 14 Nov 2007 by BoehserWolf?: Seagate Barracuda 7200.10 Ultra ATA/100 750-GB Hard Drive ST3750640A in ICY BOX IB-351StUS2 (SATA to USB case) with "sg_start 0" at NSLU2. Same combination works fine at Unslung 6.8 with "Spindown daemon without kernel patch for Unslung by Vladimir" (see above).
to:
  • 14 Nov 2007 by BoehserWolf: Seagate Barracuda 7200.10 Ultra ATA/100 750-GB Hard Drive ST3750640A in ICY BOX IB-351StUS2 (SATA to USB case) with "sg_start 0" at NSLU2. Same combination works fine at Unslung 6.8 with "Spindown daemon without kernel patch for Unslung by Vladimir" (see above).
November 14, 2007, at 03:12 PM by BoehserWolf --
Changed lines 426-427 from:
to:
November 14, 2007, at 03:10 PM by BoehserWolf --
Changed lines 422-423 from:
  • 14 Nov 2007, BoehserWolf?: Seagate Barracuda 7200.10 Ultra ATA/100 750-GB Hard Drive ST3750640A in ICY BOX IB-351StUS2 (SATA to USB case) with "sg_start 0" at NSLU2. Same combination works fine at Unslung 6.8 with "Spindown daemon without kernel patch for Unslung by Vladimir" (see above).

[@ P: Vendor=04fc ProdID?=0c15 Rev=ec.02

to:
  • 14 Nov 2007 by BoehserWolf?: Seagate Barracuda 7200.10 Ultra ATA/100 750-GB Hard Drive ST3750640A in ICY BOX IB-351StUS2 (SATA to USB case) with "sg_start 0" at NSLU2. Same combination works fine at Unslung 6.8 with "Spindown daemon without kernel patch for Unslung by Vladimir" (see above).

[@P: Vendor=04fc ProdID?=0c15 Rev=ec.02

Changed line 429 from:

[@ P: Vendor=0d49 ProdID?=3200 Rev=0.01

to:

[@P: Vendor=0d49 ProdID?=3200 Rev=0.01

November 14, 2007, at 03:07 PM by BoehserWolf --
Added lines 422-427:
  • 14 Nov 2007, BoehserWolf?: Seagate Barracuda 7200.10 Ultra ATA/100 750-GB Hard Drive ST3750640A in ICY BOX IB-351StUS2 (SATA to USB case) with "sg_start 0" at NSLU2. Same combination works fine at Unslung 6.8 with "Spindown daemon without kernel patch for Unslung by Vladimir" (see above).

[@ P: Vendor=04fc ProdID?=0c15 Rev=ec.02

 S:  Manufacturer=Sunplus Technology Inc.
 S:  Product=USB to Serial-ATA bridge
 S:  SerialNumber?=ST3750640A?]
November 07, 2007, at 07:25 PM by fcarolo -- fixed false wikilinks
Changed lines 116-118 from:
  • 2007-11-02 Firmware Version: V2.3R63-uNSLUng-6.8-beta with Western digital 750gB Essential model WD7500c032?: no problem about spin down of HD. It turns on/off automatically when needed.
to:
  • 2007-11-02 Firmware Version: V2.3R63-uNSLUng-6.8-beta with Western digital 750gB Essential model WD7500c032: no problem about spin down of HD. It turns on/off automatically when needed.
Changed line 240 from:
       wget http://ftp.de.debian.org/debian/pool/main/s/sg3-utils/sg3-utils_1.08.orig.tar.gz
to:
       wget http://ftp.de.debian.org/debian/pool/main/s/sg3-utils/sg3-utils_1.08.orig.tar.gz
Changed lines 498-502 from:
to:
  • LaCie 500 designed by Porsche when it is using a SEAGATE ST3500830A. It doesn't work when it comes with a Samsung HD501LJ.
  • Seagate FreeAgent 160 GB (2.5')
Changed lines 535-537 from:
  • LaCie? 500 designed by Porsche, when this enclosure is using a Samsung HD501LJ?. It works fine when it is using a SEAGATE ST3500830A?
to:
  • LaCie 500 designed by Porsche, when this enclosure is using a Samsung HD501LJ. It works fine when it is using a SEAGATE ST3500830A
November 02, 2007, at 05:38 PM by Mangusta --
Changed lines 116-118 from:
  • Firmware Version: V2.3R63-uNSLUng-6.8-beta with Western digital 750gB Essential model WD7500c032?: no problem about spin down of HD. It turns on/off automatically when needed.

2007-11-02

to:
  • 2007-11-02 Firmware Version: V2.3R63-uNSLUng-6.8-beta with Western digital 750gB Essential model WD7500c032?: no problem about spin down of HD. It turns on/off automatically when needed.
November 02, 2007, at 05:20 PM by Mangusta --
Added line 115:
November 02, 2007, at 05:18 PM by Mangusta --
Changed lines 115-117 from:
  • Firmware Version: V2.3R63-uNSLUng-6.8-beta with Western digital 750gB no problem about spin down of HD it turns on/off automatically.

02-11-07

to:
  • Firmware Version: V2.3R63-uNSLUng-6.8-beta with Western digital 750gB Essential model WD7500c032?: no problem about spin down of HD. It turns on/off automatically when needed.

2007-11-02

November 02, 2007, at 05:16 PM by Mangusta --
Changed lines 115-117 from:
to:
  • Firmware Version: V2.3R63-uNSLUng-6.8-beta with Western digital 750gB no problem about spin down of HD it turns on/off automatically.

02-11-07

October 22, 2007, at 11:04 PM by stripwax -- Updated info: method4 works for OpenSlug/Be
Changed line 9 from:
to:
Changed lines 27-28 from:
  • Method 4: Use sg_start [Debianslug]
to:
  • Method 4: Use sg_start [Debianslug, Openslug]
Changed lines 235-241 from:
to:

for OpenSlug get the source and make install locally using a native build environment

  e.g. download the tar.gz from here,
       wget http://ftp.de.debian.org/debian/pool/main/s/sg3-utils/sg3-utils_1.08.orig.tar.gz
       tar -xzvf sg3-utils_1.08.orig.tar.gz
       cd sg3-utils_1.08
       make install
September 19, 2007, at 03:03 PM by db353 --
Changed lines 13-14 from:
to:
Added line 494:

September 19, 2007, at 03:01 PM by db353 --
Changed lines 12-14 from:
to:
September 19, 2007, at 03:01 PM by db353 --
Changed lines 12-14 from:
to:
September 19, 2007, at 03:01 PM by db353 --
Changed lines 12-13 from:
to:
Added line 407:

Changed lines 488-489 from:
  • LaCie? 500 Designe by Porsche when it is using a SEAGATE ST3500830A?. It doesn't work when it comes with a Samsung HD501LJ?.
to:
  • LaCie? 500 designed by Porsche when it is using a SEAGATE ST3500830A?. It doesn't work when it comes with a Samsung HD501LJ?.
Changed lines 524-527 from:
  • LaCie? 500 designed by Porsche

When this enclosure is using a Samsung HD501LJ?. It works fine when it is using a SEAGATE ST3500830A?

to:
  • LaCie? 500 designed by Porsche, when this enclosure is using a Samsung HD501LJ?. It works fine when it is using a SEAGATE ST3500830A?
September 19, 2007, at 02:55 PM by db353 -- Add some adapters
Changed lines 486-490 from:
to:
Changed lines 522-525 from:
to:
  • LaCie? 500 designed by Porsche

When this enclosure is using a Samsung HD501LJ?. It works fine when it is using a SEAGATE ST3500830A?

August 22, 2007, at 11:11 PM by stu --
Changed line 410 from:
  • 22 Aug 2007 Maxtor Basics 3200 works with sdparm.
to:
  • 22 Aug 2007 Maxtor Basics 3200 works with sdparm.
Changed lines 414-415 from:
 S:  SerialNumber?=2CAHGKE3x]
to:
 S:  SerialNumber?=2CAHGKE3x@]
August 22, 2007, at 11:09 PM by stu --
Changed line 411 from:

[@P: Vendor=0d49 ProdID?=3200 Rev=0.01

to:

[@ P: Vendor=0d49 ProdID?=3200 Rev=0.01

August 22, 2007, at 11:07 PM by stu --
Changed lines 411-415 from:

[P: Vendor=0d49 ProdID?=3200 Rev=0.01 S: Manufacturer=Maxtor Corporation S: Product=Maxtor 3200 S: SerialNumber?=2CAHGKE3x]

to:

[@P: Vendor=0d49 ProdID?=3200 Rev=0.01

 S:  Manufacturer=Maxtor Corporation
 S:  Product=Maxtor 3200
 S:  SerialNumber?=2CAHGKE3x]
August 22, 2007, at 11:05 PM by stu -- Added maxtor 3200 to working drives
Added lines 410-415:
  • 22 Aug 2007 Maxtor Basics 3200 works with sdparm.

[P: Vendor=0d49 ProdID?=3200 Rev=0.01 S: Manufacturer=Maxtor Corporation S: Product=Maxtor 3200 S: SerialNumber?=2CAHGKE3x]

August 22, 2007, at 04:30 PM by jiml8 -- edit entry
Changed lines 410-412 from:
  • 22 Aug 2007 Vantec NexStar?-3 PATA to USB appears to work using sg_start 0 --pc=2 holding a Seagate 320 gig drive. This housing apparently uses the same chipset as the Evertech device.

product: USB2?.0 Storage Device [@P:vendor: Cypress Semiconductor

to:
  • 22 Aug 2007 Vantec NexStar-3 PATA to USB works using sg_start 0 --pc=2 holding a Seagate 320 gig drive. This housing apparently uses the same chipset as the Evertech device.

[@P:product: USB2?.0 Storage Device vendor: Cypress Semiconductor

August 22, 2007, at 04:22 PM by jiml8 -- Vantec NexStar3 added to list
Added lines 410-420:
  • 22 Aug 2007 Vantec NexStar?-3 PATA to USB appears to work using sg_start 0 --pc=2 holding a Seagate 320 gig drive. This housing apparently uses the same chipset as the Evertech device.

product: USB2?.0 Storage Device

P:vendor: Cypress Semiconductor
physical id: 4
bus info: usb@4:4
logical name: scsi30
version: 0.01
serial: DEF1065D483E
capabilities: usb-2.00 scsi emulated scsi-host
configuration: driver=usb-storage maxpower=0mA speed=480.0MB/s
August 02, 2007, at 09:32 AM by jcunwin -- Fix link
Changed lines 3-4 from:

Warning: As described here, most disks do not tolerate a large number of spinups.

to:

Warning: As described here, most disks do not tolerate a large number of spinups.

July 31, 2007, at 01:26 PM by christian --
Changed line 463 from:
  • Trifoo IDE to USB Adapter Cable (stops with sdparm command)
to:
  • Trifoo IDE to USB Adapter Cable (stops with sdparm command)
July 31, 2007, at 01:24 PM by christian --
Changed line 463 from:
  • TriFOO? IDE to USB Adapter Cable (stops with sdparm command)
to:
  • Trifoo IDE to USB Adapter Cable (stops with sdparm command)
July 31, 2007, at 01:21 PM by christian -- added a working chip to the list
Added lines 463-469:
  • TriFOO? IDE to USB Adapter Cable (stops with sdparm command)
P:  Vendor=067b ProdID=2506 Rev= 1.00
S:  Manufacturer=Prolific Technology Inc.
S:  Product=Mass Storage Device
S:  SerialNumber=0
July 15, 2007, at 06:26 PM by vivekv --
Changed lines 111-113 from:
to:

2007-7-15

  • I have a WD MyBook standard edition 500GB and I am facing the same problem with a V63 firmware and Unslug 6.8. The only way I can make it spindown is to unmount the file system!
July 08, 2007, at 03:52 PM by Silvestre Zabala -- fix link
Changed line 454 from:
  • Evertech ET-1324 http://www.evertech.de/de/product-page.php?ProductID=20&ClassID1=42&ClassID2=46&ClassID3=78
to:
  • Evertech ET-1324
July 08, 2007, at 03:51 PM by Silvestre Zabala -- Add Evertech ET-1324 to working list
Changed lines 454-460 from:
to:
  • Evertech ET-1324 http://www.evertech.de/de/product-page.php?ProductID=20&ClassID1=42&ClassID2=46&ClassID3=78
 P:  Vendor=04b4 ProdID=6830 Rev= 0.01
S:  Manufacturer=Cypress Semiconductor
S:  Product=USB2.0 Storage Device
S:  SerialNumber=DEF106207355

Works with 'sg_start 0 --pc=2', but not with sdparm.

June 30, 2007, at 08:06 AM by marceln -- removed false wikilinks
Changed lines 441-442 from:
  • Not USB, but anyway, Buffalo DriveStation Duo 1TB (HDW10TIU2R1 - Bought in Japan). Using 1394 connection and Raid 1 config. Spin down works with sg3-utils.
to:
  • Not USB, but anyway, Buffalo DriveStation Duo 1TB (HDW10TIU2R1 - Bought in Japan). Using 1394 connection and Raid 1 config. Spin down works with sg3-utils.
June 11, 2007, at 05:51 PM by fcarolo -- removed false wikilinks
Changed lines 441-444 from:
  • Not USB, but anyway, Buffalo DriveStation Duo 1TB (HDW10TIU2R1? - Bought in Japan). Using 1394 connection and Raid 1 config. Spin down works with sg3-utils.
  • NOVAC NV-US2000? USB-SATA converter. Works with sg3-utils.

P: Vendor=152d ProdID?=2338 Rev= 0.00

to:
  • Not USB, but anyway, Buffalo DriveStation Duo 1TB (HDW10TIU2R1 - Bought in Japan). Using 1394 connection and Raid 1 config. Spin down works with sg3-utils.
  • NOVAC NV-US2000 USB-SATA converter. Works with sg3-utils.

P: Vendor=152d ProdID=2338 Rev= 0.00

Changed lines 446-447 from:

S: Product=NOVAC NV-US2000?

to:

S: Product=NOVAC NV-US2000

Changed lines 484-486 from:
  • 2007/06/3: Same tried on unlabeled USB to SATA/PATA adapter bough in Japan that reports the same USB IDs? from JMicron?. No success stopping the drive.
to:
  • 2007/06/3: Same tried on unlabeled USB to SATA/PATA adapter bough in Japan that reports the same USB IDs from JMicron. No success stopping the drive.
June 10, 2007, at 06:54 PM by Casimodo -- minor correction
Changed line 449 from:

[@ P: Vendor=1058 ProdID?=1001 Rev= 1.06

to:

[@P: Vendor=1058 ProdID?=1001 Rev= 1.06

Changed lines 452-454 from:

Actually has a built-in spindown feature, which /should/ spindown the drive afer 10min idle time, but this worked on my OpenSlug/BE only very few times. Drives reacts immedialty to scsi-stop or 'sdparm --command=stop /dev/sdX' and wakes up automatically.

to:

Actually has a built-in spindown feature, which /should/ spindown the drive afer 10min idle time, but this worked on my OpenSlug/BE only very few times. Drive immedialty reacts to scsi-stop or 'sdparm --command=stop /dev/sdX' and wakes up automatically.

June 09, 2007, at 11:43 AM by Casimodo -- Layout correction
Changed lines 449-451 from:

[@P: Vendor=1058 ProdID?=1001 Rev= 1.06

 S:  Manufacturer=Western Digital
 S:  Product=External HDD]
to:
 P:  Vendor=1058 ProdID=1001 Rev= 1.06
S:  Manufacturer=Western Digital
S:  Product=External HDD
June 09, 2007, at 11:41 AM by Casimodo -- Layout correction
Changed lines 449-451 from:

P: Vendor=1058 ProdID?=1001 Rev= 1.06 S: Manufacturer=Western Digital S: Product=External HDD

to:

[@P: Vendor=1058 ProdID?=1001 Rev= 1.06

 S:  Manufacturer=Western Digital
 S:  Product=External HDD]
June 09, 2007, at 11:39 AM by Casimodo -- Western Digital - Elements 500GB supports spindown
Changed lines 448-454 from:
to:
  • Western Digital - Elements 500GB

P: Vendor=1058 ProdID?=1001 Rev= 1.06 S: Manufacturer=Western Digital S: Product=External HDD Actually has a built-in spindown feature, which /should/ spindown the drive afer 10min idle time, but this worked on my OpenSlug/BE only very few times. Drives reacts immedialty to scsi-stop or 'sdparm --command=stop /dev/sdX' and wakes up automatically.

June 03, 2007, at 08:30 AM by Terje --
Added lines 440-448:
  • Not USB, but anyway, Buffalo DriveStation Duo 1TB (HDW10TIU2R1? - Bought in Japan). Using 1394 connection and Raid 1 config. Spin down works with sg3-utils.
  • NOVAC NV-US2000? USB-SATA converter. Works with sg3-utils.

P: Vendor=152d ProdID?=2338 Rev= 0.00 S: Manufacturer=NOVAC S: Product=NOVAC NV-US2000?

Changed lines 478-480 from:
to:
  • 2007/06/3: Same tried on unlabeled USB to SATA/PATA adapter bough in Japan that reports the same USB IDs? from JMicron?. No success stopping the drive.
May 31, 2007, at 07:30 PM by espen at gyfgafgufdk -- In Unslung use /proc/stats instead of /proc/loadavg
Added lines 170-171:

If you use Unslung 6.8 it does not provide /proc/diskstats which this script relies on. Therefore you need to replace the occurances of /proc/diskstats in the script with /proc/stat, which contains similar information. You also need to change the search string for grep. If you only have one disk connected the simple solution is to change the grep commands to "grep disk_io /proc/stat". This solution works with Unslung 6.8 using a LaCie Porsche USB drive (250 GB Hitachi hard drive).

Deleted lines 215-235:

Shell-only scsi-idle without kernel patch for Unslung

By Espen

Unslung 6.8 does not provide /proc/diskstats, so the above solution won't work directly. However, you can use /proc/loadavg which gives a good indication of whether your slug is idle. I run this script which checks /proc/loadavg every 10 minutes to decide if the hard drive should be spun down.

#!/bin/bash

while [ true ]; do
  load="$(cat /proc/loadavg |cut -d ' ' -f 1|cut -b '1,3-4')"
  if [ "$load" -lt "105" ]; then
    /opt/sbin/scsi-stop /dev/sda
  fi
  sleep 600
done

This solution works with Unslung 6.8 using a LaCie Porsche USB drive (250 GB Hitachi hard drive).


May 30, 2007, at 10:18 PM by fcarolo -- removed false wikilink
Changed line 427 from:
  • 30 May 2007: Raidsonic IB-360UE-BL, does feature an Agere chip (FW8028?) on the exposed side of the circuit board, but this appears to be the Firewire interface circuit. Hard drive spins down with scsi-stop - not tried any other method.
to:
  • 30 May 2007: Raidsonic IB-360UE-BL, does feature an Agere chip (FW8028) on the exposed side of the circuit board, but this appears to be the Firewire interface circuit. Hard drive spins down with scsi-stop - not tried any other method.
Changed line 466 from:
  • Delock? Combo
to:
  • Delock Combo
May 30, 2007, at 03:14 PM by yhoo_does_my_head_in --
Changed line 427 from:
  • 30 May 2007: Raidsonic IB-360UE-BL, does feature an Agere chip (FW8028?) on the exposed side of the circuit board, but this appear to be the Firewire interface circuit. Hard drive spins down with scsi-stop - not tried any other method.
to:
  • 30 May 2007: Raidsonic IB-360UE-BL, does feature an Agere chip (FW8028?) on the exposed side of the circuit board, but this appears to be the Firewire interface circuit. Hard drive spins down with scsi-stop - not tried any other method.
May 30, 2007, at 12:00 PM by yhoo_does_my_head_in -- Added IB-360UE-BL
Added lines 427-431:
  • 30 May 2007: Raidsonic IB-360UE-BL, does feature an Agere chip (FW8028?) on the exposed side of the circuit board, but this appear to be the Firewire interface circuit. Hard drive spins down with scsi-stop - not tried any other method.
P:  Vendor=067b ProdID=3507 Rev= 0.01
S:  Manufacturer=Prolific Technology Inc.
S:  Product=ATAPI-6 Bridge Controller
May 13, 2007, at 01:24 PM by Tom Vandepoel -- corrected typesetting
Changed lines 447-450 from:
  • Iomega Hi-Speed USB 2.0 Desktop Hard Drive (250 Gbyte) uses the Prolific PL-2506 chipset and supports start/stop nicely.

(Power consumption active 9W, standby 2W).

P: Vendor=067b ProdID?=2507 Rev= 0.00

to:
  • Iomega Hi-Speed USB 2.0 Desktop Hard Drive (250 Gbyte) uses the Prolific PL-2506 chipset and supports start/stop nicely. (Power consumption active 9W, standby 2W).

[@ P: Vendor=067b ProdID?=2507 Rev= 0.00

Changed lines 452-453 from:

S: SerialNumber?=0620000022C5

to:

S: SerialNumber?=0620000022C5@]

May 13, 2007, at 01:22 PM by Tom Vandepoel -- added Iomega Hi-speed USB drive in support start/stop
Added lines 447-454:
  • Iomega Hi-Speed USB 2.0 Desktop Hard Drive (250 Gbyte) uses the Prolific PL-2506 chipset and supports start/stop nicely.

(Power consumption active 9W, standby 2W).

P: Vendor=067b ProdID?=2507 Rev= 0.00 S: Manufacturer=Prolific S: Product=PL-2506 USB Storage Device S: SerialNumber?=0620000022C5

May 13, 2007, at 10:22 AM by DurvalMenezes --
Changed lines 475-476 from:
  • 2007/05/13: tried "sdparm --command=stop /dev/sdX", showed no error but didn't do anything (disk kept spinning).
to:
  • 2007/05/13: tried "sdparm --command=stop /dev/sdX", showed no error but didn't do anything (disk kept spinning). Ditto, "/usr/bin/sg_start 0 --pc=2 /dev/sdX"; ditto, ALL values from 0 to f for "pc=".
May 13, 2007, at 10:10 AM by DurvalMenezes --
Changed lines 468-470 from:

S: Manufacturer=JMicron? S: Product=JM20336? SATA, USB Combo@]

to:
 S:  Manufacturer=JMicron?
 S:  Product=JM20336? SATA, USB Combo@]
Changed lines 473-475 from:

S: Manufacturer=JMicron? S: Product=USB to ATA/ATAPI Bridge@]

to:
 S: Manufacturer=JMicron?
 S: Product=USB to ATA/ATAPI Bridge@]
  • 2007/05/13: tried "sdparm --command=stop /dev/sdX", showed no error but didn't do anything (disk kept spinning).
May 13, 2007, at 10:07 AM by DurvalMenezes --
Changed line 471 from:
to:
  • Black Cyclone 3.5" Portable Gard Disk Drive MDT-SI3572 (and possibly other models: MDT-U3572, MDT-US3572, MDT-US3572II, MDT-UFS3572, MDT-UF3572)
May 13, 2007, at 10:06 AM by DurvalMenezes -- Added BlackCyclone/JMicron enclosure as non-supporting \"sdparm\"
Added lines 471-475:
 P:   Vendor=0x152d ProdId=2338 Rev= 1.00
S: Manufacturer=JMicron
S: Product=USB to ATA/ATAPI Bridge
May 04, 2007, at 06:08 PM by Bjorn -- added comment
Changed lines 109-111 from:
to:

2007-05-04

  • I have a Western Digital MyBook Premium 320GB with NTFS partition on port1 (root fs on flash disk port2). Running Unslung 6.8. Same problems as above with strange disk activity ~2 seconds which cause the drive to never spindown.
May 02, 2007, at 12:26 PM by fcarolo -- removed false wikilinks
Changed lines 443-444 from:
  • 14 April 2007: ID 09CC:2106, AMS Venus T4U 4-disk enclosure; works with sg_start --stop to the appropriate disk. Tested with a Seagate ST3750640A? (primary master) and a Western Digital WD1000BB? (secondary master), configured to run independently. Each drive spins down on command.
to:
  • 14 April 2007: ID 09CC:2106, AMS Venus T4U 4-disk enclosure; works with sg_start --stop to the appropriate disk. Tested with a Seagate ST3750640A (primary master) and a Western Digital WD1000BB (secondary master), configured to run independently. Each drive spins down on command.
May 02, 2007, at 02:38 AM by muanis -- correcting link
Changed lines 80-81 from:

For Seagate Desktop FreeAgent? see the Seagate FreeAgent HOWTO.

to:

For Seagate Desktop FreeAgent see the Seagate FreeAgent HOWTO.

May 02, 2007, at 02:37 AM by muanis -- Adding info about Seagate FreeAgent Drives
Changed lines 80-81 from:
to:

For Seagate Desktop FreeAgent? see the Seagate FreeAgent HOWTO.

April 24, 2007, at 11:35 PM by Christian Mueller --
Changed line 292 from:

Method 5: Use hd-idle to spin down external disks

to:

Method 5: Use hd-idle to spin down external disks

April 24, 2007, at 11:34 PM by Christian Mueller --
Added line 10:
Changed lines 27-28 from:
  • Method 5: Use hd-idle [Debian]
to:
  • Method 5: Use hd-idle [Debianslug]
Changed line 292 from:

5.Method: Use hd-idle to spin down external disks

to:

Method 5: Use hd-idle to spin down external disks

Added lines 295-296:

Please note that the benefits of running a C program vs. a shell or perl script will be most noticable when running a full [Debian] distribution from the hard disk. If both the shell and the tool to stop the disk are stored on flash memory, hd-idle will provide little advantage over the script approaches mentioned above.

April 24, 2007, at 11:26 PM by Christian Mueller -- Added method 5 for hd-idle
Added lines 26-27:
  • Method 5: Use hd-idle [Debian]
Changed lines 290-295 from:
to:

5.Method: Use hd-idle to spin down external disks

hd-idle will monitor disk statistics much like the perl and shell scripts above but will do so within a single, small C program. The main reason for hd-idle is to save memory (i.e. a small daemon vs. a shell or perl script and a separate executable to actually spin down the disk) and CPU time.

More information can be found on http://hd-idle.sf.net

April 22, 2007, at 08:14 AM by Vladimir -- Fixed URL to the spindown daemon
Changed lines 231-232 from:

The spindown daemon 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 the disk idle time out is reached, the program sends a SCSI motor control command in order to spin down the disk motor.

to:

The spindown daemon 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 the disk idle time out is reached, the program sends a SCSI motor control command in order to spin down the disk motor.

Added lines 235-236:

See http://vladimir.grouzdev.free.fr/public/spindown.

April 18, 2007, at 04:23 AM by dfsmith -- bad spolling
Changed lines 72-73 from:

[dfsmith]: As the original author of Power Booster, I can tell you that it only sends the appropiate "set feature" command to the ATA drive. This is not generally preserved on a power cycle. It should work on any drive that supports ATA-ATAPI 4 or later (and is one of the commands that some IDE<->ATA chipsets remove). The Feature Tool goes to a much lower level, and writes the drive's persistent configuation data. (At least, that's my understanding, a different department wrote that tool.) One note: to enable spindown, the Advanced Power Management setting (on hdparm or Power Booster) must be < 0x80. Also, no drives that I know of have a low RPM mode, but they do have idle modes where the actuator is powered down. (I've found turning off syslog and mounting / -o noatime spins down my Seagate external drive. Samba logs spin the drive up every few hours though.)

to:

[dfsmith]: As the original author of Power Booster, I can tell you that it only sends the appropriate "set feature" command to the ATA drive. This is not generally preserved on a power cycle. It should work on any drive that supports ATA-ATAPI 4 or later (and is one of the commands that some USB<->ATA chipsets remove). The Feature Tool goes to a much lower level, and writes the drive's persistent configuration data. (At least, that's my understanding, a different department wrote that tool.) One note: to enable spindown, the Advanced Power Management setting (on hdparm or Power Booster) must be < 0x80. Also, no drives that I know of have a low RPM mode, but they do have idle modes where the actuator is powered down. (I've found turning off syslog and mounting / -o noatime spins down my Seagate external drive. Samba logs spin the drive up every few hours though.)

April 16, 2007, at 05:14 PM by dfsmith -- Notes about Power Booster
Added lines 72-73:

[dfsmith]: As the original author of Power Booster, I can tell you that it only sends the appropiate "set feature" command to the ATA drive. This is not generally preserved on a power cycle. It should work on any drive that supports ATA-ATAPI 4 or later (and is one of the commands that some IDE<->ATA chipsets remove). The Feature Tool goes to a much lower level, and writes the drive's persistent configuation data. (At least, that's my understanding, a different department wrote that tool.) One note: to enable spindown, the Advanced Power Management setting (on hdparm or Power Booster) must be < 0x80. Also, no drives that I know of have a low RPM mode, but they do have idle modes where the actuator is powered down. (I've found turning off syslog and mounting / -o noatime spins down my Seagate external drive. Samba logs spin the drive up every few hours though.)

April 14, 2007, at 10:44 PM by Scott Alfter -- added 4-disk enclosure
Added lines 427-428:
  • 14 April 2007: ID 09CC:2106, AMS Venus T4U 4-disk enclosure; works with sg_start --stop to the appropriate disk. Tested with a Seagate ST3750640A? (primary master) and a Western Digital WD1000BB? (secondary master), configured to run independently. Each drive spins down on command.
April 14, 2007, at 04:29 AM by Vladimir -- Spindown daemon without kernel patch for Unslung
Added line 223:
Added lines 226-234:

Spindown daemon without kernel patch for Unslung

By Vladimir

The spindown daemon 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 the disk idle time out is reached, the program sends a SCSI motor control command in order to spin down the disk motor.

This solution works with Unslung 6.8 using a FREECOM External USB drive (400 GB Samsung hard drive).


April 05, 2007, at 03:52 AM by Pseudo -- Addition to sdparm spindown list
Added lines 413-414:
  • 5 April 2007: ID 04fc:0c15 Sunplus Technology Co., Ltd - Welland, Sun Bright enclosure seems to work fine: http://www.welland.com.tw
April 02, 2007, at 04:37 PM by ST -- cleanup
Added line 43:
Added line 45:
Added line 47:
Added line 49:
Added line 51:
April 02, 2007, at 04:35 PM by ST -- further cleanup
Changed lines 22-23 from:
  • Method 3: Use scsi-idle. However, this requires a kernel patch as the corresponding kernel changes are not yet included in the nslu2-linux binaries. See the scsi-idle section below [applies to Openslug, Unslung].
to:
  • Method 3: Use scsi-idle. [Openslug, Unslung].
  • Method 4: Use sg_start [Debianslug]
Deleted lines 27-28:

For further details check below.

Changed lines 42-53 from:
  1. Take your HD and install it the enclosure (especially the power connector to the drive).
  2. Turn on your enclosure.
  3. Disconnect the enclosure's IDE connector (if connected) and connect the other Linux machine's IDE connector to the HD.
  4. Set the spindown-time 'hdparm -k1 -K1 -S120 /dev/hda' where -Sxx specifies the spindown-time. -k1-K1 set the keep over reset-flags if supported.
  5. Disconnect the Linux machine's IDE connector.
  6. Connect the enclosures IDE connector to the HD without removing the power from the HD!
to:

1) Take your HD and install it the enclosure (especially the power connector to the drive). 2) Turn on your enclosure. 3) Disconnect the enclosure's IDE connector (if connected) and connect the other Linux machine's IDE connector to the HD. 4) Set the spindown-time 'hdparm -k1 -K1 -S120 /dev/hda' where -Sxx specifies the spindown-time. -k1-K1 set the keep over reset-flags if supported. 5) Disconnect the Linux machine's IDE connector. 6) Connect the enclosures IDE connector to the HD without removing the power from the HD!

Changed lines 51-54 from:

For those with enclosures that wont let them do this, I use this. The IDE-USB and power supply are completely separate, which make this easy.

[ST: Bought an enclosure with internal SATA interface and external SATA/USB interface IcyBox IB-360StUS-B and installed a Samsung 250GB SATA II (SP2504C) into it. Connected it via SATA (MB to external slot-connector is included) to my big machine and ran hdparm. Voila, the disk spins down.]

to:

Comments:

Unknown:For those with enclosures that wont let them do this, I use this. The IDE-USB and power supply are completely separate, which make this easy.

ST: Bought an enclosure with internal SATA interface and external SATA/USB interface IcyBox IB-360StUS-B and installed a Samsung 250GB SATA II (SP2504C) into it. Connected it via SATA (MB to external slot-connector is included) to my big machine and ran hdparm. Voila, the disk spins down.

Changed line 86 from:

Note:

to:

Comments:

Deleted line 157:

Stripwax adds: The scsi-idle package and the perl script above follow the convention that the drive to idle is e.g. "dev/sda" whereas the below seems to want to expect just e.g. "sda". In my opinion you will need to change the line "disk=$1" below to something like "disk=${1#/dev/}" or similar

Added lines 193-197:

Comments:

Stripwax adds: The scsi-idle package and the perl script above follow the convention that the drive to idle is e.g. "dev/sda" whereas the before seems to want to expect just e.g. "sda". In my opinion you will need to change the line "disk=$1" below to something like "disk=${1#/dev/}" or similar

Added lines 259-261:

Comments:

April 02, 2007, at 04:24 PM by ST -- improve readability
Changed line 112 from:

(:table border=0 width=80% bgcolor=#eeffee:)

to:
Changed line 139 from:

(:tableend:)

to:
Changed line 162 from:

(:table border=0 width=80% bgcolor=#eeffee:)

to:
Changed line 196 from:

(:tableend:)

to:
Changed line 203 from:

(:table border=0 width=80% bgcolor=#eeffee:)

to:
Changed line 215 from:

(:tableend:)

to:
Changed line 235 from:

(:table border=0 width=80% bgcolor=#eeffee:)

to:
Changed line 257 from:

(:tableend:)

to:
Changed line 282 from:

(:table border=0 width=80% bgcolor=#eeffee:)

to:
Changed line 287 from:

(:tableend:)

to:
Changed line 304 from:

(:table border=0 width=80% bgcolor=#eeffee:)

to:
Changed line 339 from:

(:tableend:)

to:
Changed line 359 from:

(:table border=0 width=80% bgcolor=#eeffee:)

to:
Changed lines 366-368 from:

(:tableend:)

to:
Changed line 375 from:

(:table border=0 width=80% bgcolor=#eeffee:)

to:
Changed lines 378-379 from:

(:tablend:)

to:
Changed line 381 from:

(:table border=0 width=80% bgcolor=#eeffee:)

to:
Changed lines 384-385 from:

(:tableend:)

to:
April 02, 2007, at 04:21 PM by ST -- improve readability
Changed line 112 from:
to:

(:table border=0 width=80% bgcolor=#eeffee:)

Changed line 139 from:
to:

(:tableend:)

Changed line 162 from:
to:

(:table border=0 width=80% bgcolor=#eeffee:)

Added line 196:

(:tableend:)

Changed line 203 from:
to:

(:table border=0 width=80% bgcolor=#eeffee:)

Changed line 215 from:
to:

(:tableend:)

Changed line 229 from:
to:

(:table border=0 width=80% bgcolor=#eeffee:)

Changed line 231 from:
to:

(:tableend:)

Added line 235:

(:table border=0 width=80% bgcolor=#eeffee:)

Deleted line 236:
Changed line 257 from:
to:

(:tableend:)

Changed line 282 from:
to:

(:table border=0 width=80% bgcolor=#eeffee:)

Changed line 287 from:
to:

(:tableend:)

Added line 304:

(:table border=0 width=80% bgcolor=#eeffee:)

Changed line 339 from:
to:

(:tableend:)

Added line 359:

(:table border=0 width=80% bgcolor=#eeffee:)

Changed lines 366-368 from:
to:

(:tableend:)

Added line 375:

(:table border=0 width=80% bgcolor=#eeffee:)

Changed lines 378-379 from:
to:

(:tablend:)

Added line 381:

(:table border=0 width=80% bgcolor=#eeffee:)

Changed lines 384-385 from:
to:

(:tableend:)

March 29, 2007, at 03:38 PM by fcarolo -- cleaned up links
Changed line 94 from:
  • I have a Western Digital MyBook Essential 500GB (like Anguel). The drive span down with the original firmware, but once upgraded to V2.3R63 of the linksys firmware it did not seem to spin down anymore (but I did not fully test at this stage - just noted in passing). Following the installation of Unslung 6.8 onto a 4GB usb microdive on port 2, I can confirm that the MyBook? on port 1 never spins down. Richard 2007-02-25
to:
  • I have a Western Digital MyBook Essential 500GB (like Anguel). The drive span down with the original firmware, but once upgraded to V2.3R63 of the linksys firmware it did not seem to spin down anymore (but I did not fully test at this stage - just noted in passing). Following the installation of Unslung 6.8 onto a 4GB usb microdive on port 2, I can confirm that the MyBook on port 1 never spins down. Richard 2007-02-25
March 29, 2007, at 03:36 PM by fcarolo -- cleaned up links
Changed line 39 from:
  • Hard disk with separate IDE and power connectors, eg, some [[http://www.raidsonic.de/de/pages/products/external_cases.php?we_objectID=3206 | IcyBox?] models.
to:
  • Hard disk with separate IDE and power connectors, eg, some IcyBox models.
Changed lines 58-59 from:

[ST: Bought an enclosure with internal SATA interface and external SATA/USB interface IcyBox IB-360StUS-B and installed a Samsung 250GB SATA II (SP2504C?) into it. Connected it via SATA (MB to external slot-connector is included) to my big machine and ran hdparm. Voila, the disk spins down.]

to:

[ST: Bought an enclosure with internal SATA interface and external SATA/USB interface IcyBox IB-360StUS-B and installed a Samsung 250GB SATA II (SP2504C) into it. Connected it via SATA (MB to external slot-connector is included) to my big machine and ran hdparm. Voila, the disk spins down.]

Changed lines 90-91 from:
  • Note by Anguel Stankov: I have a Western Digital MyBook? Essential 500GB. The drive spins down with Unslung 5.5 only (I have no additional packages installed and I don't use any additional spindown scripts). Unfortunately I cannot make spindown work with Unslung 6.8 or original Linksys firmware v23RA5. This spin-down problem is also reported in the "nslu2-general" newsgroup.
  • I have a WD MyBook? 250GB and I have never had any problems like that. It spins up and down like it should. I'm running unslung 6.8. - Tobbe 2006-12-19
to:
  • Note by Anguel Stankov: I have a Western Digital MyBook Essential 500GB. The drive spins down with Unslung 5.5 only (I have no additional packages installed and I don't use any additional spindown scripts). Unfortunately I cannot make spindown work with Unslung 6.8 or original Linksys firmware v23RA5. This spin-down problem is also reported in the "nslu2-general" newsgroup.
  • I have a WD MyBook 250GB and I have never had any problems like that. It spins up and down like it should. I'm running unslung 6.8. - Tobbe 2006-12-19
Changed lines 93-94 from:
  • like Tobbe: WD MyBook? 250 on Disk 1, Unslung 6.8 to Stick on Disk 2 + Ext3flash, no additional spindown scripts, landeshauptbill 2007-02-24
  • I have a Western Digital MyBook? Essential 500GB (like Anguel). The drive span down with the original firmware, but once upgraded to V2.3R63 of the linksys firmware it did not seem to spin down anymore (but I did not fully test at this stage - just noted in passing). Following the installation of Unslung 6.8 onto a 4GB usb microdive on port 2, I can confirm that the MyBook? on port 1 never spins down. Richard 2007-02-25
to:
  • like Tobbe: WD MyBook 250 on Disk 1, Unslung 6.8 to Stick on Disk 2 + Ext3flash, no additional spindown scripts, landeshauptbill 2007-02-24
  • I have a Western Digital MyBook Essential 500GB (like Anguel). The drive span down with the original firmware, but once upgraded to V2.3R63 of the linksys firmware it did not seem to spin down anymore (but I did not fully test at this stage - just noted in passing). Following the installation of Unslung 6.8 onto a 4GB usb microdive on port 2, I can confirm that the MyBook? on port 1 never spins down. Richard 2007-02-25
Changed line 96 from:
  • I am also unsuccessful in making my MyBook? 500GB spindown at all. I've tried the /dev /var, noatime and crontab modifications suggested here, but there is still disk access every ~2nd second at a regular pattern. The same disk access pattern is heard if I boot the NSLU2 with no disks attached and then attach the MyBook?.
to:
  • I am also unsuccessful in making my MyBook 500GB spindown at all. I've tried the /dev /var, noatime and crontab modifications suggested here, but there is still disk access every ~2nd second at a regular pattern. The same disk access pattern is heard if I boot the NSLU2 with no disks attached and then attach the MyBook.
Changed lines 98-100 from:
  • I also have similar issues with the WD MyBook? 500GB Essential External Drive. I tried all the suggestions provided on various forums and Wikis and have also tried starting up the bare minimum processes on the NSLU2 with no success. For those who were successful spinning down the WD Essential drive if they could please describe their configuration and what they did and didn't do. Like others I have the WD MyBook? 500GB Essential attached to port 1 and a Lexar Jump Drive with Unslung 6.8/Ext3flash attached to port 2. My belief is that folks who have successfully spun down the drive have a ext formated drive on their WD. I have a NTFS formatted drive mounted as ufsd. My NSLU2 is using V2.3R63 firmware/Unslung 6.8. Has anyone tried using the beta V2.3R72 firmware (Looks like there is now a R73 release available) on Unslung 6.8?
  • In addition I also have a 500GB WD MyBook? Essential, connected to port 1. With firmware R63 the drive does not spin down, downgraded to R29 it spins down as expected. 2007-03-28
to:
  • I also have similar issues with the WD MyBook 500GB Essential External Drive. I tried all the suggestions provided on various forums and Wikis and have also tried starting up the bare minimum processes on the NSLU2 with no success. For those who were successful spinning down the WD Essential drive if they could please describe their configuration and what they did and didn't do. Like others I have the WD MyBook 500GB Essential attached to port 1 and a Lexar Jump Drive with Unslung 6.8/Ext3flash attached to port 2. My belief is that folks who have successfully spun down the drive have a ext formated drive on their WD. I have a NTFS formatted drive mounted as ufsd. My NSLU2 is using V2.3R63 firmware/Unslung 6.8. Has anyone tried using the beta V2.3R72 firmware (Looks like there is now a R73 release available) on Unslung 6.8?
  • In addition I also have a 500GB WD MyBook Essential, connected to port 1. With firmware R63 the drive does not spin down, downgraded to R29 it spins down as expected. 2007-03-28
Changed line 215 from:

This solution works with Unslung 6.8 using a LaCie? Porsche USB drive (250 GB Hitachi hard drive).

to:

This solution works with Unslung 6.8 using a LaCie Porsche USB drive (250 GB Hitachi hard drive).

Changed line 220 from:

for OpenDebianSlug? 3.10 2.16 kernel:

to:

for OpenDebianSlug 3.10 2.16 kernel:

Changed lines 280-281 from:
  • [Unslung] Cron runs an hourly syncronization of the system clock (hwclock) and three times a day it checks if the disk is full. Whenever cron executes a job it is logged in /var/log/messages, which causes the disk to spin up. Since these jobs are not vital for your slug, you can avoid this spin up by editing /etc/crontab so the jobs are only run once a day. These lines in crontab will run hwclock and CheckDiskFull? once a day (at midnight):
to:
  • [Unslung] Cron runs an hourly syncronization of the system clock (hwclock) and three times a day it checks if the disk is full. Whenever cron executes a job it is logged in /var/log/messages, which causes the disk to spin up. Since these jobs are not vital for your slug, you can avoid this spin up by editing /etc/crontab so the jobs are only run once a day. These lines in crontab will run hwclock and CheckDiskFull once a day (at midnight):
Changed line 419 from:
to:
  • LCPower EH35B-SII
March 29, 2007, at 08:10 AM by fatbag -- WD MyBook spindown: port added
Changed lines 99-100 from:
  • In addition I also have a 500GB WD MyBook? Essential. With R63 the drive does not spin down, downgraded to R29 it spins down as expected. 2007-03-28
to:
  • In addition I also have a 500GB WD MyBook? Essential, connected to port 1. With firmware R63 the drive does not spin down, downgraded to R29 it spins down as expected. 2007-03-28
March 28, 2007, at 07:35 PM by fatbag -- WD MyBook 500GB hint added
Changed lines 99-100 from:
to:
  • In addition I also have a 500GB WD MyBook? Essential. With R63 the drive does not spin down, downgraded to R29 it spins down as expected. 2007-03-28
March 16, 2007, at 05:25 PM by EKI -- No Success - WD Essential Drive Spindown
Changed lines 98-99 from:
  • I also have similar issues with the WD MyBook? 500GB Essential External Drive. I tried all the suggestions provided on various forums and Wikis and have also tried starting up the bare minimum processes on the NSLU2 with no success. For those who were successful spinning down the WD Essential drive if they could please describe their configuration and what they did and didn't do. Like others I have the WD MyBook? 500GB Essential attached to port 1 and a Lexar Jump Drive with Unslung 6.8/Ext3flash attached to port 2. My belief is that folks who have successful confirmations have a ext formated drive on their WD. I have a NTFS formatted drive mounted as ufsd. My NSLU2 is using V2.3R63 firmware/Unslung 6.8. Has anyone tried using the beta V2.3R72 firmware (Looks like there is now a R73 release available) on Unslung 6.8?
to:
  • I also have similar issues with the WD MyBook? 500GB Essential External Drive. I tried all the suggestions provided on various forums and Wikis and have also tried starting up the bare minimum processes on the NSLU2 with no success. For those who were successful spinning down the WD Essential drive if they could please describe their configuration and what they did and didn't do. Like others I have the WD MyBook? 500GB Essential attached to port 1 and a Lexar Jump Drive with Unslung 6.8/Ext3flash attached to port 2. My belief is that folks who have successfully spun down the drive have a ext formated drive on their WD. I have a NTFS formatted drive mounted as ufsd. My NSLU2 is using V2.3R63 firmware/Unslung 6.8. Has anyone tried using the beta V2.3R72 firmware (Looks like there is now a R73 release available) on Unslung 6.8?
March 16, 2007, at 05:23 PM by EKI -- No Sucess - WD Essential Drive Spindown
Changed lines 97-99 from:
to:

2007-03-16

  • I also have similar issues with the WD MyBook? 500GB Essential External Drive. I tried all the suggestions provided on various forums and Wikis and have also tried starting up the bare minimum processes on the NSLU2 with no success. For those who were successful spinning down the WD Essential drive if they could please describe their configuration and what they did and didn't do. Like others I have the WD MyBook? 500GB Essential attached to port 1 and a Lexar Jump Drive with Unslung 6.8/Ext3flash attached to port 2. My belief is that folks who have successful confirmations have a ext formated drive on their WD. I have a NTFS formatted drive mounted as ufsd. My NSLU2 is using V2.3R63 firmware/Unslung 6.8. Has anyone tried using the beta V2.3R72 firmware (Looks like there is now a R73 release available) on Unslung 6.8?
March 09, 2007, at 05:00 PM by izeman --
Added lines 386-387:
  • 9 Mar 2007: Sharkoon Swift-Case 3.5" USB 2.0 which seems to have a Cypress 68300B/C chipset does work. Drive spinsdown with '/usr/bin/sg_start 0 --pc=2 /dev/sdb'
March 09, 2007, at 01:22 PM by Vegard HB -- WD Mybook 500 won\'t spin down Unslung 6.8
Changed lines 95-97 from:
to:

2007-03-09

  • I am also unsuccessful in making my MyBook? 500GB spindown at all. I've tried the /dev /var, noatime and crontab modifications suggested here, but there is still disk access every ~2nd second at a regular pattern. The same disk access pattern is heard if I boot the NSLU2 with no disks attached and then attach the MyBook?.
March 07, 2007, at 04:56 PM by mk -- Added Prolific PL-3507 information
Added lines 384-385:
  • 7 Mar 2007: Looks like any device with a Prolific PL-3507 chipset will work. I just got a cheap no-name USB/Firewire enclosure from eBay, and 'sdparm --command=stop /dev/sda' worked instantly! Can someone confirm that the PL-3507 chipset always works?
March 06, 2007, at 01:19 PM by Peter Taylor -- Bit of a tidyup.
Added line 9:
Changed lines 145-153 from:

I've tested this on my NSLU2 with OpenSlug 2.7 installed, I think a similar approach should work on Unslung as well. Any comments appreciated.

Note - the file "/proc/diskstats" does not exist on Unslung 5.5, so this technique won't work directly on Unslung boxes.

  • note 11th Sept 2006

Installing scsi-idle_2.4.23-r1_armeb.ipk onto unslung 6.8 fails as : ERROR: Cannot satisfy the following dependencies for scsi-idle:

         libgcc1 (>= 3.4.4) libc6 (>= 2.3.5+cvs20050627) **
to:

Note - the file "/proc/diskstats" does not exist on Unslung 5.5, so this technique won't work directly on Unslung boxes. There is however a method that can be used on unslung, this is detailed below.

Added line 213:

March 06, 2007, at 01:10 PM by Peter Taylor -- bit of a tidy up
Added lines 5-12:
Added line 27:

Added line 69:

Added line 95:

Added line 267:

March 05, 2007, at 10:53 AM by Joop Verdoorn --
Changed lines 351-361 from:

NOTE: I've also applied this script on my Unslung6.8 slug, but it's 32 Mb RAM is almost used now:

bash-3.2# free

              total         used         free       shared      buffers
  Mem:        30524        28788         1736            0         4900
 Swap:            0            0            0

I've got the firefly mediaserver and bash running alongside the original Linksys app and appr. 5% left....

to:
March 05, 2007, at 10:05 AM by Joop Verdoorn --
Changed lines 357-359 from:

Total: 30524 28788 1736

to:
March 05, 2007, at 10:04 AM by Joop Verdoorn --
Added line 359:
March 05, 2007, at 10:03 AM by Joop Verdoorn --
March 05, 2007, at 10:02 AM by Joop Verdoorn --
Added line 358:
March 05, 2007, at 10:01 AM by Joop Verdoorn --
Added line 352:
March 05, 2007, at 10:00 AM by Joop Verdoorn --
Deleted line 351:
March 05, 2007, at 09:59 AM by Joop Verdoorn --
Added line 352:
March 05, 2007, at 09:57 AM by Joop Verdoorn --
Added lines 351-358:

NOTE: I've also applied this script on my Unslung6.8 slug, but it's 32 Mb RAM is almost used now: bash-3.2# free

              total         used         free       shared      buffers
  Mem:        30524        28788         1736            0         4900
 Swap:            0            0            0

Total: 30524 28788 1736 I've got the firefly mediaserver and bash running alongside the original Linksys app and appr. 5% left....

March 04, 2007, at 11:36 PM by jjh -- added note on how to activate automatic spindown on slugOS
Added lines 88-89:

Note for SlugOS: You can now activate automatic spindown functionality by editing the /etc/default/scsi-idle file.

March 02, 2007, at 10:37 PM by jjh --
Changed lines 373-374 from:
  • Raidsonic IB-351UE-B also works (spins down using scsci-stop on SlugOS). Can't find 'prolific' anywhere on the chip but the raidsonic faq says it also contains a prolific chip.
to:
  • Raidsonic IB-351UE-B also works (spins down using scsci-stop on SlugOS). Can't find 'prolific' anywhere on the chip but the raidsonic faq says the case also contains a prolific chip.
March 02, 2007, at 10:36 PM by jjh --
Changed lines 372-374 from:
  • Raidsonic IB-351UE-B also works (spins down using scsci-stop on SlugOS). Can't find 'prolific' anywhere on the chip but the raidsonic homepage says it also contains a prolific chip.
to:
  • Raidsonic IB-351UE-B also works (spins down using scsci-stop on SlugOS). Can't find 'prolific' anywhere on the chip but the raidsonic faq says it also contains a prolific chip.
March 02, 2007, at 10:35 PM by jjh --
Changed line 372 from:
to:
  • Raidsonic IB-351UE-B also works (spins down using scsci-stop on SlugOS). Can't find 'prolific' anywhere on the chip but the raidsonic homepage says it also contains a prolific chip.
February 25, 2007, at 02:05 PM by Richard -- Note on WD My Book drives
Changed lines 83-84 from:
to:
  • I have a Western Digital MyBook? Essential 500GB (like Anguel). The drive span down with the original firmware, but once upgraded to V2.3R63 of the linksys firmware it did not seem to spin down anymore (but I did not fully test at this stage - just noted in passing). Following the installation of Unslung 6.8 onto a 4GB usb microdive on port 2, I can confirm that the MyBook? on port 1 never spins down. Richard 2007-02-25
February 24, 2007, at 11:19 AM by landeshauptbill --
Changed lines 82-83 from:
to:
  • like Tobbe: WD MyBook? 250 on Disk 1, Unslung 6.8 to Stick on Disk 2 + Ext3flash, no additional spindown scripts, landeshauptbill 2007-02-24
February 20, 2007, at 08:34 AM by espen at gyfgafgufdk -- Scsi-idle solution for Unslung
Added lines 183-203:

Shell-only scsi-idle without kernel patch for Unslung

By Espen

Unslung 6.8 does not provide /proc/diskstats, so the above solution won't work directly. However, you can use /proc/loadavg which gives a good indication of whether your slug is idle. I run this script which checks /proc/loadavg every 10 minutes to decide if the hard drive should be spun down.

#!/bin/bash

while [ true ]; do
  load="$(cat /proc/loadavg |cut -d ' ' -f 1|cut -b '1,3-4')"
  if [ "$load" -lt "105" ]; then
    /opt/sbin/scsi-stop /dev/sda
  fi
  sleep 600
done

This solution works with Unslung 6.8 using a LaCie? Porsche USB drive (250 GB Hitachi hard drive).


February 19, 2007, at 03:05 PM by espen at gyfgafgufdk -- Reformated paragraph
Changed lines 243-244 from:
  • [Unslung] Cron runs an hourly syncronization of the system clock (hwclock) and three times a day it checks if the disk is full. Whenever cron executes a job it is logged in /var/log/messages, which causes the disk to spin up. Since these jobs are not vital for your slug, you can avoid this spin up by editing /etc/crontab so the jobs are only run once a day. Change '0 0-23/8 * * * root /usr/sbin/CheckDiskFull? &>/dev/null' to '0 0 * * * root /usr/sbin/CheckDiskFull? &>/dev/null' and '1 * * * * root /usr/sbin/hwclock -s &>/dev/null' to '1 0 * * * root /usr/sbin/hwclock -s &>/dev/null'.
to:
  • [Unslung] Cron runs an hourly syncronization of the system clock (hwclock) and three times a day it checks if the disk is full. Whenever cron executes a job it is logged in /var/log/messages, which causes the disk to spin up. Since these jobs are not vital for your slug, you can avoid this spin up by editing /etc/crontab so the jobs are only run once a day. These lines in crontab will run hwclock and CheckDiskFull? once a day (at midnight):
0 0 * * * root /usr/sbin/CheckDiskFull &>/dev/null
1 0 * * * root /usr/sbin/hwclock -s &>/dev/null
February 19, 2007, at 03:01 PM by espen at gyfgafgufdk -- Disabling cron jobs in Unslung to avoid spin up
Added lines 243-244:
  • [Unslung] Cron runs an hourly syncronization of the system clock (hwclock) and three times a day it checks if the disk is full. Whenever cron executes a job it is logged in /var/log/messages, which causes the disk to spin up. Since these jobs are not vital for your slug, you can avoid this spin up by editing /etc/crontab so the jobs are only run once a day. Change '0 0-23/8 * * * root /usr/sbin/CheckDiskFull? &>/dev/null' to '0 0 * * * root /usr/sbin/CheckDiskFull? &>/dev/null' and '1 * * * * root /usr/sbin/hwclock -s &>/dev/null' to '1 0 * * * root /usr/sbin/hwclock -s &>/dev/null'.
February 19, 2007, at 02:31 PM by espen at gyfgafgufdk -- Added description of noatime for Unslung 6.8
Changed lines 237-238 from:
  • Add the noatime mount option in /etc/fstab to all partitions on the disk. (This will prevent to wake up the disk for cached read access, just to update the 'last access time' flag of the file.)
to:
  • Add the noatime mount option in /etc/fstab to all partitions on the disk. This will prevent the disk from waking up for cached read access, just to update the 'last access time' flag of the file. This method will not work in Unslung 6.8, since /etc/fstab is overwritten at reboot. Instead you can make a boot script (I call it /opt/etc/init.d/S90noatime) which remounts the partions with noatime. The commands you need in the script are mount -o remount,noatime /dev/sda1 and mount -o remount,sync,noatime /dev/sda2.
February 07, 2007, at 07:32 PM by fcarolo -- removed broken wikilink
Changed lines 143-144 from:

Using Ruud's idea, except implemented as a shell script so you don't need Perl (which is great, but takes a lot of space if you're running from flash only). This seems to work fine with the vanilla OpenSlug firmware, a ByteCC 2.5" external enclosure, and a Seagate 40GB 2.5" drive.

to:

Using Ruud's idea, except implemented as a shell script so you don't need Perl (which is great, but takes a lot of space if you're running from flash only). This seems to work fine with the vanilla OpenSlug firmware, a ByteCC 2.5" external enclosure, and a Seagate 40GB 2.5" drive.

February 05, 2007, at 10:29 PM by ST -- correcter var/log comment
Changed line 269 from:
  1. from JNC : moving only /var/log does not make my disk to spindown. It seems necessary to move the full /var
to:
  1. following lines might need to be adjusted according to your OS and/or installed services
February 03, 2007, at 08:32 AM by JNC --
Changed line 258 from:
  • Create the following mount_var_dev.sh script :
to:
  • Create the following mount_var_dev.sh script in /etc/init.d :
February 02, 2007, at 06:01 PM by JNC --
Added line 269:
  1. from JNC : moving only /var/log does not make my disk to spindown. It seems necessary to move the full /var
February 02, 2007, at 05:59 PM by JNC --
Changed lines 266-267 from:
to:
  1. From JNC : this command does not exist on my slug (release 2.7)
January 26, 2007, at 10:47 AM by Anguel Stankov --
Changed lines 58-59 from:

[Anguel]: As far as I see from the specs only 2.5" drives with Enhanced Adaptive Battery Life Extender 3.0 technology will really spin down. All other 2.5" and 3.5" drives will only go into Low RPM mode but will not stop spinning completely. Request: Please also confirm that 2.5" Hitachi drives will keep their APM spindown settings permanently after being set with the Power Booster utility under Windows. -- Anguel

to:

[Anguel]: As far as I see from the Hitachi specs only 2.5" drives with Enhanced Adaptive Battery Life Extender 3.0 technology will really spin down. All other 2.5" and 3.5" drives will only go into Low RPM mode but will not stop spinning completely. Request: Can someone please confirm that 2.5" Hitachi drives will keep their APM spindown settings permanently after being set once with the Power Booster utility under Windows. -- Anguel

January 26, 2007, at 10:39 AM by Anguel Stankov --
Changed lines 58-59 from:

As far as I see from the specs only 2.5" drives with Enhanced Adaptive Battery Life Extender 3.0 technology will really spin down. All other 2.5" and 3.5" drives will only go into Low RPM mode but will not stop spinning completely. [Request]: Please also confirm that 2.5" Hitachi drives keep their APM spindown settings permanently after being set with the Power Booster utility under Windows. -- Anguel

to:

[Anguel]: As far as I see from the specs only 2.5" drives with Enhanced Adaptive Battery Life Extender 3.0 technology will really spin down. All other 2.5" and 3.5" drives will only go into Low RPM mode but will not stop spinning completely. Request: Please also confirm that 2.5" Hitachi drives will keep their APM spindown settings permanently after being set with the Power Booster utility under Windows. -- Anguel

January 26, 2007, at 10:38 AM by Anguel Stankov -- Hitachi spin down
Changed lines 58-59 from:

[Request by Anguel]: Please confirm that 2.5" Hitachi drives keep their APM spindown settings permanently after being set with the Power Booster utility under Windows.

to:

As far as I see from the specs only 2.5" drives with Enhanced Adaptive Battery Life Extender 3.0 technology will really spin down. All other 2.5" and 3.5" drives will only go into Low RPM mode but will not stop spinning completely. [Request]: Please also confirm that 2.5" Hitachi drives keep their APM spindown settings permanently after being set with the Power Booster utility under Windows. -- Anguel

January 26, 2007, at 10:23 AM by Anguel Stankov -- Power Booster
Added lines 58-59:

[Request by Anguel]: Please confirm that 2.5" Hitachi drives keep their APM spindown settings permanently after being set with the Power Booster utility under Windows.

January 20, 2007, at 06:06 PM by nschum -- another case added to compatibility list
Changed lines 332-335 from:

These are reported to work. Please add complete model details to this list, including USB ID numbers.

[ How to determine which chipset is in your usb box ? ]

to:

These are reported to work. Please add complete model details to this list, including USB ID numbers (see /proc/bus/usb/devices).

Added lines 363-367:
 P:  Vendor=152d ProdID=2336 Rev= 1.00
S:  Manufacturer=JMicron
S:  Product=JM20336 SATA, USB Combo
January 10, 2007, at 04:55 PM by Anguel Stankov -- WD Mybook 500GB
Changed line 77 from:
  • Note by Anguel Stankov: I do also have a Western Digital MyBook? Essential 500GB I bought with my NSLU2 in Nov 2006. And it does not spin down on the NSLU2. I also reverted to the original Linksys firmware but it still does not spin down. There is also another strange problem - from time to time the NSLU2 just does not boot up - only the ethernet light is on and the slug freezes - I have to unplug the power connector. Then it boots up normaly again - very strange. UPDATE: The rc.bootbin and rc.local scripts given at http://www.nslu2-linux.org/wiki/HowTo/SetSpinDownTimeOnMaxtorOneTouch seem to make my WD MyBook? 500GB spin down with Unslung 5.5 only. I cannot make spindown work with Unslung 6.8 or original Linksys firmware v23RA5. This spin-down problem is also reported in the "nslu2-general" newsgroup.
to:
  • Note by Anguel Stankov: I have a Western Digital MyBook? Essential 500GB. The drive spins down with Unslung 5.5 only (I have no additional packages installed and I don't use any additional spindown scripts). Unfortunately I cannot make spindown work with Unslung 6.8 or original Linksys firmware v23RA5. This spin-down problem is also reported in the "nslu2-general" newsgroup.
Changed lines 79-80 from:
to:
  • Question to Tobbe: Please tell us if you are using additional spindown scripts.
January 08, 2007, at 07:28 PM by chacko --
Added lines 333-334:

[ How to determine which chipset is in your usb box ? ]

January 08, 2007, at 01:36 PM by Anguel Stankov --
Changed lines 77-78 from:
  • Note by Anguel Stankov: I do also have a Western Digital MyBook? Essential 500GB I bought with my NSLU2 in Nov 2006. And it does not spin down on the NSLU2. I also reverted to the original Linksys firmware but it still does not spin down. There is also another strange problem - from time to time the NSLU2 just does not boot up - only the ethernet light is on and the slug freezes - I have to unplug the power connector. Then it boots up normaly again - very strange.

UPDATE: The rc.bootbin and rc.local scripts given at http://www.nslu2-linux.org/wiki/HowTo/SetSpinDownTimeOnMaxtorOneTouch seem to make my WD MyBook? 500GB spin down with Unslung 5.5 only. I cannot make spindown work with Unslung 6.8 or original Linksys firmware v23RA5. This spin-down problem is also reported in the "nslu2-general" newsgroup.

to:
  • Note by Anguel Stankov: I do also have a Western Digital MyBook? Essential 500GB I bought with my NSLU2 in Nov 2006. And it does not spin down on the NSLU2. I also reverted to the original Linksys firmware but it still does not spin down. There is also another strange problem - from time to time the NSLU2 just does not boot up - only the ethernet light is on and the slug freezes - I have to unplug the power connector. Then it boots up normaly again - very strange. UPDATE: The rc.bootbin and rc.local scripts given at http://www.nslu2-linux.org/wiki/HowTo/SetSpinDownTimeOnMaxtorOneTouch seem to make my WD MyBook? 500GB spin down with Unslung 5.5 only. I cannot make spindown work with Unslung 6.8 or original Linksys firmware v23RA5. This spin-down problem is also reported in the "nslu2-general" newsgroup.
January 08, 2007, at 01:35 PM by Anguel Stankov -- Update on WD MyBook Spindown
Changed lines 77-78 from:
  • I do also have a Western Digital MyBook? Essential 500GB I bought with my NSLU2 in Nov 2006. And it does not spin down on the NSLU2. I also reverted to the original Linksys firmware but it still does not spin down. There is also another strange problem - from time to time the NSLU2 just does not boot up - only the ethernet light is on and the slug freezes - I have to unplug the power connector. Then it boots up normaly again - very strange. - Anguel Stankov
to:
  • Note by Anguel Stankov: I do also have a Western Digital MyBook? Essential 500GB I bought with my NSLU2 in Nov 2006. And it does not spin down on the NSLU2. I also reverted to the original Linksys firmware but it still does not spin down. There is also another strange problem - from time to time the NSLU2 just does not boot up - only the ethernet light is on and the slug freezes - I have to unplug the power connector. Then it boots up normaly again - very strange.

UPDATE: The rc.bootbin and rc.local scripts given at http://www.nslu2-linux.org/wiki/HowTo/SetSpinDownTimeOnMaxtorOneTouch seem to make my WD MyBook? 500GB spin down with Unslung 5.5 only. I cannot make spindown work with Unslung 6.8 or original Linksys firmware v23RA5. This spin-down problem is also reported in the "nslu2-general" newsgroup.

January 02, 2007, at 11:25 PM by Maik -- format correction
Changed lines 186-189 from:
 Following the manual page sg_start sends so called "power conditions" to the external device. The example above uses only the default condition which apparently works for most drives. However, I had to use the following command to spin my external usb down:

/usr/bin/sg_start 0 --pc=2 /dev/sda

to:

Following the manual page sg_start sends so called "power conditions" to the external device. The example above uses only the default condition which apparently works for most drives. However, I had to use the following command to spin my external usb down:

  /usr/bin/sg_start 0 --pc=2 /dev/sda
Changed line 194 from:
  The following script should do the trick. 
to:
  The following script should spin down the idle drive using sg_start 
January 02, 2007, at 11:22 PM by Maik -- additional parameter for sg_stop
Added lines 186-191:
 Following the manual page sg_start sends so called "power conditions" to the external device. The example above uses only the default condition which apparently works for most drives. However, I had to use the following command to spin my external usb down:

/usr/bin/sg_start 0 --pc=2 /dev/sda

There are also other "power conditions" which might work for you. It is definetly worth checking the man page.

January 02, 2007, at 10:20 PM by Peter Taylor -- added script for sg_start
Changed lines 186-187 from:
  use shell or perl script for automatic powerdown  has anyone got a script to do this??
to:
  The following script should do the trick. 

#!/bin/sh
#
# Script to see if external storage is being used
# if its not being used, place drive in idle
#
# to change to your own config, change /hd to your mount point
#

echo "***************`date`********" >> /var/log/power
t=`fuser -c /hd`
if test "$t"
then
echo "in use" >> /var/log/power
else
echo "not in use, power down." >> /var/log/power
echo "`sg_start --stop /dev/sdb`" >> /var/log/power
fi
echo $t >> /var/log/power
echo "" >> /var/log/power
January 02, 2007, at 06:48 PM by dA --
Changed line 188 from:
to:

by dA

January 02, 2007, at 06:45 PM by dA --
Added line 188:
January 02, 2007, at 06:42 PM by dA --
Changed lines 192-194 from:
  see http://nslu2-info.de/showpost.php?p=20987&postcount=42
to:

See http://nslu2-info.de/showpost.php?p=20987&postcount=42

January 02, 2007, at 06:40 PM by dA --
Added lines 188-194:
  
 LaCie 250GB works also with sg3-utils.

  Type: LaCie 250 GB Vendor: SEAGATE   Model: ST3250823A  Rev: 3.03 
see http://nslu2-info.de/showpost.php?p=20987&postcount=42
December 28, 2006, at 09:30 PM by Peter Taylor --
Changed lines 186-187 from:
  use shell or perl script for automatic powerdown !! has anyone got a script to do this??
to:
  use shell or perl script for automatic powerdown  has anyone got a script to do this??
December 28, 2006, at 09:28 PM by Peter Taylor -- few spelling mistakes and quick change
Changed lines 1-2 from:

Not everyone wants a harddisk running 24/7. A noisy harddisk can be awful and the lifespan of a permanently running HD is shorter, too.

to:

Not everyone wants a harddisk running 24/7. A noisy hard disk can be awful and the lifespan of a permanently running HD is shorter, too.

Changed lines 9-10 from:
  • Disadvantage: Every time you turn off your HD or there is a power loss you have to repeat the procedure if your drive doesnt support he KEEP_OVER_RESET-flag.
to:
  • Disadvantage: Every time you turn off your HD or there is a power loss you have to repeat the procedure if your drive doesn't support he KEEP_OVER_RESET-flag.
Changed lines 15-16 from:

All methods most often require modifications concerning the syslog- and other daemons because of their behaviour of writing time-marks into their log-files (especially syslog), as this will cause your HD to spin up at certain intervalls.

to:

All methods most often require modifications concerning the syslog- and other daemons because of their behaviour of writing time-marks into their log-files (especially syslog), as this will cause your HD to spin up at certain intervals.

Changed line 21 from:

Any drive can have a spindown timeout, provided:

to:

Any drive can have a spindown time-out, provided:

Changed line 29 from:
  • Harddisk with separate IDE and power connectors, eg, some [[http://www.raidsonic.de/de/pages/products/external_cases.php?we_objectID=3206 | IcyBox?] models.
to:
  • Hard disk with separate IDE and power connectors, eg, some [[http://www.raidsonic.de/de/pages/products/external_cases.php?we_objectID=3206 | IcyBox?] models.
Changed lines 183-185 from:
  powerdown hdd: /usr/bin/sg_start 0 -pc=3 /dev/sda
  use shell or perl script for automatic powerdown
to:
  to powerdown a hdd: /usr/bin/sg_start --stop /dev/sda

  use shell or perl script for automatic powerdown !! has anyone got a script to do this??
December 19, 2006, at 09:46 AM by Tobbe -- Added more info to the \"Note\" about WD MyBook
Changed lines 78-79 from:
to:
  • I have a WD MyBook? 250GB and I have never had any problems like that. It spins up and down like it should. I'm running unslung 6.8. - Tobbe 2006-12-19
December 18, 2006, at 10:04 PM by Patrik Weiskircher pat at icore dot at -- I\'m stupid. Removed unnecessary if.
Changed lines 166-168 from:
            if [ $up = 1 ]; then
                    scsi-stop /dev/$disk
            fi
to:
            scsi-stop /dev/$disk
December 18, 2006, at 10:02 PM by Patrik Weiskircher pat at icore dot at -- little modification to the bash script to make it work for me
Changed line 151 from:

state=`grep "\s$disk\s" /proc/diskstats`

to:

state=`grep " $disk " /proc/diskstats`

Changed line 158 from:
   newstate=`grep "\s$disk\s" /proc/diskstats`
to:
   newstate=`grep " $disk " /proc/diskstats`
Changed lines 165-166 from:
            state=`grep "\s$disk\s" /proc/diskstats`
            scsi-stop /dev/$disk
to:
            state=`grep " $disk " /proc/diskstats`
            if [ $up = 1 ]; then
                    scsi-stop /dev/$disk
            fi
December 18, 2006, at 09:10 AM by marcusb -- rearranging stuff
Changed lines 1-12 from:

Contents

Not everyone wants a harddisk running 24/7. A noisy harddisk right beside is awful and the lifespan of a permanently running HD is shorter, too.

to:

Not everyone wants a harddisk running 24/7. A noisy harddisk can be awful and the lifespan of a permanently running HD is shorter, too.

Warning: As described here, most disks do not tolerate a large number of spinups.

Deleted line 18:

Deleted line 57:

Changed lines 69-72 from:

By Miro Dietiker As i see, some disks of higher price (and quality?) power down out-of-the-box with a meaningful value configured. If you have a USB disk which does this, extend this list please.

to:

Some disks power down out-of-the-box. If you have a USB disk which does this, extend this list please.

Deleted line 78:

Deleted line 178:

Changed line 186 from:

to:
Changed line 275 from:

to:
December 18, 2006, at 09:03 AM by marcusb -- rearranging stuff
Changed lines 203-204 from:

A Linux system usually has many processes that access that disk from time to time. These need to be tweaked, otherwise they will cause the drive to spin up very often. Here is a list of things that you may need to do, depending on your system and the packages installed:

to:

A Linux system usually has many processes that access that disk from time to time. These need to be tweaked, otherwise they will cause the drive to spin up very often. Basically, you need to either disable the offending file accesses (by turning off or reconfiguring daemons), or move the files being written elsewhere, for example to a USB stick, a network mount, or a tmpfs (only for volatile data).

Here is a list of things that you may need to do, depending on your system and the packages installed:

Added lines 209-212:
  • syslogd generates periodic 'MARK' timestamps unless disabled by adding the -m0 command line option (in /etc/default/syslogd on Debian systems).
  • Disable or move some of the log files (in /etc/syslog.conf), but keep in mind that logs are often very useful. A nice solution is to have syslogd send everyting over the network to a remote host.
Changed lines 218-219 from:

One solution is to move back /dev and /var to RAM.

to:

Move /dev and /var to RAM.

Note: It seems to be overkill to move all of /var to RAM. It may be better to follow the instructions above, and handle the remaining offending processes one by one. Also, if you use udev (like Debian does) then /dev is no longer on disk.

December 18, 2006, at 08:40 AM by marcusb -- rearranging stuff
Changed lines 203-209 from:

A Linux system usually has many processes that access that disk from time to time. These need to be tweaked, otherwise they will cause the drive to spin-up very often. Here is a list of things that you may need to do:

  • [Debian] Adding 'RAMRUN=yes' and 'RAMLOCK=yes' to '/etc/default/rcS' will make Debian put your '/var/run' and '/var/lock' in a tmpfs instead of on disk.

The solution

to:

A Linux system usually has many processes that access that disk from time to time. These need to be tweaked, otherwise they will cause the drive to spin up very often. Here is a list of things that you may need to do, depending on your system and the packages installed:

  • Add the noatime mount option in /etc/fstab to all partitions on the disk. (This will prevent to wake up the disk for cached read access, just to update the 'last access time' flag of the file.)
  • [Debian] Adding RAMRUN=yes and RAMLOCK=yes to /etc/default/rcS will make Debian put your /var/run and /var/lock in a tmpfs instead of on disk.
  • [Debian]
  • See this page for how to find out which process is causing your disk to spin up.
Changed lines 218-229 from:

Creating a RAM resource, and attach /dev and /ram is easy (mount -t ramfs ramfs ... command). But, as the RAM memory is volatile, the challenge is to create a script that will copy all files from /dev and /var into the RAM resources you created, each time you boot the NSLU2. We must deal with two issues :

  • where is the correct location for my script?
  • what is the command to use to copy the unregular files from /dev ?

The procedure

  • cd /etc/init.d

(all init script should be located in this directory, regardless the run levels they are involved in. There should be a link to this script in the run-level-dedicated directory.)

to:

The challenge is to create a script that will copy all files from /dev and /var into the RAM resources you created, each time you boot the NSLU2.

Changed lines 262-263 from:

(all init scripts are supposed to be in /etc/init.d, and linked to the appropriate directory for the appropriate run-level).

to:
Changed lines 265-286 from:
  • cd /etc
  • vi fstab

for all partition from the disk that must spin down, add ,noatime to the 4th column (there should be only default). (this will prevent to wake up the disk for cached read access, just to update the 'last access time' flag of the file)

Before

/dev/sda1       /       ext2    defaults        1  1
/dev/sda2       /home   ext2    defaults        1  2

After

/dev/sda1       /       ext2    defaults,noatime        1  1
/dev/sda2       /home   ext2    defaults,noatime        1  2
  • shutdown -r 0

(reboot)

to:
  • reboot
Changed line 282 from:

Spinning down with @sdparm@

to:

Spinning down with sdparm

Changed line 320 from:
  • atechweb LAN Server HD9?-U2lA? (Not supporting "stop" via USB but "inside")
to:
  • atechweb LAN Server HD9-U2lA (Not supporting "stop" via USB but "inside")
Deleted lines 327-331:

Why does it spin up after only five minutes?

To answer this sort of question, see HowtoIdentifyWhichProcessesAccessDisk.

December 18, 2006, at 08:23 AM by marcusb -- cleanups
Changed lines 15-17 from:

For various technical reasons it is generally not possible to adjust the standby timer of an IDE disk connected through a USB adapter (including turnkey external USB drives). See the sdparm page for the technical reasons.

  • Method 1: Temporarily connect the drive via its IDE connector directly to another Linux box and run hdparm to set the timer (the -S option is what you're looking for, PLEASE read the hdparm man page before even thinking about running it)[OS independent]. You need an enclosure with separate power and IDE connectors to do this.
to:
  • Method 1: Temporarily connect the drive via its IDE connector directly to another Linux box and run hdparm to set the spindown timer (the -S option is what you're looking for, PLEASE read the hdparm man page before even thinking about running it)[OS independent]. You need an enclosure with separate power and IDE connectors to do this.
Deleted lines 18-19:

A very similiar method is using a vendor-specific tool (like IBM Feature Tool) to setup the spin-down time before installing the drive into its enclosure.

Added lines 34-35:

For various technical reasons it is generally not possible to adjust the standby timer of an IDE disk connected through a USB adapter (including turnkey external USB drives). See the sdparm page for the technical reasons.

Changed lines 201-221 from:

System modifications for HD spin-down

OK, you could tell me : what is this update? I have read much in the MaxtorOneTouch-Howto about the procedure to move /dev and /var back to RAM, so, why another section ?

That's definitively true. Many thanks to those who contributed to write those pages. I just found 2 problems with what I read :

  • it was for Unslung version only (not Openslug) [Unslung version]
  • the process was incomplete (only for /var) and impossible to extend to /dev

As I don't like to complain without acting, here is my contribution from my experience. I hope it can be useful to anybody.

Preamble

The problem

Once everything is running fine, my disk (Maxtor One Touch) does not spin down, as the NSLU2 regularly accesses files from /dev and /var.

to:

System modifications

A Linux system usually has many processes that access that disk from time to time. These need to be tweaked, otherwise they will cause the drive to spin-up very often. Here is a list of things that you may need to do:

  • [Debian] Adding 'RAMRUN=yes' and 'RAMLOCK=yes' to '/etc/default/rcS' will make Debian put your '/var/run' and '/var/lock' in a tmpfs instead of on disk.
Changed line 327 from:

[= P: Vendor=067b ProdID?=3507 Rev= 0.01

to:

[@ P: Vendor=067b ProdID?=3507 Rev= 0.01

Changed lines 330-331 from:
 Chip: not visible, assuming(!) Profilic PL3507?=]
to:
 Chip: not visible, assuming(!) Profilic PL3507?@]
Changed line 339 from:

[= P: Vendor=04b4 ProdID?=6830 Rev= 2.40

to:

[@ P: Vendor=04b4 ProdID?=6830 Rev= 2.40

Changed lines 341-342 from:
 Chip: CY7C68300B?-56PVXC=]
to:
 Chip: CY7C68300B?-56PVXC@]
Changed line 344 from:

[= P: Vendor=0402 ProdID?=5621 Rev= 1.03

to:

[@ P: Vendor=0402 ProdID?=5621 Rev= 1.03

Changed lines 346-347 from:
 Chip: ALI M5621 + Oxford FW=]
to:
 Chip: ALI M5621 + Oxford FW@]
Changed line 349 from:

[= P: Vendor=05e3 ProdID?=0702 Rev= 0.33

to:

[@ P: Vendor=05e3 ProdID?=0702 Rev= 0.33

Changed lines 351-352 from:
 Chip: GL811E? (FTR: CPU: RDC R2882)=]
to:
 Chip: GL811E? (FTR: CPU: RDC R2882)@]
December 18, 2006, at 08:14 AM by marcusb -- cleanups
Changed lines 15-16 from:

For various technical reasons it is generally not possible to adjust the standby timer of an IDE disk connected through a USB adapter (including turnkey external USB drives). See the sdparm page and the section below on sdparm for the technical reasons.

to:

For various technical reasons it is generally not possible to adjust the standby timer of an IDE disk connected through a USB adapter (including turnkey external USB drives). See the sdparm page for the technical reasons.

Changed lines 326-328 from:

Why can't I use sdparm to do spindown-magic?

I corresponded with the developer of sdparm (the SCSI version of hdparm) about using this tool to either set spin-down timers or stop/start disks, here's his explanation for why this can't be done currently.

to:

Spinning down with @sdparm@

This requires an IDE-USB adapter that supports the SCSI start/stop command.

To stop the drive:

 # sdparm --command=stop /dev/sdb
 /dev/sdb: SAMSUNG   SP1604N           TM10

The drive is started by any disk access, or this command:

 # sdparm --command=start /dev/sdb
 /dev/sdb: SAMSUNG   SP1604N           TM10
Changed lines 338-398 from:

However the major weakness is in the SCSI<->ATA protocol conversion code/silicon inside the external enclosure housing the IDE disk. If it is like the ones I have tested, it supports READ(10)/WRITE(10)/INQUIRY/ READ_CAPACITY SCSI commands only. The MODE_SENSE commands are dummied up by the USB mass storage driver (within linux kernel) so as to not upset the sd (scsi disk) driver.

Spinning down (or up) a disk requires the SCSI START_STOP_UNIT command to be supported. Even SCSI to ATA Translation (SAT) layer that linux does control (e.g. libata for SATA disks) has only recently added that command (a year after libata was released in the kernel). Convincing people that such commands are worthwhile is not an easy task!

So I encourage your persitence but fear the exercise will be futile. Hopefully in a year or so better SAT layers will surface.

an example of a working sdparm (NOT nslu2 btw) With a 2.6.11 Kernel (have not tried others) on a x86 (Via C3) it's possible to spin down a Samsung SV1640N? in an ICY Box "blue" using "sdparm-0.95"

 # sdparm --command=stop /dev/sdb
 /dev/sdb: SAMSUNG   SP1604N           TM10

And turn it on:

 # sdparm --command=start /dev/sdb
 /dev/sdb: SAMSUNG   SP1604N           TM10

hdparm or any disk acces can start it:

 # hdparm -t /dev/sdb
 /dev/sdb:
  Timing buffered disk reads:    2 MB in  5.76 seconds = 355.73 kB/sec

 # hdparm -t /dev/sdb
 /dev/sdb:
  Timing buffered disk reads:   72 MB in  3.06 seconds =  23.56 MB/sec

Wasn't actually tried on NSLU2 (other kernel, no enivronment etc.). But maybe it will work there too? At least with that case that disk and that USB driver it seems to be possible to spin down an USB Drive!

[Zhyla] This didn't work on my "Genesys" USB adapter on my FC3 box (2.6.9 kernel, sdparm-0.95 and 0.96beta).

Can you try running --command=stop and then --command=ready? It should indicate that it isn't ready (i.e. it's spun down).

[rz] Nice idea, but sorry: --command=ready always shows "ready" regardless if the disk is really spun down/sleeping or not.


[rz] Have tried several cases with Linux version 2.6.11 with a Samsung SP1604?(169GB) and an old Maxtor 53073U6(8GB)

[rz]Supporting(!) "stop" (45 Euro Raid Sonic ICY Box 3.5 Combo (USB+FW)):

 P:  Vendor=067b ProdID?=3507 Rev= 0.01
to:

Adapters which support start/stop

These are reported to work. Please add complete model details to this list, including USB ID numbers.

  • Raidsonic Icy Box IB-351UE-BL

[= P: Vendor=067b ProdID?=3507 Rev= 0.01

Changed lines 346-351 from:
 Chip: not visible, assuming(!) Profilic PL3507?

[mag] Another enclosure supporting stop is PPA ME-780U2-2162, which also uses a Prolific chipset.

[rz]Not supporting "stop" (15 Euro Evertech):

 P:  Vendor=04b4 ProdID?=6830 Rev= 2.40
to:
 Chip: not visible, assuming(!) Profilic PL3507?=]
  • PPA ME-780U2-2162, which also uses a Prolific chipset.

There is a list of chipsets used in various Raidsonic enclosures.

Adapters which do NOT support start/stop

  • Evertech

[= P: Vendor=04b4 ProdID?=6830 Rev= 2.40

Changed lines 357-360 from:
 Chip: CY7C68300B?-56PVXC

[rz]Not supporting "stop" (60 Euro Delock? Combo)

 P:  Vendor=0402 ProdID?=5621 Rev= 1.03
to:
 Chip: CY7C68300B?-56PVXC=]
  • Delock? Combo

[= P: Vendor=0402 ProdID?=5621 Rev= 1.03

Changed lines 362-365 from:
 Chip: ALI M5621 + Oxford FW

[rz]Not supporting "stop" via USB but "inside" (55Euro atechweb LAN Server HD9?-U2lA?)

 P:  Vendor=05e3 ProdID?=0702 Rev= 0.33
to:
 Chip: ALI M5621 + Oxford FW=]
  • atechweb LAN Server HD9?-U2lA? (Not supporting "stop" via USB but "inside")

[= P: Vendor=05e3 ProdID?=0702 Rev= 0.33

Changed lines 367-372 from:
 Chip: GL811E? (FTR: CPU: RDC R2882)

[rz]As the prolific chip set used by radsonic do spin down the disk (really) that can't be a problem with linux, at least not with linux 2.6.11.

to:
 Chip: GL811E? (FTR: CPU: RDC R2882)=]
  • Raidsonic Icy Box IB-351UE - Agere Chip
Deleted lines 371-396:

[rz]What chip set is used in which Raidsonic case:

IB-550UE Prolific (PL3507?) - Agere (FW8028?) since 02/2005
IB-350/351/360UE Prolific (PL3507?) - Agere (FW8028?)
IB-350/351US Prolific (PL2507?) - Silicon Image (Sil36CT80?)
IB-350/351/360U Cypress (7C68300A)
IB-250/251U Cypress (7C68300A)
IB-355U Ali (M5621A1?)
IB-525U Ali (M5621A1?)
IB-550U Ali (M5621A1?)
IB-350StS without any

http://www.raidsonic.de/de/pages/service/faq.php (It's only in the german FAQ)


IB-351UE - Agere Chip

      Seagate ST3?? 7200.7 (does not accept the KEEP_OVER_RESET-flag: hdparm -K ...)
      sdparm 0.94
      Kernel 2.6.13 (on desktop, not slug) spins down with sdparm --command=stop /dev/sda
      Seagate has a tool called SeaTool?? (like IBM/Hitachi's Featuretool), but it does not
      have any features to set powermanagement or spin down timers.

Deleted line 372:

Why does my disk not spin down?

Changed lines 374-377 from:

Which process is accessing the disk?

To answer this sort of question, see HowtoIdentifyWhichProcessesAccessDisk

to:

To answer this sort of question, see HowtoIdentifyWhichProcessesAccessDisk.

December 18, 2006, at 06:12 AM by marcusb -- cleanups
Changed lines 3-6 from:
to:
Changed lines 10-14 from:

Motivation

Not everyone wants a 24/7 running harddisk. A noisy harddisk right beside is awful and the lifespan of a permanently running HD is shorter, too.

to:

Not everyone wants a harddisk running 24/7. A noisy harddisk right beside is awful and the lifespan of a permanently running HD is shorter, too.

Changed lines 13-14 from:

Quick Summary

to:

Quick Summary

Changed lines 23-24 from:
  • Method 2: Nuy a HD/enlcosure combo which supports down-spinning by itself (e.g. Maxtor OneTouch series, WD Essential Drives)[OS independent]
to:
  • Method 2: Buy a HD/enclosure combo which supports down-spinning by itself (e.g. Maxtor OneTouch series, WD Essential Drives)[OS independent]
Changed lines 32-33 from:

Method 1: Use hdparm on a Linux box with IDE

to:

Method 1: Use hdparm on a Linux PC

Changed line 40 from:
  • Harddisk with separate IDE and power connectors, eg, IcyBox? black [http://www.raidsonic.de/de/pages/products/external_cases.php?we_objectID=3206] [ST: this works fine for me].
to:
  • Harddisk with separate IDE and power connectors, eg, some [[http://www.raidsonic.de/de/pages/products/external_cases.php?we_objectID=3206 | IcyBox?] models.
Changed lines 53-58 from:
  1. Connect the enclosures IDE connector to the HD !WITHOUT REMOVING THE POWER from the HD!

This way the drive is never reset, and will keep its spindown setting. Of course if hdparm -k1 -K1 -S120 actually makes your drives remember their settings this is irrelevant, but for anyone like me whose drives wont remember their settings this is a way to make them spindown.

For those with enclosures that wont let them do this, I use this. The usb-ide and power supply are completely separate, which make this easy.

to:
  1. Connect the enclosures IDE connector to the HD without removing the power from the HD!

This way the drive is never reset, and will keep its spindown setting. Of course if hdparm -k1 -K1 -S120 actually makes your drives remember their settings this is irrelevant, but for anyone like me whose drives wont remember their settings this is a way to make them spindown.

For those with enclosures that wont let them do this, I use this. The IDE-USB and power supply are completely separate, which make this easy.

Changed lines 61-67 from:

Sub-method: You can download the Power Booster utility for 2.5" IBM/Hitachi TravelStar disks. The Power Booster utility will enable the auto spin down feature of the disk. For 3.5" IBM/Hitachi drives (and maybe others), you can download the Feature Tool. Otherwise temporarily install the IDE disk in your ordinary Linux box, read the disk technical documentation and use hdparm to adjust the settings by hand. The trick is to enable APM within the drive itself, so Linux doesn't have to care about it at all. You can't use hdparm to alter the APM settings from the NSLU2 as the USB->IDE adapters are emulated as SCSI host adapters in the Linux kernel which is incompatible with the necessary hdparm options.

[Request by ingeba]: To my knowledge this does not work. Can anyone verify that APM settings may cause NSLU2 connected drives in arbitrary enclosures to spin down? If so, please list drive and enclosure brand and here:

[slavikb] This worked for me (Hitachi 7K250, noname box, Feature Tool). I had to remount root with -noatime option. The drive goes into Low RPM mode after 10 minutes of inactivity.

to:

Variant: You can download the Power Booster utility for 2.5" IBM/Hitachi TravelStar disks. The Power Booster utility will enable the auto spin down feature of the disk. For 3.5" IBM/Hitachi drives (and maybe others), you can download the Feature Tool. Otherwise temporarily install the IDE disk in your ordinary Linux box, read the disk technical documentation and use hdparm to adjust the settings by hand. The trick is to enable APM within the drive itself, so Linux doesn't have to care about it at all. You can't use hdparm to alter the APM settings from the NSLU2 as the USB->IDE adapters are emulated as SCSI host adapters in the Linux kernel which is incompatible with the necessary hdparm options.

[Request by ingeba]: To my knowledge this does not work. Can anyone verify that APM settings may cause NSLU2 connected drives in arbitrary enclosures to spin down? If so, please list drive and enclosure brand here:

  • [slavikb] This worked for me (Hitachi 7K250, noname box, Feature Tool). I had to remount root with -noatime option. The drive goes into Low RPM mode after 10 minutes of inactivity.
Changed line 70 from:

2.Method: Enclosures with integrated spin-down

to:

Method 2: Enclosures with integrated HD

Changed lines 73-74 from:

I just bought a Seagate Baracuda 3.5" drive and installed it in a third party enclosure. Upon contacting their tech support in Europe they stated that:

to:

I just bought a Seagate Barracuda 3.5" drive and installed it in a third party enclosure. Upon contacting their tech support in Europe they stated that:

Changed line 85 from:
to:
  • 13.03.2006: WesternDigital Essential 320 GB USB 2.0 / 3.5" / 7200 rpm
Changed line 87 from:
  • 24.03.2003 Maxtor One Touch - 200 Go USB 2.0 / 3.5 " / 7200 rpm
to:
  • 24.03.2003: Maxtor One Touch - 200 Go USB 2.0 / 3.5 " / 7200 rpm
Changed lines 90-92 from:

Note:* 24.04.2006 I have a WesternDigital? Essential - 250 GB USB 2.0 / 3.5" / 7200 rpm and although it supports spindown by hardware and does so on my laptop, it wont do so on my slug. Even if completly umounted. + Openslug does not find this disk. EDIT: I now have spindown on this disk. Strangly it works with debian. I mounted my /var and /tmp on a usb-stick.

to:

Note:

Changed lines 94-99 from:

3. Method: How to use scsi-idle for spinning down USB disks.

Robert Demski provided a kernel patch as well as a package for the scsi-idle software to be used on the slug.

The build process is quite complicated as it requires setting up a cross-compile environment for the slug currently, until the kernel patch is included in the binary distributions of OpenSlug. The process is described in a blog post on fredericiana.com. Any comments appreciated.

How to use scsi-idle without kernel patch

to:

Method 3: Use scsi-idle

Robert Demski provided a kernel patch as well as a user-space package to be used on the slug. See also this blog post. (The scsi-idle patch is now included in the SlugOS kernels.)

How to use scsi-idle without kernel patch

Deleted line 200:
Changed lines 203-206 from:

System modifications for HD spin-down OR

How to make your standalone USB disk really spindown

[by JNC]

to:

System modifications for HD spin-down

December 17, 2006, at 08:17 PM by rwhitby --
Added lines 461-465:

This page is password protected.

The password is "spindown". Let's see if that stops the automated wiki spam.

December 17, 2006, at 07:12 PM by marcusb --
Changed lines 19-26 from:

For various technical reasons it is not generally possible to adjust the standby timer of an IDE disk connected through a USB adapter (including turnkey external USB drives). See the sdparm page and the section below on sdparm for the technical reasons.

1. Method: So one method available is to temporarily connect the drive via its IDE connector directly to a big Linux box and run hdparm to set the timer (the -S option is what you're looking for, PLEASE read the hdparm man page before even thinking about running it)[OS independent]. You need an enclosure with separate power and IDE connectors to do this.

Advantage: Can be used on every HD which supports standby regardless of the OS.

Disadvantage: Every time you turn off your HD or there is a power loss you have to repeat the procedure if your drive doesnt support he KEEP_OVER_RESET-flag.

to:

For various technical reasons it is generally not possible to adjust the standby timer of an IDE disk connected through a USB adapter (including turnkey external USB drives). See the sdparm page and the section below on sdparm for the technical reasons.

  • Method 1: Temporarily connect the drive via its IDE connector directly to another Linux box and run hdparm to set the timer (the -S option is what you're looking for, PLEASE read the hdparm man page before even thinking about running it)[OS independent]. You need an enclosure with separate power and IDE connectors to do this.
    • Advantage: Can be used on every HD which supports standby regardless of the OS.
    • Disadvantage: Every time you turn off your HD or there is a power loss you have to repeat the procedure if your drive doesnt support he KEEP_OVER_RESET-flag.
Changed lines 27-31 from:

2. Method: This is a sub-variant of the 1.Method. Simply buy a HD/enlcosure combo which supports down-spinning by itself (e.g. Maxtor OneTouch series, WD Essential Drives)[OS independent]. A simple but probably more expensive method (and i've heard Maxtor OneTouch HDs? are rather noisy, too ;).

3. Method: Another method is to use scsi-idle. However, this requires a kernel patch as the corresponding kernel changes are not yet included in the nslu2-linux binaries. See the scsi-idle section below [applies to Openslug, Unslung].

to:
  • Method 2: Nuy a HD/enlcosure combo which supports down-spinning by itself (e.g. Maxtor OneTouch series, WD Essential Drives)[OS independent]
  • Method 3: Use scsi-idle. However, this requires a kernel patch as the corresponding kernel changes are not yet included in the nslu2-linux binaries. See the scsi-idle section below [applies to Openslug, Unslung].
Deleted lines 32-36:

As of now (June 2006) SDPARM will most certainly NOT WORK on non-combo(FW+USB) drives. Tell us if you found further working drives.

[mag: I own a usb-only enclosure that spins down fine with sdparm. I think it's more of a question of the controller it uses rather than combo vs. non-combo.]

Changed lines 36-37 from:

1. Method: How do I spin down my USB hard disks?

to:

Method 1: Use hdparm on a Linux box with IDE

Changed lines 40-41 from:
  • It is possible to have the drive using the power from the usb-ide adapter while plugged into the normal ide of your pc.
to:
  • It is possible to attach the drive to the IDE interface on your PC while using the power from the USB-IDE adapter.
Changed lines 44-61 from:

- Harddisk with separate IDE and power connectors.

eg. IcyBox? black [http://www.raidsonic.de/de/pages/products/external_cases.php?we_objectID=3206] [ST: this works fine for me].

- Another Linux machine to connect it to with hdparm installed.

1) Take your HD and install it the enclosure (especially the power connector to the drive).

2) Turn on your enclosure.

2) Disconnect the enclosure's IDE connector (if connected) and connect the other Linux machine's IDE connector to the HD.

3) Set the spindown-time 'hdparm -k1 -K1 -S120 /dev/hda' where -Sxx specifies the spindown-time. -k1-K1 set the keep over reset-flags if supported.

4) Disconnect the Linux machine's IDE connector

5) Connect the enclosures IDE connector to the HD !WITHOUT REMOVING THE POWER from the HD!

to:
  • Harddisk with separate IDE and power connectors, eg, IcyBox? black [http://www.raidsonic.de/de/pages/products/external_cases.php?we_objectID=3206] [ST: this works fine for me].
  • Another Linux machine to connect it to with hdparm installed.
  1. Take your HD and install it the enclosure (especially the power connector to the drive).
  2. Turn on your enclosure.
  3. Disconnect the enclosure's IDE connector (if connected) and connect the other Linux machine's IDE connector to the HD.
  4. Set the spindown-time 'hdparm -k1 -K1 -S120 /dev/hda' where -Sxx specifies the spindown-time. -k1-K1 set the keep over reset-flags if supported.
  5. Disconnect the Linux machine's IDE connector.
  6. Connect the enclosures IDE connector to the HD !WITHOUT REMOVING THE POWER from the HD!
December 17, 2006, at 06:24 PM by marcusb -- revert spam
Changed lines 1-2 from:

Hello, nice site look this: http://urlcut.com/gucci-handbags

to:

Contents

Motivation

Not everyone wants a 24/7 running harddisk. A noisy harddisk right beside is awful and the lifespan of a permanently running HD is shorter, too.

Quick Summary

For various technical reasons it is not generally possible to adjust the standby timer of an IDE disk connected through a USB adapter (including turnkey external USB drives). See the sdparm page and the section below on sdparm for the technical reasons.

1. Method: So one method available is to temporarily connect the drive via its IDE connector directly to a big Linux box and run hdparm to set the timer (the -S option is what you're looking for, PLEASE read the hdparm man page before even thinking about running it)[OS independent]. You need an enclosure with separate power and IDE connectors to do this.

Advantage: Can be used on every HD which supports standby regardless of the OS.

Disadvantage: Every time you turn off your HD or there is a power loss you have to repeat the procedure if your drive doesnt support he KEEP_OVER_RESET-flag.

A very similiar method is using a vendor-specific tool (like IBM Feature Tool) to setup the spin-down time before installing the drive into its enclosure.

2. Method: This is a sub-variant of the 1.Method. Simply buy a HD/enlcosure combo which supports down-spinning by itself (e.g. Maxtor OneTouch series, WD Essential Drives)[OS independent]. A simple but probably more expensive method (and i've heard Maxtor OneTouch HDs? are rather noisy, too ;).

3. Method: Another method is to use scsi-idle. However, this requires a kernel patch as the corresponding kernel changes are not yet included in the nslu2-linux binaries. See the scsi-idle section below [applies to Openslug, Unslung].

All methods most often require modifications concerning the syslog- and other daemons because of their behaviour of writing time-marks into their log-files (especially syslog), as this will cause your HD to spin up at certain intervalls.

As of now (June 2006) SDPARM will most certainly NOT WORK on non-combo(FW+USB) drives. Tell us if you found further working drives.

[mag: I own a usb-only enclosure that spins down fine with sdparm. I think it's more of a question of the controller it uses rather than combo vs. non-combo.]

For further details check below.

1. Method: How do I spin down my USB hard disks?

Any drive can have a spindown timeout, provided:

  • The disk can take 'hdparm -S120 /dev/hdx' and spindown after 10 minutes.
  • It is possible to have the drive using the power from the usb-ide adapter while plugged into the normal ide of your pc.

Prerequisites:

- Harddisk with separate IDE and power connectors.

eg. IcyBox? black [http://www.raidsonic.de/de/pages/products/external_cases.php?we_objectID=3206] [ST: this works fine for me].

- Another Linux machine to connect it to with hdparm installed.

1) Take your HD and install it the enclosure (especially the power connector to the drive).

2) Turn on your enclosure.

2) Disconnect the enclosure's IDE connector (if connected) and connect the other Linux machine's IDE connector to the HD.

3) Set the spindown-time 'hdparm -k1 -K1 -S120 /dev/hda' where -Sxx specifies the spindown-time. -k1-K1 set the keep over reset-flags if supported.

4) Disconnect the Linux machine's IDE connector

5) Connect the enclosures IDE connector to the HD !WITHOUT REMOVING THE POWER from the HD!

This way the drive is never reset, and will keep its spindown setting. Of course if hdparm -k1 -K1 -S120 actually makes your drives remember their settings this is irrelevant, but for anyone like me whose drives wont remember their settings this is a way to make them spindown.

For those with enclosures that wont let them do this, I use this. The usb-ide and power supply are completely separate, which make this easy.

[ST: Bought an enclosure with internal SATA interface and external SATA/USB interface IcyBox IB-360StUS-B and installed a Samsung 250GB SATA II (SP2504C?) into it. Connected it via SATA (MB to external slot-connector is included) to my big machine and ran hdparm. Voila, the disk spins down.]

Sub-method: You can download the Power Booster utility for 2.5" IBM/Hitachi TravelStar disks. The Power Booster utility will enable the auto spin down feature of the disk. For 3.5" IBM/Hitachi drives (and maybe others), you can download the Feature Tool. Otherwise temporarily install the IDE disk in your ordinary Linux box, read the disk technical documentation and use hdparm to adjust the settings by hand. The trick is to enable APM within the drive itself, so Linux doesn't have to care about it at all. You can't use hdparm to alter the APM settings from the NSLU2 as the USB->IDE adapters are emulated as SCSI host adapters in the Linux kernel which is incompatible with the necessary hdparm options.

[Request by ingeba]: To my knowledge this does not work. Can anyone verify that APM settings may cause NSLU2 connected drives in arbitrary enclosures to spin down? If so, please list drive and enclosure brand and here:

[slavikb] This worked for me (Hitachi 7K250, noname box, Feature Tool). I had to remount root with -noatime option. The drive goes into Low RPM mode after 10 minutes of inactivity.

Either way, you'll have to open your 2.5" USB enclosure and install the disk drive temporarily to a desktop computer using a 2.5" to 3.5" IDE adapter. After that, you can do the APM adjustment in Windows or Linux.

2.Method: Enclosures with integrated spin-down

For Maxtor OneTouch drives see the Maxtor OneTouch HOWTO.

I just bought a Seagate Baracuda 3.5" drive and installed it in a third party enclosure. Upon contacting their tech support in Europe they stated that:

  • Seagate does not support other power management than managed by the running OS
  • Seagate does not support drives to be installed in third party enclosures
  • Seagate disks do not have a function to retain the power management settings

So I guess my advice would be not to buy the Seagate disks.

By Miro Dietiker As i see, some disks of higher price (and quality?) power down out-of-the-box with a meaningful value configured. If you have a USB disk which does this, extend this list please.

  • 13.03.2006: WesternDigital? Essential - 320 GB USB 2.0 / 3.5" / 7200 rpm (All WD Essential drives seem to implement this feature)
  • 24.03.2003 Maxtor One Touch - 200 Go USB 2.0 / 3.5 " / 7200 rpm
  • 11.05.2006: Seagate 250GB USB 2.0 / 3.5" / 7200 RPM

Note:* 24.04.2006 I have a WesternDigital? Essential - 250 GB USB 2.0 / 3.5" / 7200 rpm and although it supports spindown by hardware and does so on my laptop, it wont do so on my slug. Even if completly umounted. + Openslug does not find this disk. EDIT: I now have spindown on this disk. Strangly it works with debian. I mounted my /var and /tmp on a usb-stick.

  • I do also have a Western Digital MyBook? Essential 500GB I bought with my NSLU2 in Nov 2006. And it does not spin down on the NSLU2. I also reverted to the original Linksys firmware but it still does not spin down. There is also another strange problem - from time to time the NSLU2 just does not boot up - only the ethernet light is on and the slug freezes - I have to unplug the power connector. Then it boots up normaly again - very strange. - Anguel Stankov

3. Method: How to use scsi-idle for spinning down USB disks.

Robert Demski provided a kernel patch as well as a package for the scsi-idle software to be used on the slug.

The build process is quite complicated as it requires setting up a cross-compile environment for the slug currently, until the kernel patch is included in the binary distributions of OpenSlug. The process is described in a blog post on fredericiana.com. Any comments appreciated.

How to use scsi-idle without kernel patch

By Ruud Senden

I've managed to automate spindown using scsi-idle without the kernel patch. I've created the perl script listed below based on a script I found at http://www.rootfs.net/jaws/index.php?gadget=Blog&action=SingleView&id=22:

#!/usr/bin/perl -w

$statfile = "/proc/diskstats";
die "$0: Cannot read $statfile\n" unless -r $statfile;

$| = 1;
($disk, $interval) = (@ARGV);
$disk =~ s,/dev/,,;
print "$0: disk: $disk, interval: $interval\n";

$halted_data = $last_seen = '';
while (1) {
  open(STATUS, $statfile);
  ($_) = grep(/^\s+\d+\s+\d+\s+$disk\s/o, <STATUS>);
  close STATUS;

  if ($last_seen eq $_ && $halted_data ne $_) {
    print "Spinning down: $disk\n";
    system "scsi-stop", "/dev/$disk";
    $halted_data = $_;
  }
  $last_seen = $_;
  sleep $interval;
}

Basically what this script does is take a device as the first argument, and an interval in seconds as the second argument. Every interval seconds it will look at /proc/diskstats for the given device, and if the status didn't change the disk will be spun down. The disk will automatically spin up again when accessed (on my system at least).

Installation instructions:

  1. Install perl
  2. Install the scsi-idle package, which can be downloaded from the Yahoo Files section
  3. Save the perl script listed above to your filesystem, for example named autospindown. Make sure the script is executable: chmod +rx autospindown
  4. Edit /etc/default/scsi-idle to list the timeouts for your drive(s), see the instructions in that file for more information.
  5. Edit /etc/init.d/scsi-idle, changing the DAEMON variable to point to the perl script you saved in step 3.
  6. /etc/init.d/scsi-idle start

I've tested this on my NSLU2 with OpenSlug 2.7 installed, I think a similar approach should work on Unslung as well. Any comments appreciated.

Note - the file "/proc/diskstats" does not exist on Unslung 5.5, so this technique won't work directly on Unslung boxes.

  • note 11th Sept 2006

Installing scsi-idle_2.4.23-r1_armeb.ipk onto unslung 6.8 fails as : ERROR: Cannot satisfy the following dependencies for scsi-idle:

         libgcc1 (>= 3.4.4) libc6 (>= 2.3.5+cvs20050627) **

Shell-only scsi-idle without kernel patch

By Chris

Using Ruud's idea, except implemented as a shell script so you don't need Perl (which is great, but takes a lot of space if you're running from flash only). This seems to work fine with the vanilla OpenSlug firmware, a ByteCC 2.5" external enclosure, and a Seagate 40GB 2.5" drive.

This version updates the status more often than the Perl version which prevents waiting almost a complete extra interval cycle under certain circumstances. Feel free to hack this script and make it better as I didn't spend much time on it.

Stripwax adds: The scsi-idle package and the perl script above follow the convention that the drive to idle is e.g. "dev/sda" whereas the below seems to want to expect just e.g. "sda". In my opinion you will need to change the line "disk=$1" below to something like "disk=${1#/dev/}" or similar

#!/bin/sh

disk=$1
interval=$2

state=`grep "\s$disk\s" /proc/diskstats`
count=$interval
up=1

while [ true ]; do
   sleep 10
   count=$(($count-10))
   newstate=`grep "\s$disk\s" /proc/diskstats`
   if [ "$state" = "$newstate" ]; then
      if [ $count -lt 0 ]; then
         count=$interval
         if [ $up = 1 ]; then
            #echo -e "spin-down\t" `date`
            sync
            state=`grep "\s$disk\s" /proc/diskstats`
            scsi-stop /dev/$disk
            up=0
         fi
      fi
   else
      #echo -e "drive is up\t" `date`
      count=$interval
      state="$newstate"
      up=1
   fi
done

4.Method: Use sg_start to spindown usb disk

for OpenDebianSlug? 3.10 2.16 kernel:

  install sg3 scsi tools: apt-get install sg3-utils
  powerdown hdd: /usr/bin/sg_start 0 -pc=3 /dev/sda
  use shell or perl script for automatic powerdown

System modifications for HD spin-down OR

How to make your standalone USB disk really spindown

[by JNC]

OK, you could tell me : what is this update? I have read much in the MaxtorOneTouch-Howto about the procedure to move /dev and /var back to RAM, so, why another section ?

That's definitively true. Many thanks to those who contributed to write those pages. I just found 2 problems with what I read :

  • it was for Unslung version only (not Openslug) [Unslung version]
  • the process was incomplete (only for /var) and impossible to extend to /dev

As I don't like to complain without acting, here is my contribution from my experience. I hope it can be useful to anybody.

Preamble

The problem

Once everything is running fine, my disk (Maxtor One Touch) does not spin down, as the NSLU2 regularly accesses files from /dev and /var.

The solution

One solution is to move back /dev and /var to RAM.

Debianslug: The script works with debianslug so long as you uncomment the highlighted line (devpts needs to be remounted otherwise on login ssh can not start a shell giving a 'Server refused to allocate pty' error). The script only copies /dev and /var/log but you would do well to tweak /etc/syslog.conf and /etc/logrotate* to be as economical as possible.

The challenge

Creating a RAM resource, and attach /dev and /ram is easy (mount -t ramfs ramfs ... command). But, as the RAM memory is volatile, the challenge is to create a script that will copy all files from /dev and /var into the RAM resources you created, each time you boot the NSLU2. We must deal with two issues :

  • where is the correct location for my script?
  • what is the command to use to copy the unregular files from /dev ?

The procedure

  • cd /etc/init.d

(all init script should be located in this directory, regardless the run levels they are involved in. There should be a link to this script in the run-level-dedicated directory.)

  • Create the following mount_var_dev.sh script :
#!/bin/sh
# /etc/init.d/mount_var_dev.sh
# Script section to create ramdisk for /var and for /dev

# disable the oom-killer to use the full swap
/sbin/sysctl -w vm.overcommit_memory=1

# better only use /var/log then the full /var
/bin/echo "Creating ramfs for /var/log:"
/bin/mount -t ramfs ramfs /mnt -o maxsize=256
/bin/cp -rp /var/log/* /mnt/
/bin/mount -o bind /var/log /var/log.state
/bin/mount -o bind /mnt /var/log
/bin/umount /mnt

/bin/echo "Creating ramfs for /dev:"
/bin/mount -t ramfs ramfs /mnt -o maxsize=256
cd /dev
find . -print0 -mount | cpio -p -0 -d -m -u /mnt
# you can not use cp command for /dev
/bin/mount -o bind /dev /dev.state
/bin/mount -o bind /mnt /dev
/bin/umount /mnt

# Uncomment the following line when using debianslug
#mount devpts /dev/pts -t devpts

# Return and continue execution of system rc.
return 1
# [EOF]
  • chmod 0755 mount_var_dev.sh
  • cd /etc/rcS.d

(this directory contains all scripts for a generic 'Start' run-level, that is run before running level 3)

  • ln -s /etc/init.d/mount_var_dev.sh S37mount_var_dev.sh

(try to do that after activating swap!)

  • chmod 0755 S37mount_var_dev.sh

(all init scripts are supposed to be in /etc/init.d, and linked to the appropriate directory for the appropriate run-level).

  • edit /etc/syslog.conf and remove the /dev/xconsole entry (only used for X11 logging)
  • cd /etc
  • vi fstab

for all partition from the disk that must spin down, add ,noatime to the 4th column (there should be only default). (this will prevent to wake up the disk for cached read access, just to update the 'last access time' flag of the file)

Before

/dev/sda1       /       ext2    defaults        1  1
/dev/sda2       /home   ext2    defaults        1  2

After

/dev/sda1       /       ext2    defaults,noatime        1  1
/dev/sda2       /home   ext2    defaults,noatime        1  2
  • shutdown -r 0

(reboot)

It is done, you can check using the mount command that /dev and /var are now in RAM. Your disk will spindown with the timer you specified.

NOTE: This works fine on my Unslung6.8 slug (with the script in /opt/etc/init.d). Mount now returns:

[..]
/dev/sda1 on /share/flash/data type ext3 (rw,noatime)
/dev/sda2 on /share/flash/conf type ext3 (rw,sync,noatime)
/dev/sdb1 on /share/hdd/data/HDD_1_1_1 type ufsd (rw)
ramfs on /var/log type ramfs (rw)
ramfs on /dev type ramfs (rw)

Why can't I use sdparm to do spindown-magic?

I corresponded with the developer of sdparm (the SCSI version of hdparm) about using this tool to either set spin-down timers or stop/start disks, here's his explanation for why this can't be done currently.


However the major weakness is in the SCSI<->ATA protocol conversion code/silicon inside the external enclosure housing the IDE disk. If it is like the ones I have tested, it supports READ(10)/WRITE(10)/INQUIRY/ READ_CAPACITY SCSI commands only. The MODE_SENSE commands are dummied up by the USB mass storage driver (within linux kernel) so as to not upset the sd (scsi disk) driver.

Spinning down (or up) a disk requires the SCSI START_STOP_UNIT command to be supported. Even SCSI to ATA Translation (SAT) layer that linux does control (e.g. libata for SATA disks) has only recently added that command (a year after libata was released in the kernel). Convincing people that such commands are worthwhile is not an easy task!

So I encourage your persitence but fear the exercise will be futile. Hopefully in a year or so better SAT layers will surface.

an example of a working sdparm (NOT nslu2 btw) With a 2.6.11 Kernel (have not tried others) on a x86 (Via C3) it's possible to spin down a Samsung SV1640N? in an ICY Box "blue" using "sdparm-0.95"

 # sdparm --command=stop /dev/sdb
 /dev/sdb: SAMSUNG   SP1604N           TM10

And turn it on:

 # sdparm --command=start /dev/sdb
 /dev/sdb: SAMSUNG   SP1604N           TM10

hdparm or any disk acces can start it:

 # hdparm -t /dev/sdb
 /dev/sdb:
  Timing buffered disk reads:    2 MB in  5.76 seconds = 355.73 kB/sec

 # hdparm -t /dev/sdb
 /dev/sdb:
  Timing buffered disk reads:   72 MB in  3.06 seconds =  23.56 MB/sec

Wasn't actually tried on NSLU2 (other kernel, no enivronment etc.). But maybe it will work there too? At least with that case that disk and that USB driver it seems to be possible to spin down an USB Drive!

[Zhyla] This didn't work on my "Genesys" USB adapter on my FC3 box (2.6.9 kernel, sdparm-0.95 and 0.96beta).

Can you try running --command=stop and then --command=ready? It should indicate that it isn't ready (i.e. it's spun down).

[rz] Nice idea, but sorry: --command=ready always shows "ready" regardless if the disk is really spun down/sleeping or not.


[rz] Have tried several cases with Linux version 2.6.11 with a Samsung SP1604?(169GB) and an old Maxtor 53073U6(8GB)

[rz]Supporting(!) "stop" (45 Euro Raid Sonic ICY Box 3.5 Combo (USB+FW)):

 P:  Vendor=067b ProdID?=3507 Rev= 0.01
 S:  Product=ATAPI-6 Bridge Controller
 S:  Manufacturer=Prolific Technology Inc.
 Chip: not visible, assuming(!) Profilic PL3507?

[mag] Another enclosure supporting stop is PPA ME-780U2-2162, which also uses a Prolific chipset.

[rz]Not supporting "stop" (15 Euro Evertech):

 P:  Vendor=04b4 ProdID?=6830 Rev= 2.40
 S:  Product=Cypress AT2LP?
 Chip: CY7C68300B?-56PVXC

[rz]Not supporting "stop" (60 Euro Delock? Combo)

 P:  Vendor=0402 ProdID?=5621 Rev= 1.03
 S:  Product=USB 2.0 Storage Device
 Chip: ALI M5621 + Oxford FW

[rz]Not supporting "stop" via USB but "inside" (55Euro atechweb LAN Server HD9?-U2lA?)

 P:  Vendor=05e3 ProdID?=0702 Rev= 0.33
 S:  Product=USB TO IDE
 Chip: GL811E? (FTR: CPU: RDC R2882)

[rz]As the prolific chip set used by radsonic do spin down the disk (really) that can't be a problem with linux, at least not with linux 2.6.11.


[rz]What chip set is used in which Raidsonic case:

IB-550UE Prolific (PL3507?) - Agere (FW8028?) since 02/2005
IB-350/351/360UE Prolific (PL3507?) - Agere (FW8028?)
IB-350/351US Prolific (PL2507?) - Silicon Image (Sil36CT80?)
IB-350/351/360U Cypress (7C68300A)
IB-250/251U Cypress (7C68300A)
IB-355U Ali (M5621A1?)
IB-525U Ali (M5621A1?)
IB-550U Ali (M5621A1?)
IB-350StS without any

http://www.raidsonic.de/de/pages/service/faq.php (It's only in the german FAQ)


IB-351UE - Agere Chip

      Seagate ST3?? 7200.7 (does not accept the KEEP_OVER_RESET-flag: hdparm -K ...)
      sdparm 0.94
      Kernel 2.6.13 (on desktop, not slug) spins down with sdparm --command=stop /dev/sda
      Seagate has a tool called SeaTool?? (like IBM/Hitachi's Featuretool), but it does not
      have any features to set powermanagement or spin down timers.

Why does my disk not spin down?

Why does it spin up after only five minutes?

Which process is accessing the disk?

To answer this sort of question, see HowtoIdentifyWhichProcessesAccessDisk

December 17, 2006, at 03:42 PM by Hillary --
Changed lines 1-471 from:

Contents

Motivation

Not everyone wants a 24/7 running harddisk. A noisy harddisk right beside is awful and the lifespan of a permanently running HD is shorter, too.

Quick Summary

For various technical reasons it is not generally possible to adjust the standby timer of an IDE disk connected through a USB adapter (including turnkey external USB drives). See the sdparm page and the section below on sdparm for the technical reasons.

1. Method: So one method available is to temporarily connect the drive via its IDE connector directly to a big Linux box and run hdparm to set the timer (the -S option is what you're looking for, PLEASE read the hdparm man page before even thinking about running it)[OS independent]. You need an enclosure with separate power and IDE connectors to do this.

Advantage: Can be used on every HD which supports standby regardless of the OS.

Disadvantage: Every time you turn off your HD or there is a power loss you have to repeat the procedure if your drive doesnt support he KEEP_OVER_RESET-flag.

A very similiar method is using a vendor-specific tool (like IBM Feature Tool) to setup the spin-down time before installing the drive into its enclosure.

2. Method: This is a sub-variant of the 1.Method. Simply buy a HD/enlcosure combo which supports down-spinning by itself (e.g. Maxtor OneTouch series, WD Essential Drives)[OS independent]. A simple but probably more expensive method (and i've heard Maxtor OneTouch HDs? are rather noisy, too ;).

3. Method: Another method is to use scsi-idle. However, this requires a kernel patch as the corresponding kernel changes are not yet included in the nslu2-linux binaries. See the scsi-idle section below [applies to Openslug, Unslung].

All methods most often require modifications concerning the syslog- and other daemons because of their behaviour of writing time-marks into their log-files (especially syslog), as this will cause your HD to spin up at certain intervalls.

As of now (June 2006) SDPARM will most certainly NOT WORK on non-combo(FW+USB) drives. Tell us if you found further working drives.

[mag: I own a usb-only enclosure that spins down fine with sdparm. I think it's more of a question of the controller it uses rather than combo vs. non-combo.]

For further details check below.

1. Method: How do I spin down my USB hard disks?

Any drive can have a spindown timeout, provided:

  • The disk can take 'hdparm -S120 /dev/hdx' and spindown after 10 minutes.
  • It is possible to have the drive using the power from the usb-ide adapter while plugged into the normal ide of your pc.

Prerequisites:

- Harddisk with separate IDE and power connectors.

eg. IcyBox? black [http://www.raidsonic.de/de/pages/products/external_cases.php?we_objectID=3206] [ST: this works fine for me].

- Another Linux machine to connect it to with hdparm installed.

1) Take your HD and install it the enclosure (especially the power connector to the drive).

2) Turn on your enclosure.

2) Disconnect the enclosure's IDE connector (if connected) and connect the other Linux machine's IDE connector to the HD.

3) Set the spindown-time 'hdparm -k1 -K1 -S120 /dev/hda' where -Sxx specifies the spindown-time. -k1-K1 set the keep over reset-flags if supported.

4) Disconnect the Linux machine's IDE connector

5) Connect the enclosures IDE connector to the HD !WITHOUT REMOVING THE POWER from the HD!

This way the drive is never reset, and will keep its spindown setting. Of course if hdparm -k1 -K1 -S120 actually makes your drives remember their settings this is irrelevant, but for anyone like me whose drives wont remember their settings this is a way to make them spindown.

For those with enclosures that wont let them do this, I use this. The usb-ide and power supply are completely separate, which make this easy.

[ST: Bought an enclosure with internal SATA interface and external SATA/USB interface IcyBox IB-360StUS-B and installed a Samsung 250GB SATA II (SP2504C?) into it. Connected it via SATA (MB to external slot-connector is included) to my big machine and ran hdparm. Voila, the disk spins down.]

Sub-method: You can download the Power Booster utility for 2.5" IBM/Hitachi TravelStar disks. The Power Booster utility will enable the auto spin down feature of the disk. For 3.5" IBM/Hitachi drives (and maybe others), you can download the Feature Tool. Otherwise temporarily install the IDE disk in your ordinary Linux box, read the disk technical documentation and use hdparm to adjust the settings by hand. The trick is to enable APM within the drive itself, so Linux doesn't have to care about it at all. You can't use hdparm to alter the APM settings from the NSLU2 as the USB->IDE adapters are emulated as SCSI host adapters in the Linux kernel which is incompatible with the necessary hdparm options.

[Request by ingeba]: To my knowledge this does not work. Can anyone verify that APM settings may cause NSLU2 connected drives in arbitrary enclosures to spin down? If so, please list drive and enclosure brand and here:

[slavikb] This worked for me (Hitachi 7K250, noname box, Feature Tool). I had to remount root with -noatime option. The drive goes into Low RPM mode after 10 minutes of inactivity.

Either way, you'll have to open your 2.5" USB enclosure and install the disk drive temporarily to a desktop computer using a 2.5" to 3.5" IDE adapter. After that, you can do the APM adjustment in Windows or Linux.

2.Method: Enclosures with integrated spin-down

For Maxtor OneTouch drives see the Maxtor OneTouch HOWTO.

I just bought a Seagate Baracuda 3.5" drive and installed it in a third party enclosure. Upon contacting their tech support in Europe they stated that:

  • Seagate does not support other power management than managed by the running OS
  • Seagate does not support drives to be installed in third party enclosures
  • Seagate disks do not have a function to retain the power management settings

So I guess my advice would be not to buy the Seagate disks.

By Miro Dietiker As i see, some disks of higher price (and quality?) power down out-of-the-box with a meaningful value configured. If you have a USB disk which does this, extend this list please.

  • 13.03.2006: WesternDigital? Essential - 320 GB USB 2.0 / 3.5" / 7200 rpm (All WD Essential drives seem to implement this feature)
  • 24.03.2003 Maxtor One Touch - 200 Go USB 2.0 / 3.5 " / 7200 rpm
  • 11.05.2006: Seagate 250GB USB 2.0 / 3.5" / 7200 RPM

Note:* 24.04.2006 I have a WesternDigital? Essential - 250 GB USB 2.0 / 3.5" / 7200 rpm and although it supports spindown by hardware and does so on my laptop, it wont do so on my slug. Even if completly umounted. + Openslug does not find this disk. EDIT: I now have spindown on this disk. Strangly it works with debian. I mounted my /var and /tmp on a usb-stick.

  • I do also have a Western Digital MyBook? Essential 500GB I bought with my NSLU2 in Nov 2006. And it does not spin down on the NSLU2. I also reverted to the original Linksys firmware but it still does not spin down. There is also another strange problem - from time to time the NSLU2 just does not boot up - only the ethernet light is on and the slug freezes - I have to unplug the power connector. Then it boots up normaly again - very strange. - Anguel Stankov

3. Method: How to use scsi-idle for spinning down USB disks.

Robert Demski provided a kernel patch as well as a package for the scsi-idle software to be used on the slug.

The build process is quite complicated as it requires setting up a cross-compile environment for the slug currently, until the kernel patch is included in the binary distributions of OpenSlug. The process is described in a blog post on fredericiana.com. Any comments appreciated.

How to use scsi-idle without kernel patch

By Ruud Senden

I've managed to automate spindown using scsi-idle without the kernel patch. I've created the perl script listed below based on a script I found at http://www.rootfs.net/jaws/index.php?gadget=Blog&action=SingleView&id=22:

#!/usr/bin/perl -w

$statfile = "/proc/diskstats";
die "$0: Cannot read $statfile\n" unless -r $statfile;

$| = 1;
($disk, $interval) = (@ARGV);
$disk =~ s,/dev/,,;
print "$0: disk: $disk, interval: $interval\n";

$halted_data = $last_seen = '';
while (1) {
  open(STATUS, $statfile);
  ($_) = grep(/^\s+\d+\s+\d+\s+$disk\s/o, <STATUS>);
  close STATUS;

  if ($last_seen eq $_ && $halted_data ne $_) {
    print "Spinning down: $disk\n";
    system "scsi-stop", "/dev/$disk";
    $halted_data = $_;
  }
  $last_seen = $_;
  sleep $interval;
}

Basically what this script does is take a device as the first argument, and an interval in seconds as the second argument. Every interval seconds it will look at /proc/diskstats for the given device, and if the status didn't change the disk will be spun down. The disk will automatically spin up again when accessed (on my system at least).

Installation instructions:

  1. Install perl
  2. Install the scsi-idle package, which can be downloaded from the Yahoo Files section
  3. Save the perl script listed above to your filesystem, for example named autospindown. Make sure the script is executable: chmod +rx autospindown
  4. Edit /etc/default/scsi-idle to list the timeouts for your drive(s), see the instructions in that file for more information.
  5. Edit /etc/init.d/scsi-idle, changing the DAEMON variable to point to the perl script you saved in step 3.
  6. /etc/init.d/scsi-idle start

I've tested this on my NSLU2 with OpenSlug 2.7 installed, I think a similar approach should work on Unslung as well. Any comments appreciated.

Note - the file "/proc/diskstats" does not exist on Unslung 5.5, so this technique won't work directly on Unslung boxes.

  • note 11th Sept 2006

Installing scsi-idle_2.4.23-r1_armeb.ipk onto unslung 6.8 fails as : ERROR: Cannot satisfy the following dependencies for scsi-idle:

         libgcc1 (>= 3.4.4) libc6 (>= 2.3.5+cvs20050627) **

Shell-only scsi-idle without kernel patch

By Chris

Using Ruud's idea, except implemented as a shell script so you don't need Perl (which is great, but takes a lot of space if you're running from flash only). This seems to work fine with the vanilla OpenSlug firmware, a ByteCC 2.5" external enclosure, and a Seagate 40GB 2.5" drive.

This version updates the status more often than the Perl version which prevents waiting almost a complete extra interval cycle under certain circumstances. Feel free to hack this script and make it better as I didn't spend much time on it.

Stripwax adds: The scsi-idle package and the perl script above follow the convention that the drive to idle is e.g. "dev/sda" whereas the below seems to want to expect just e.g. "sda". In my opinion you will need to change the line "disk=$1" below to something like "disk=${1#/dev/}" or similar

#!/bin/sh

disk=$1
interval=$2

state=`grep "\s$disk\s" /proc/diskstats`
count=$interval
up=1

while [ true ]; do
   sleep 10
   count=$(($count-10))
   newstate=`grep "\s$disk\s" /proc/diskstats`
   if [ "$state" = "$newstate" ]; then
      if [ $count -lt 0 ]; then
         count=$interval
         if [ $up = 1 ]; then
            #echo -e "spin-down\t" `date`
            sync
            state=`grep "\s$disk\s" /proc/diskstats`
            scsi-stop /dev/$disk
            up=0
         fi
      fi
   else
      #echo -e "drive is up\t" `date`
      count=$interval
      state="$newstate"
      up=1
   fi
done

4.Method: Use sg_start to spindown usb disk

for OpenDebianSlug? 3.10 2.16 kernel:

  install sg3 scsi tools: apt-get install sg3-utils
  powerdown hdd: /usr/bin/sg_start 0 -pc=3 /dev/sda
  use shell or perl script for automatic powerdown

System modifications for HD spin-down OR

How to make your standalone USB disk really spindown

[by JNC]

OK, you could tell me : what is this update? I have read much in the MaxtorOneTouch-Howto about the procedure to move /dev and /var back to RAM, so, why another section ?

That's definitively true. Many thanks to those who contributed to write those pages. I just found 2 problems with what I read :

  • it was for Unslung version only (not Openslug) [Unslung version]
  • the process was incomplete (only for /var) and impossible to extend to /dev

As I don't like to complain without acting, here is my contribution from my experience. I hope it can be useful to anybody.

Preamble

The problem

Once everything is running fine, my disk (Maxtor One Touch) does not spin down, as the NSLU2 regularly accesses files from /dev and /var.

The solution

One solution is to move back /dev and /var to RAM.

Debianslug: The script works with debianslug so long as you uncomment the highlighted line (devpts needs to be remounted otherwise on login ssh can not start a shell giving a 'Server refused to allocate pty' error). The script only copies /dev and /var/log but you would do well to tweak /etc/syslog.conf and /etc/logrotate* to be as economical as possible.

The challenge

Creating a RAM resource, and attach /dev and /ram is easy (mount -t ramfs ramfs ... command). But, as the RAM memory is volatile, the challenge is to create a script that will copy all files from /dev and /var into the RAM resources you created, each time you boot the NSLU2. We must deal with two issues :

  • where is the correct location for my script?
  • what is the command to use to copy the unregular files from /dev ?

The procedure

  • cd /etc/init.d

(all init script should be located in this directory, regardless the run levels they are involved in. There should be a link to this script in the run-level-dedicated directory.)

  • Create the following mount_var_dev.sh script :
#!/bin/sh
# /etc/init.d/mount_var_dev.sh
# Script section to create ramdisk for /var and for /dev

# disable the oom-killer to use the full swap
/sbin/sysctl -w vm.overcommit_memory=1

# better only use /var/log then the full /var
/bin/echo "Creating ramfs for /var/log:"
/bin/mount -t ramfs ramfs /mnt -o maxsize=256
/bin/cp -rp /var/log/* /mnt/
/bin/mount -o bind /var/log /var/log.state
/bin/mount -o bind /mnt /var/log
/bin/umount /mnt

/bin/echo "Creating ramfs for /dev:"
/bin/mount -t ramfs ramfs /mnt -o maxsize=256
cd /dev
find . -print0 -mount | cpio -p -0 -d -m -u /mnt
# you can not use cp command for /dev
/bin/mount -o bind /dev /dev.state
/bin/mount -o bind /mnt /dev
/bin/umount /mnt

# Uncomment the following line when using debianslug
#mount devpts /dev/pts -t devpts

# Return and continue execution of system rc.
return 1
# [EOF]
  • chmod 0755 mount_var_dev.sh
  • cd /etc/rcS.d

(this directory contains all scripts for a generic 'Start' run-level, that is run before running level 3)

  • ln -s /etc/init.d/mount_var_dev.sh S37mount_var_dev.sh

(try to do that after activating swap!)

  • chmod 0755 S37mount_var_dev.sh

(all init scripts are supposed to be in /etc/init.d, and linked to the appropriate directory for the appropriate run-level).

  • edit /etc/syslog.conf and remove the /dev/xconsole entry (only used for X11 logging)
  • cd /etc
  • vi fstab

for all partition from the disk that must spin down, add ,noatime to the 4th column (there should be only default). (this will prevent to wake up the disk for cached read access, just to update the 'last access time' flag of the file)

Before

/dev/sda1       /       ext2    defaults        1  1
/dev/sda2       /home   ext2    defaults        1  2

After

/dev/sda1       /       ext2    defaults,noatime        1  1
/dev/sda2       /home   ext2    defaults,noatime        1  2
  • shutdown -r 0

(reboot)

It is done, you can check using the mount command that /dev and /var are now in RAM. Your disk will spindown with the timer you specified.

NOTE: This works fine on my Unslung6.8 slug (with the script in /opt/etc/init.d). Mount now returns:

[..]
/dev/sda1 on /share/flash/data type ext3 (rw,noatime)
/dev/sda2 on /share/flash/conf type ext3 (rw,sync,noatime)
/dev/sdb1 on /share/hdd/data/HDD_1_1_1 type ufsd (rw)
ramfs on /var/log type ramfs (rw)
ramfs on /dev type ramfs (rw)

Why can't I use sdparm to do spindown-magic?

I corresponded with the developer of sdparm (the SCSI version of hdparm) about using this tool to either set spin-down timers or stop/start disks, here's his explanation for why this can't be done currently.


However the major weakness is in the SCSI<->ATA protocol conversion code/silicon inside the external enclosure housing the IDE disk. If it is like the ones I have tested, it supports READ(10)/WRITE(10)/INQUIRY/ READ_CAPACITY SCSI commands only. The MODE_SENSE commands are dummied up by the USB mass storage driver (within linux kernel) so as to not upset the sd (scsi disk) driver.

Spinning down (or up) a disk requires the SCSI START_STOP_UNIT command to be supported. Even SCSI to ATA Translation (SAT) layer that linux does control (e.g. libata for SATA disks) has only recently added that command (a year after libata was released in the kernel). Convincing people that such commands are worthwhile is not an easy task!

So I encourage your persitence but fear the exercise will be futile. Hopefully in a year or so better SAT layers will surface.

an example of a working sdparm (NOT nslu2 btw) With a 2.6.11 Kernel (have not tried others) on a x86 (Via C3) it's possible to spin down a Samsung SV1640N? in an ICY Box "blue" using "sdparm-0.95"

 # sdparm --command=stop /dev/sdb
 /dev/sdb: SAMSUNG   SP1604N           TM10

And turn it on:

 # sdparm --command=start /dev/sdb
 /dev/sdb: SAMSUNG   SP1604N           TM10

hdparm or any disk acces can start it:

 # hdparm -t /dev/sdb
 /dev/sdb:
  Timing buffered disk reads:    2 MB in  5.76 seconds = 355.73 kB/sec

 # hdparm -t /dev/sdb
 /dev/sdb:
  Timing buffered disk reads:   72 MB in  3.06 seconds =  23.56 MB/sec

Wasn't actually tried on NSLU2 (other kernel, no enivronment etc.). But maybe it will work there too? At least with that case that disk and that USB driver it seems to be possible to spin down an USB Drive!

[Zhyla] This didn't work on my "Genesys" USB adapter on my FC3 box (2.6.9 kernel, sdparm-0.95 and 0.96beta).

Can you try running --command=stop and then --command=ready? It should indicate that it isn't ready (i.e. it's spun down).

[rz] Nice idea, but sorry: --command=ready always shows "ready" regardless if the disk is really spun down/sleeping or not.


[rz] Have tried several cases with Linux version 2.6.11 with a Samsung SP1604?(169GB) and an old Maxtor 53073U6(8GB)

[rz]Supporting(!) "stop" (45 Euro Raid Sonic ICY Box 3.5 Combo (USB+FW)):

 P:  Vendor=067b ProdID?=3507 Rev= 0.01
 S:  Product=ATAPI-6 Bridge Controller
 S:  Manufacturer=Prolific Technology Inc.
 Chip: not visible, assuming(!) Profilic PL3507?

[mag] Another enclosure supporting stop is PPA ME-780U2-2162, which also uses a Prolific chipset.

[rz]Not supporting "stop" (15 Euro Evertech):

 P:  Vendor=04b4 ProdID?=6830 Rev= 2.40
 S:  Product=Cypress AT2LP?
 Chip: CY7C68300B?-56PVXC

[rz]Not supporting "stop" (60 Euro Delock? Combo)

 P:  Vendor=0402 ProdID?=5621 Rev= 1.03
 S:  Product=USB 2.0 Storage Device
 Chip: ALI M5621 + Oxford FW

[rz]Not supporting "stop" via USB but "inside" (55Euro atechweb LAN Server HD9?-U2lA?)

 P:  Vendor=05e3 ProdID?=0702 Rev= 0.33
 S:  Product=USB TO IDE
 Chip: GL811E? (FTR: CPU: RDC R2882)

[rz]As the prolific chip set used by radsonic do spin down the disk (really) that can't be a problem with linux, at least not with linux 2.6.11.


[rz]What chip set is used in which Raidsonic case:

IB-550UE Prolific (PL3507?) - Agere (FW8028?) since 02/2005
IB-350/351/360UE Prolific (PL3507?) - Agere (FW8028?)
IB-350/351US Prolific (PL2507?) - Silicon Image (Sil36CT80?)
IB-350/351/360U Cypress (7C68300A)
IB-250/251U Cypress (7C68300A)
IB-355U Ali (M5621A1?)
IB-525U Ali (M5621A1?)
IB-550U Ali (M5621A1?)
IB-350StS without any

http://www.raidsonic.de/de/pages/service/faq.php (It's only in the german FAQ)


IB-351UE - Agere Chip

      Seagate ST3?? 7200.7 (does not accept the KEEP_OVER_RESET-flag: hdparm -K ...)
      sdparm 0.94
      Kernel 2.6.13 (on desktop, not slug) spins down with sdparm --command=stop /dev/sda
      Seagate has a tool called SeaTool?? (like IBM/Hitachi's Featuretool), but it does not
      have any features to set powermanagement or spin down timers.

Why does my disk not spin down?

Why does it spin up after only five minutes?

Which process is accessing the disk?

To answer this sort of question, see HowtoIdentifyWhichProcessesAccessDisk

to:

Hello, nice site look this: http://urlcut.com/gucci-handbags

December 17, 2006, at 10:19 AM by mathieu_xwave -- Original content (killed by ads)
Changed lines 1-3 from:

<a href="http://shrinkurl.us/cialis">cialis</a> http://shrinkurl.us/cialis cialis

to:

Contents

Motivation

Not everyone wants a 24/7 running harddisk. A noisy harddisk right beside is awful and the lifespan of a permanently running HD is shorter, too.

Quick Summary

For various technical reasons it is not generally possible to adjust the standby timer of an IDE disk connected through a USB adapter (including turnkey external USB drives). See the sdparm page and the section below on sdparm for the technical reasons.

1. Method: So one method available is to temporarily connect the drive via its IDE connector directly to a big Linux box and run hdparm to set the timer (the -S option is what you're looking for, PLEASE read the hdparm man page before even thinking about running it)[OS independent]. You need an enclosure with separate power and IDE connectors to do this.

Advantage: Can be used on every HD which supports standby regardless of the OS.

Disadvantage: Every time you turn off your HD or there is a power loss you have to repeat the procedure if your drive doesnt support he KEEP_OVER_RESET-flag.

A very similiar method is using a vendor-specific tool (like IBM Feature Tool) to setup the spin-down time before installing the drive into its enclosure.

2. Method: This is a sub-variant of the 1.Method. Simply buy a HD/enlcosure combo which supports down-spinning by itself (e.g. Maxtor OneTouch series, WD Essential Drives)[OS independent]. A simple but probably more expensive method (and i've heard Maxtor OneTouch HDs? are rather noisy, too ;).

3. Method: Another method is to use scsi-idle. However, this requires a kernel patch as the corresponding kernel changes are not yet included in the nslu2-linux binaries. See the scsi-idle section below [applies to Openslug, Unslung].

All methods most often require modifications concerning the syslog- and other daemons because of their behaviour of writing time-marks into their log-files (especially syslog), as this will cause your HD to spin up at certain intervalls.

As of now (June 2006) SDPARM will most certainly NOT WORK on non-combo(FW+USB) drives. Tell us if you found further working drives.

[mag: I own a usb-only enclosure that spins down fine with sdparm. I think it's more of a question of the controller it uses rather than combo vs. non-combo.]

For further details check below.

1. Method: How do I spin down my USB hard disks?

Any drive can have a spindown timeout, provided:

  • The disk can take 'hdparm -S120 /dev/hdx' and spindown after 10 minutes.
  • It is possible to have the drive using the power from the usb-ide adapter while plugged into the normal ide of your pc.

Prerequisites:

- Harddisk with separate IDE and power connectors.

eg. IcyBox? black [http://www.raidsonic.de/de/pages/products/external_cases.php?we_objectID=3206] [ST: this works fine for me].

- Another Linux machine to connect it to with hdparm installed.

1) Take your HD and install it the enclosure (especially the power connector to the drive).

2) Turn on your enclosure.

2) Disconnect the enclosure's IDE connector (if connected) and connect the other Linux machine's IDE connector to the HD.

3) Set the spindown-time 'hdparm -k1 -K1 -S120 /dev/hda' where -Sxx specifies the spindown-time. -k1-K1 set the keep over reset-flags if supported.

4) Disconnect the Linux machine's IDE connector

5) Connect the enclosures IDE connector to the HD !WITHOUT REMOVING THE POWER from the HD!

This way the drive is never reset, and will keep its spindown setting. Of course if hdparm -k1 -K1 -S120 actually makes your drives remember their settings this is irrelevant, but for anyone like me whose drives wont remember their settings this is a way to make them spindown.

For those with enclosures that wont let them do this, I use this. The usb-ide and power supply are completely separate, which make this easy.

[ST: Bought an enclosure with internal SATA interface and external SATA/USB interface IcyBox IB-360StUS-B and installed a Samsung 250GB SATA II (SP2504C?) into it. Connected it via SATA (MB to external slot-connector is included) to my big machine and ran hdparm. Voila, the disk spins down.]

Sub-method: You can download the Power Booster utility for 2.5" IBM/Hitachi TravelStar disks. The Power Booster utility will enable the auto spin down feature of the disk. For 3.5" IBM/Hitachi drives (and maybe others), you can download the Feature Tool. Otherwise temporarily install the IDE disk in your ordinary Linux box, read the disk technical documentation and use hdparm to adjust the settings by hand. The trick is to enable APM within the drive itself, so Linux doesn't have to care about it at all. You can't use hdparm to alter the APM settings from the NSLU2 as the USB->IDE adapters are emulated as SCSI host adapters in the Linux kernel which is incompatible with the necessary hdparm options.

[Request by ingeba]: To my knowledge this does not work. Can anyone verify that APM settings may cause NSLU2 connected drives in arbitrary enclosures to spin down? If so, please list drive and enclosure brand and here:

[slavikb] This worked for me (Hitachi 7K250, noname box, Feature Tool). I had to remount root with -noatime option. The drive goes into Low RPM mode after 10 minutes of inactivity.

Either way, you'll have to open your 2.5" USB enclosure and install the disk drive temporarily to a desktop computer using a 2.5" to 3.5" IDE adapter. After that, you can do the APM adjustment in Windows or Linux.

2.Method: Enclosures with integrated spin-down

For Maxtor OneTouch drives see the Maxtor OneTouch HOWTO.

I just bought a Seagate Baracuda 3.5" drive and installed it in a third party enclosure. Upon contacting their tech support in Europe they stated that:

  • Seagate does not support other power management than managed by the running OS
  • Seagate does not support drives to be installed in third party enclosures
  • Seagate disks do not have a function to retain the power management settings

So I guess my advice would be not to buy the Seagate disks.

By Miro Dietiker As i see, some disks of higher price (and quality?) power down out-of-the-box with a meaningful value configured. If you have a USB disk which does this, extend this list please.

  • 13.03.2006: WesternDigital? Essential - 320 GB USB 2.0 / 3.5" / 7200 rpm (All WD Essential drives seem to implement this feature)
  • 24.03.2003 Maxtor One Touch - 200 Go USB 2.0 / 3.5 " / 7200 rpm
  • 11.05.2006: Seagate 250GB USB 2.0 / 3.5" / 7200 RPM

Note:* 24.04.2006 I have a WesternDigital? Essential - 250 GB USB 2.0 / 3.5" / 7200 rpm and although it supports spindown by hardware and does so on my laptop, it wont do so on my slug. Even if completly umounted. + Openslug does not find this disk. EDIT: I now have spindown on this disk. Strangly it works with debian. I mounted my /var and /tmp on a usb-stick.

  • I do also have a Western Digital MyBook? Essential 500GB I bought with my NSLU2 in Nov 2006. And it does not spin down on the NSLU2. I also reverted to the original Linksys firmware but it still does not spin down. There is also another strange problem - from time to time the NSLU2 just does not boot up - only the ethernet light is on and the slug freezes - I have to unplug the power connector. Then it boots up normaly again - very strange. - Anguel Stankov

3. Method: How to use scsi-idle for spinning down USB disks.

Robert Demski provided a kernel patch as well as a package for the scsi-idle software to be used on the slug.

The build process is quite complicated as it requires setting up a cross-compile environment for the slug currently, until the kernel patch is included in the binary distributions of OpenSlug. The process is described in a blog post on fredericiana.com. Any comments appreciated.

How to use scsi-idle without kernel patch

By Ruud Senden

I've managed to automate spindown using scsi-idle without the kernel patch. I've created the perl script listed below based on a script I found at http://www.rootfs.net/jaws/index.php?gadget=Blog&action=SingleView&id=22:

#!/usr/bin/perl -w

$statfile = "/proc/diskstats";
die "$0: Cannot read $statfile\n" unless -r $statfile;

$| = 1;
($disk, $interval) = (@ARGV);
$disk =~ s,/dev/,,;
print "$0: disk: $disk, interval: $interval\n";

$halted_data = $last_seen = '';
while (1) {
  open(STATUS, $statfile);
  ($_) = grep(/^\s+\d+\s+\d+\s+$disk\s/o, <STATUS>);
  close STATUS;

  if ($last_seen eq $_ && $halted_data ne $_) {
    print "Spinning down: $disk\n";
    system "scsi-stop", "/dev/$disk";
    $halted_data = $_;
  }
  $last_seen = $_;
  sleep $interval;
}

Basically what this script does is take a device as the first argument, and an interval in seconds as the second argument. Every interval seconds it will look at /proc/diskstats for the given device, and if the status didn't change the disk will be spun down. The disk will automatically spin up again when accessed (on my system at least).

Installation instructions:

  1. Install perl
  2. Install the scsi-idle package, which can be downloaded from the Yahoo Files section
  3. Save the perl script listed above to your filesystem, for example named autospindown. Make sure the script is executable: chmod +rx autospindown
  4. Edit /etc/default/scsi-idle to list the timeouts for your drive(s), see the instructions in that file for more information.
  5. Edit /etc/init.d/scsi-idle, changing the DAEMON variable to point to the perl script you saved in step 3.
  6. /etc/init.d/scsi-idle start

I've tested this on my NSLU2 with OpenSlug 2.7 installed, I think a similar approach should work on Unslung as well. Any comments appreciated.

Note - the file "/proc/diskstats" does not exist on Unslung 5.5, so this technique won't work directly on Unslung boxes.

  • note 11th Sept 2006

Installing scsi-idle_2.4.23-r1_armeb.ipk onto unslung 6.8 fails as : ERROR: Cannot satisfy the following dependencies for scsi-idle:

         libgcc1 (>= 3.4.4) libc6 (>= 2.3.5+cvs20050627) **

Shell-only scsi-idle without kernel patch

By Chris

Using Ruud's idea, except implemented as a shell script so you don't need Perl (which is great, but takes a lot of space if you're running from flash only). This seems to work fine with the vanilla OpenSlug firmware, a ByteCC 2.5" external enclosure, and a Seagate 40GB 2.5" drive.

This version updates the status more often than the Perl version which prevents waiting almost a complete extra interval cycle under certain circumstances. Feel free to hack this script and make it better as I didn't spend much time on it.

Stripwax adds: The scsi-idle package and the perl script above follow the convention that the drive to idle is e.g. "dev/sda" whereas the below seems to want to expect just e.g. "sda". In my opinion you will need to change the line "disk=$1" below to something like "disk=${1#/dev/}" or similar

#!/bin/sh

disk=$1
interval=$2

state=`grep "\s$disk\s" /proc/diskstats`
count=$interval
up=1

while [ true ]; do
   sleep 10
   count=$(($count-10))
   newstate=`grep "\s$disk\s" /proc/diskstats`
   if [ "$state" = "$newstate" ]; then
      if [ $count -lt 0 ]; then
         count=$interval
         if [ $up = 1 ]; then
            #echo -e "spin-down\t" `date`
            sync
            state=`grep "\s$disk\s" /proc/diskstats`
            scsi-stop /dev/$disk
            up=0
         fi
      fi
   else
      #echo -e "drive is up\t" `date`
      count=$interval
      state="$newstate"
      up=1
   fi
done

4.Method: Use sg_start to spindown usb disk

for OpenDebianSlug? 3.10 2.16 kernel:

  install sg3 scsi tools: apt-get install sg3-utils
  powerdown hdd: /usr/bin/sg_start 0 -pc=3 /dev/sda
  use shell or perl script for automatic powerdown

System modifications for HD spin-down OR

How to make your standalone USB disk really spindown

[by JNC]

OK, you could tell me : what is this update? I have read much in the MaxtorOneTouch-Howto about the procedure to move /dev and /var back to RAM, so, why another section ?

That's definitively true. Many thanks to those who contributed to write those pages. I just found 2 problems with what I read :

  • it was for Unslung version only (not Openslug) [Unslung version]
  • the process was incomplete (only for /var) and impossible to extend to /dev

As I don't like to complain without acting, here is my contribution from my experience. I hope it can be useful to anybody.

Preamble

The problem

Once everything is running fine, my disk (Maxtor One Touch) does not spin down, as the NSLU2 regularly accesses files from /dev and /var.

The solution

One solution is to move back /dev and /var to RAM.

Debianslug: The script works with debianslug so long as you uncomment the highlighted line (devpts needs to be remounted otherwise on login ssh can not start a shell giving a 'Server refused to allocate pty' error). The script only copies /dev and /var/log but you would do well to tweak /etc/syslog.conf and /etc/logrotate* to be as economical as possible.

The challenge

Creating a RAM resource, and attach /dev and /ram is easy (mount -t ramfs ramfs ... command). But, as the RAM memory is volatile, the challenge is to create a script that will copy all files from /dev and /var into the RAM resources you created, each time you boot the NSLU2. We must deal with two issues :

  • where is the correct location for my script?
  • what is the command to use to copy the unregular files from /dev ?

The procedure

  • cd /etc/init.d

(all init script should be located in this directory, regardless the run levels they are involved in. There should be a link to this script in the run-level-dedicated directory.)

  • Create the following mount_var_dev.sh script :
#!/bin/sh
# /etc/init.d/mount_var_dev.sh
# Script section to create ramdisk for /var and for /dev

# disable the oom-killer to use the full swap
/sbin/sysctl -w vm.overcommit_memory=1

# better only use /var/log then the full /var
/bin/echo "Creating ramfs for /var/log:"
/bin/mount -t ramfs ramfs /mnt -o maxsize=256
/bin/cp -rp /var/log/* /mnt/
/bin/mount -o bind /var/log /var/log.state
/bin/mount -o bind /mnt /var/log
/bin/umount /mnt

/bin/echo "Creating ramfs for /dev:"
/bin/mount -t ramfs ramfs /mnt -o maxsize=256
cd /dev
find . -print0 -mount | cpio -p -0 -d -m -u /mnt
# you can not use cp command for /dev
/bin/mount -o bind /dev /dev.state
/bin/mount -o bind /mnt /dev
/bin/umount /mnt

# Uncomment the following line when using debianslug
#mount devpts /dev/pts -t devpts

# Return and continue execution of system rc.
return 1
# [EOF]
  • chmod 0755 mount_var_dev.sh
  • cd /etc/rcS.d

(this directory contains all scripts for a generic 'Start' run-level, that is run before running level 3)

  • ln -s /etc/init.d/mount_var_dev.sh S37mount_var_dev.sh

(try to do that after activating swap!)

  • chmod 0755 S37mount_var_dev.sh

(all init scripts are supposed to be in /etc/init.d, and linked to the appropriate directory for the appropriate run-level).

  • edit /etc/syslog.conf and remove the /dev/xconsole entry (only used for X11 logging)
  • cd /etc
  • vi fstab

for all partition from the disk that must spin down, add ,noatime to the 4th column (there should be only default). (this will prevent to wake up the disk for cached read access, just to update the 'last access time' flag of the file)

Before

/dev/sda1       /       ext2    defaults        1  1
/dev/sda2       /home   ext2    defaults        1  2

After

/dev/sda1       /       ext2    defaults,noatime        1  1
/dev/sda2       /home   ext2    defaults,noatime        1  2
  • shutdown -r 0

(reboot)

It is done, you can check using the mount command that /dev and /var are now in RAM. Your disk will spindown with the timer you specified.

NOTE: This works fine on my Unslung6.8 slug (with the script in /opt/etc/init.d). Mount now returns:

[..]
/dev/sda1 on /share/flash/data type ext3 (rw,noatime)
/dev/sda2 on /share/flash/conf type ext3 (rw,sync,noatime)
/dev/sdb1 on /share/hdd/data/HDD_1_1_1 type ufsd (rw)
ramfs on /var/log type ramfs (rw)
ramfs on /dev type ramfs (rw)

Why can't I use sdparm to do spindown-magic?

I corresponded with the developer of sdparm (the SCSI version of hdparm) about using this tool to either set spin-down timers or stop/start disks, here's his explanation for why this can't be done currently.


However the major weakness is in the SCSI<->ATA protocol conversion code/silicon inside the external enclosure housing the IDE disk. If it is like the ones I have tested, it supports READ(10)/WRITE(10)/INQUIRY/ READ_CAPACITY SCSI commands only. The MODE_SENSE commands are dummied up by the USB mass storage driver (within linux kernel) so as to not upset the sd (scsi disk) driver.

Spinning down (or up) a disk requires the SCSI START_STOP_UNIT command to be supported. Even SCSI to ATA Translation (SAT) layer that linux does control (e.g. libata for SATA disks) has only recently added that command (a year after libata was released in the kernel). Convincing people that such commands are worthwhile is not an easy task!

So I encourage your persitence but fear the exercise will be futile. Hopefully in a year or so better SAT layers will surface.

an example of a working sdparm (NOT nslu2 btw) With a 2.6.11 Kernel (have not tried others) on a x86 (Via C3) it's possible to spin down a Samsung SV1640N? in an ICY Box "blue" using "sdparm-0.95"

 # sdparm --command=stop /dev/sdb
 /dev/sdb: SAMSUNG   SP1604N           TM10

And turn it on:

 # sdparm --command=start /dev/sdb
 /dev/sdb: SAMSUNG   SP1604N           TM10

hdparm or any disk acces can start it:

 # hdparm -t /dev/sdb
 /dev/sdb:
  Timing buffered disk reads:    2 MB in  5.76 seconds = 355.73 kB/sec

 # hdparm -t /dev/sdb
 /dev/sdb:
  Timing buffered disk reads:   72 MB in  3.06 seconds =  23.56 MB/sec

Wasn't actually tried on NSLU2 (other kernel, no enivronment etc.). But maybe it will work there too? At least with that case that disk and that USB driver it seems to be possible to spin down an USB Drive!

[Zhyla] This didn't work on my "Genesys" USB adapter on my FC3 box (2.6.9 kernel, sdparm-0.95 and 0.96beta).

Can you try running --command=stop and then --command=ready? It should indicate that it isn't ready (i.e. it's spun down).

[rz] Nice idea, but sorry: --command=ready always shows "ready" regardless if the disk is really spun down/sleeping or not.


[rz] Have tried several cases with Linux version 2.6.11 with a Samsung SP1604?(169GB) and an old Maxtor 53073U6(8GB)

[rz]Supporting(!) "stop" (45 Euro Raid Sonic ICY Box 3.5 Combo (USB+FW)):

 P:  Vendor=067b ProdID?=3507 Rev= 0.01
 S:  Product=ATAPI-6 Bridge Controller
 S:  Manufacturer=Prolific Technology Inc.
 Chip: not visible, assuming(!) Profilic PL3507?

[mag] Another enclosure supporting stop is PPA ME-780U2-2162, which also uses a Prolific chipset.

[rz]Not supporting "stop" (15 Euro Evertech):

 P:  Vendor=04b4 ProdID?=6830 Rev= 2.40
 S:  Product=Cypress AT2LP?
 Chip: CY7C68300B?-56PVXC

[rz]Not supporting "stop" (60 Euro Delock? Combo)

 P:  Vendor=0402 ProdID?=5621 Rev= 1.03
 S:  Product=USB 2.0 Storage Device
 Chip: ALI M5621 + Oxford FW

[rz]Not supporting "stop" via USB but "inside" (55Euro atechweb LAN Server HD9?-U2lA?)

 P:  Vendor=05e3 ProdID?=0702 Rev= 0.33
 S:  Product=USB TO IDE
 Chip: GL811E? (FTR: CPU: RDC R2882)

[rz]As the prolific chip set used by radsonic do spin down the disk (really) that can't be a problem with linux, at least not with linux 2.6.11.


[rz]What chip set is used in which Raidsonic case:

IB-550UE Prolific (PL3507?) - Agere (FW8028?) since 02/2005
IB-350/351/360UE Prolific (PL3507?) - Agere (FW8028?)
IB-350/351US Prolific (PL2507?) - Silicon Image (Sil36CT80?)
IB-350/351/360U Cypress (7C68300A)
IB-250/251U Cypress (7C68300A)
IB-355U Ali (M5621A1?)
IB-525U Ali (M5621A1?)
IB-550U Ali (M5621A1?)
IB-350StS without any

http://www.raidsonic.de/de/pages/service/faq.php (It's only in the german FAQ)


IB-351UE - Agere Chip

      Seagate ST3?? 7200.7 (does not accept the KEEP_OVER_RESET-flag: hdparm -K ...)
      sdparm 0.94
      Kernel 2.6.13 (on desktop, not slug) spins down with sdparm --command=stop /dev/sda
      Seagate has a tool called SeaTool?? (like IBM/Hitachi's Featuretool), but it does not
      have any features to set powermanagement or spin down timers.

Why does my disk not spin down?

Why does it spin up after only five minutes?

Which process is accessing the disk?

To answer this sort of question, see HowtoIdentifyWhichProcessesAccessDisk

December 17, 2006, at 03:06 AM by cialis --
December 16, 2006, at 09:36 PM by cialis --
Changed lines 1-471 from:

Contents

Motivation

Not everyone wants a 24/7 running harddisk. A noisy harddisk right beside is awful and the lifespan of a permanently running HD is shorter, too.

Quick Summary

For various technical reasons it is not generally possible to adjust the standby timer of an IDE disk connected through a USB adapter (including turnkey external USB drives). See the sdparm page and the section below on sdparm for the technical reasons.

1. Method: So one method available is to temporarily connect the drive via its IDE connector directly to a big Linux box and run hdparm to set the timer (the -S option is what you're looking for, PLEASE read the hdparm man page before even thinking about running it)[OS independent]. You need an enclosure with separate power and IDE connectors to do this.

Advantage: Can be used on every HD which supports standby regardless of the OS.

Disadvantage: Every time you turn off your HD or there is a power loss you have to repeat the procedure if your drive doesnt support he KEEP_OVER_RESET-flag.

A very similiar method is using a vendor-specific tool (like IBM Feature Tool) to setup the spin-down time before installing the drive into its enclosure.

2. Method: This is a sub-variant of the 1.Method. Simply buy a HD/enlcosure combo which supports down-spinning by itself (e.g. Maxtor OneTouch series, WD Essential Drives)[OS independent]. A simple but probably more expensive method (and i've heard Maxtor OneTouch HDs? are rather noisy, too ;).

3. Method: Another method is to use scsi-idle. However, this requires a kernel patch as the corresponding kernel changes are not yet included in the nslu2-linux binaries. See the scsi-idle section below [applies to Openslug, Unslung].

All methods most often require modifications concerning the syslog- and other daemons because of their behaviour of writing time-marks into their log-files (especially syslog), as this will cause your HD to spin up at certain intervalls.

As of now (June 2006) SDPARM will most certainly NOT WORK on non-combo(FW+USB) drives. Tell us if you found further working drives.

[mag: I own a usb-only enclosure that spins down fine with sdparm. I think it's more of a question of the controller it uses rather than combo vs. non-combo.]

For further details check below.

1. Method: How do I spin down my USB hard disks?

Any drive can have a spindown timeout, provided:

  • The disk can take 'hdparm -S120 /dev/hdx' and spindown after 10 minutes.
  • It is possible to have the drive using the power from the usb-ide adapter while plugged into the normal ide of your pc.

Prerequisites:

- Harddisk with separate IDE and power connectors.

eg. IcyBox? black [http://www.raidsonic.de/de/pages/products/external_cases.php?we_objectID=3206] [ST: this works fine for me].

- Another Linux machine to connect it to with hdparm installed.

1) Take your HD and install it the enclosure (especially the power connector to the drive).

2) Turn on your enclosure.

2) Disconnect the enclosure's IDE connector (if connected) and connect the other Linux machine's IDE connector to the HD.

3) Set the spindown-time 'hdparm -k1 -K1 -S120 /dev/hda' where -Sxx specifies the spindown-time. -k1-K1 set the keep over reset-flags if supported.

4) Disconnect the Linux machine's IDE connector

5) Connect the enclosures IDE connector to the HD !WITHOUT REMOVING THE POWER from the HD!

This way the drive is never reset, and will keep its spindown setting. Of course if hdparm -k1 -K1 -S120 actually makes your drives remember their settings this is irrelevant, but for anyone like me whose drives wont remember their settings this is a way to make them spindown.

For those with enclosures that wont let them do this, I use this. The usb-ide and power supply are completely separate, which make this easy.

[ST: Bought an enclosure with internal SATA interface and external SATA/USB interface IcyBox IB-360StUS-B and installed a Samsung 250GB SATA II (SP2504C?) into it. Connected it via SATA (MB to external slot-connector is included) to my big machine and ran hdparm. Voila, the disk spins down.]

Sub-method: You can download the Power Booster utility for 2.5" IBM/Hitachi TravelStar disks. The Power Booster utility will enable the auto spin down feature of the disk. For 3.5" IBM/Hitachi drives (and maybe others), you can download the Feature Tool. Otherwise temporarily install the IDE disk in your ordinary Linux box, read the disk technical documentation and use hdparm to adjust the settings by hand. The trick is to enable APM within the drive itself, so Linux doesn't have to care about it at all. You can't use hdparm to alter the APM settings from the NSLU2 as the USB->IDE adapters are emulated as SCSI host adapters in the Linux kernel which is incompatible with the necessary hdparm options.

[Request by ingeba]: To my knowledge this does not work. Can anyone verify that APM settings may cause NSLU2 connected drives in arbitrary enclosures to spin down? If so, please list drive and enclosure brand and here:

[slavikb] This worked for me (Hitachi 7K250, noname box, Feature Tool). I had to remount root with -noatime option. The drive goes into Low RPM mode after 10 minutes of inactivity.

Either way, you'll have to open your 2.5" USB enclosure and install the disk drive temporarily to a desktop computer using a 2.5" to 3.5" IDE adapter. After that, you can do the APM adjustment in Windows or Linux.

2.Method: Enclosures with integrated spin-down

For Maxtor OneTouch drives see the Maxtor OneTouch HOWTO.

I just bought a Seagate Baracuda 3.5" drive and installed it in a third party enclosure. Upon contacting their tech support in Europe they stated that:

  • Seagate does not support other power management than managed by the running OS
  • Seagate does not support drives to be installed in third party enclosures
  • Seagate disks do not have a function to retain the power management settings

So I guess my advice would be not to buy the Seagate disks.

By Miro Dietiker As i see, some disks of higher price (and quality?) power down out-of-the-box with a meaningful value configured. If you have a USB disk which does this, extend this list please.

  • 13.03.2006: WesternDigital? Essential - 320 GB USB 2.0 / 3.5" / 7200 rpm (All WD Essential drives seem to implement this feature)
  • 24.03.2003 Maxtor One Touch - 200 Go USB 2.0 / 3.5 " / 7200 rpm
  • 11.05.2006: Seagate 250GB USB 2.0 / 3.5" / 7200 RPM

Note:* 24.04.2006 I have a WesternDigital? Essential - 250 GB USB 2.0 / 3.5" / 7200 rpm and although it supports spindown by hardware and does so on my laptop, it wont do so on my slug. Even if completly umounted. + Openslug does not find this disk. EDIT: I now have spindown on this disk. Strangly it works with debian. I mounted my /var and /tmp on a usb-stick.

  • I do also have a Western Digital MyBook? Essential 500GB I bought with my NSLU2 in Nov 2006. And it does not spin down on the NSLU2. I also reverted to the original Linksys firmware but it still does not spin down. There is also another strange problem - from time to time the NSLU2 just does not boot up - only the ethernet light is on and the slug freezes - I have to unplug the power connector. Then it boots up normaly again - very strange. - Anguel Stankov

3. Method: How to use scsi-idle for spinning down USB disks.

Robert Demski provided a kernel patch as well as a package for the scsi-idle software to be used on the slug.

The build process is quite complicated as it requires setting up a cross-compile environment for the slug currently, until the kernel patch is included in the binary distributions of OpenSlug. The process is described in a blog post on fredericiana.com. Any comments appreciated.

How to use scsi-idle without kernel patch

By Ruud Senden

I've managed to automate spindown using scsi-idle without the kernel patch. I've created the perl script listed below based on a script I found at http://www.rootfs.net/jaws/index.php?gadget=Blog&action=SingleView&id=22:

#!/usr/bin/perl -w

$statfile = "/proc/diskstats";
die "$0: Cannot read $statfile\n" unless -r $statfile;

$| = 1;
($disk, $interval) = (@ARGV);
$disk =~ s,/dev/,,;
print "$0: disk: $disk, interval: $interval\n";

$halted_data = $last_seen = '';
while (1) {
  open(STATUS, $statfile);
  ($_) = grep(/^\s+\d+\s+\d+\s+$disk\s/o, <STATUS>);
  close STATUS;

  if ($last_seen eq $_ && $halted_data ne $_) {
    print "Spinning down: $disk\n";
    system "scsi-stop", "/dev/$disk";
    $halted_data = $_;
  }
  $last_seen = $_;
  sleep $interval;
}

Basically what this script does is take a device as the first argument, and an interval in seconds as the second argument. Every interval seconds it will look at /proc/diskstats for the given device, and if the status didn't change the disk will be spun down. The disk will automatically spin up again when accessed (on my system at least).

Installation instructions:

  1. Install perl
  2. Install the scsi-idle package, which can be downloaded from the Yahoo Files section
  3. Save the perl script listed above to your filesystem, for example named autospindown. Make sure the script is executable: chmod +rx autospindown
  4. Edit /etc/default/scsi-idle to list the timeouts for your drive(s), see the instructions in that file for more information.
  5. Edit /etc/init.d/scsi-idle, changing the DAEMON variable to point to the perl script you saved in step 3.
  6. /etc/init.d/scsi-idle start

I've tested this on my NSLU2 with OpenSlug 2.7 installed, I think a similar approach should work on Unslung as well. Any comments appreciated.

Note - the file "/proc/diskstats" does not exist on Unslung 5.5, so this technique won't work directly on Unslung boxes.

  • note 11th Sept 2006

Installing scsi-idle_2.4.23-r1_armeb.ipk onto unslung 6.8 fails as : ERROR: Cannot satisfy the following dependencies for scsi-idle:

         libgcc1 (>= 3.4.4) libc6 (>= 2.3.5+cvs20050627) **

Shell-only scsi-idle without kernel patch

By Chris

Using Ruud's idea, except implemented as a shell script so you don't need Perl (which is great, but takes a lot of space if you're running from flash only). This seems to work fine with the vanilla OpenSlug firmware, a ByteCC 2.5" external enclosure, and a Seagate 40GB 2.5" drive.

This version updates the status more often than the Perl version which prevents waiting almost a complete extra interval cycle under certain circumstances. Feel free to hack this script and make it better as I didn't spend much time on it.

Stripwax adds: The scsi-idle package and the perl script above follow the convention that the drive to idle is e.g. "dev/sda" whereas the below seems to want to expect just e.g. "sda". In my opinion you will need to change the line "disk=$1" below to something like "disk=${1#/dev/}" or similar

#!/bin/sh

disk=$1
interval=$2

state=`grep "\s$disk\s" /proc/diskstats`
count=$interval
up=1

while [ true ]; do
   sleep 10
   count=$(($count-10))
   newstate=`grep "\s$disk\s" /proc/diskstats`
   if [ "$state" = "$newstate" ]; then
      if [ $count -lt 0 ]; then
         count=$interval
         if [ $up = 1 ]; then
            #echo -e "spin-down\t" `date`
            sync
            state=`grep "\s$disk\s" /proc/diskstats`
            scsi-stop /dev/$disk
            up=0
         fi
      fi
   else
      #echo -e "drive is up\t" `date`
      count=$interval
      state="$newstate"
      up=1
   fi
done

4.Method: Use sg_start to spindown usb disk

for OpenDebianSlug? 3.10 2.16 kernel:

  install sg3 scsi tools: apt-get install sg3-utils
  powerdown hdd: /usr/bin/sg_start 0 -pc=3 /dev/sda
  use shell or perl script for automatic powerdown

System modifications for HD spin-down OR

How to make your standalone USB disk really spindown

[by JNC]

OK, you could tell me : what is this update? I have read much in the MaxtorOneTouch-Howto about the procedure to move /dev and /var back to RAM, so, why another section ?

That's definitively true. Many thanks to those who contributed to write those pages. I just found 2 problems with what I read :

  • it was for Unslung version only (not Openslug) [Unslung version]
  • the process was incomplete (only for /var) and impossible to extend to /dev

As I don't like to complain without acting, here is my contribution from my experience. I hope it can be useful to anybody.

Preamble

The problem

Once everything is running fine, my disk (Maxtor One Touch) does not spin down, as the NSLU2 regularly accesses files from /dev and /var.

The solution

One solution is to move back /dev and /var to RAM.

Debianslug: The script works with debianslug so long as you uncomment the highlighted line (devpts needs to be remounted otherwise on login ssh can not start a shell giving a 'Server refused to allocate pty' error). The script only copies /dev and /var/log but you would do well to tweak /etc/syslog.conf and /etc/logrotate* to be as economical as possible.

The challenge

Creating a RAM resource, and attach /dev and /ram is easy (mount -t ramfs ramfs ... command). But, as the RAM memory is volatile, the challenge is to create a script that will copy all files from /dev and /var into the RAM resources you created, each time you boot the NSLU2. We must deal with two issues :

  • where is the correct location for my script?
  • what is the command to use to copy the unregular files from /dev ?

The procedure

  • cd /etc/init.d

(all init script should be located in this directory, regardless the run levels they are involved in. There should be a link to this script in the run-level-dedicated directory.)

  • Create the following mount_var_dev.sh script :
#!/bin/sh
# /etc/init.d/mount_var_dev.sh
# Script section to create ramdisk for /var and for /dev

# disable the oom-killer to use the full swap
/sbin/sysctl -w vm.overcommit_memory=1

# better only use /var/log then the full /var
/bin/echo "Creating ramfs for /var/log:"
/bin/mount -t ramfs ramfs /mnt -o maxsize=256
/bin/cp -rp /var/log/* /mnt/
/bin/mount -o bind /var/log /var/log.state
/bin/mount -o bind /mnt /var/log
/bin/umount /mnt

/bin/echo "Creating ramfs for /dev:"
/bin/mount -t ramfs ramfs /mnt -o maxsize=256
cd /dev
find . -print0 -mount | cpio -p -0 -d -m -u /mnt
# you can not use cp command for /dev
/bin/mount -o bind /dev /dev.state
/bin/mount -o bind /mnt /dev
/bin/umount /mnt

# Uncomment the following line when using debianslug
#mount devpts /dev/pts -t devpts

# Return and continue execution of system rc.
return 1
# [EOF]
  • chmod 0755 mount_var_dev.sh
  • cd /etc/rcS.d

(this directory contains all scripts for a generic 'Start' run-level, that is run before running level 3)

  • ln -s /etc/init.d/mount_var_dev.sh S37mount_var_dev.sh

(try to do that after activating swap!)

  • chmod 0755 S37mount_var_dev.sh

(all init scripts are supposed to be in /etc/init.d, and linked to the appropriate directory for the appropriate run-level).

  • edit /etc/syslog.conf and remove the /dev/xconsole entry (only used for X11 logging)
  • cd /etc
  • vi fstab

for all partition from the disk that must spin down, add ,noatime to the 4th column (there should be only default). (this will prevent to wake up the disk for cached read access, just to update the 'last access time' flag of the file)

Before

/dev/sda1       /       ext2    defaults        1  1
/dev/sda2       /home   ext2    defaults        1  2

After

/dev/sda1       /       ext2    defaults,noatime        1  1
/dev/sda2       /home   ext2    defaults,noatime        1  2
  • shutdown -r 0

(reboot)

It is done, you can check using the mount command that /dev and /var are now in RAM. Your disk will spindown with the timer you specified.

NOTE: This works fine on my Unslung6.8 slug (with the script in /opt/etc/init.d). Mount now returns:

[..]
/dev/sda1 on /share/flash/data type ext3 (rw,noatime)
/dev/sda2 on /share/flash/conf type ext3 (rw,sync,noatime)
/dev/sdb1 on /share/hdd/data/HDD_1_1_1 type ufsd (rw)
ramfs on /var/log type ramfs (rw)
ramfs on /dev type ramfs (rw)

Why can't I use sdparm to do spindown-magic?

I corresponded with the developer of sdparm (the SCSI version of hdparm) about using this tool to either set spin-down timers or stop/start disks, here's his explanation for why this can't be done currently.


However the major weakness is in the SCSI<->ATA protocol conversion code/silicon inside the external enclosure housing the IDE disk. If it is like the ones I have tested, it supports READ(10)/WRITE(10)/INQUIRY/ READ_CAPACITY SCSI commands only. The MODE_SENSE commands are dummied up by the USB mass storage driver (within linux kernel) so as to not upset the sd (scsi disk) driver.

Spinning down (or up) a disk requires the SCSI START_STOP_UNIT command to be supported. Even SCSI to ATA Translation (SAT) layer that linux does control (e.g. libata for SATA disks) has only recently added that command (a year after libata was released in the kernel). Convincing people that such commands are worthwhile is not an easy task!

So I encourage your persitence but fear the exercise will be futile. Hopefully in a year or so better SAT layers will surface.

an example of a working sdparm (NOT nslu2 btw) With a 2.6.11 Kernel (have not tried others) on a x86 (Via C3) it's possible to spin down a Samsung SV1640N? in an ICY Box "blue" using "sdparm-0.95"

 # sdparm --command=stop /dev/sdb
 /dev/sdb: SAMSUNG   SP1604N           TM10

And turn it on:

 # sdparm --command=start /dev/sdb
 /dev/sdb: SAMSUNG   SP1604N           TM10

hdparm or any disk acces can start it:

 # hdparm -t /dev/sdb
 /dev/sdb:
  Timing buffered disk reads:    2 MB in  5.76 seconds = 355.73 kB/sec

 # hdparm -t /dev/sdb
 /dev/sdb:
  Timing buffered disk reads:   72 MB in  3.06 seconds =  23.56 MB/sec

Wasn't actually tried on NSLU2 (other kernel, no enivronment etc.). But maybe it will work there too? At least with that case that disk and that USB driver it seems to be possible to spin down an USB Drive!

[Zhyla] This didn't work on my "Genesys" USB adapter on my FC3 box (2.6.9 kernel, sdparm-0.95 and 0.96beta).

Can you try running --command=stop and then --command=ready? It should indicate that it isn't ready (i.e. it's spun down).

[rz] Nice idea, but sorry: --command=ready always shows "ready" regardless if the disk is really spun down/sleeping or not.


[rz] Have tried several cases with Linux version 2.6.11 with a Samsung SP1604?(169GB) and an old Maxtor 53073U6(8GB)

[rz]Supporting(!) "stop" (45 Euro Raid Sonic ICY Box 3.5 Combo (USB+FW)):

 P:  Vendor=067b ProdID?=3507 Rev= 0.01
 S:  Product=ATAPI-6 Bridge Controller
 S:  Manufacturer=Prolific Technology Inc.
 Chip: not visible, assuming(!) Profilic PL3507?

[mag] Another enclosure supporting stop is PPA ME-780U2-2162, which also uses a Prolific chipset.

[rz]Not supporting "stop" (15 Euro Evertech):

 P:  Vendor=04b4 ProdID?=6830 Rev= 2.40
 S:  Product=Cypress AT2LP?
 Chip: CY7C68300B?-56PVXC

[rz]Not supporting "stop" (60 Euro Delock? Combo)

 P:  Vendor=0402 ProdID?=5621 Rev= 1.03
 S:  Product=USB 2.0 Storage Device
 Chip: ALI M5621 + Oxford FW

[rz]Not supporting "stop" via USB but "inside" (55Euro atechweb LAN Server HD9?-U2lA?)

 P:  Vendor=05e3 ProdID?=0702 Rev= 0.33
 S:  Product=USB TO IDE
 Chip: GL811E? (FTR: CPU: RDC R2882)

[rz]As the prolific chip set used by radsonic do spin down the disk (really) that can't be a problem with linux, at least not with linux 2.6.11.


[rz]What chip set is used in which Raidsonic case:

IB-550UE Prolific (PL3507?) - Agere (FW8028?) since 02/2005
IB-350/351/360UE Prolific (PL3507?) - Agere (FW8028?)
IB-350/351US Prolific (PL2507?) - Silicon Image (Sil36CT80?)
IB-350/351/360U Cypress (7C68300A)
IB-250/251U Cypress (7C68300A)
IB-355U Ali (M5621A1?)
IB-525U Ali (M5621A1?)
IB-550U Ali (M5621A1?)
IB-350StS without any

http://www.raidsonic.de/de/pages/service/faq.php (It's only in the german FAQ)


IB-351UE - Agere Chip

      Seagate ST3?? 7200.7 (does not accept the KEEP_OVER_RESET-flag: hdparm -K ...)
      sdparm 0.94
      Kernel 2.6.13 (on desktop, not slug) spins down with sdparm --command=stop /dev/sda
      Seagate has a tool called SeaTool?? (like IBM/Hitachi's Featuretool), but it does not
      have any features to set powermanagement or spin down timers.

Why does my disk not spin down?

Why does it spin up after only five minutes?

Which process is accessing the disk?

To answer this sort of question, see HowtoIdentifyWhichProcessesAccessDisk

to:

<a href="http://shrinkurl.us/cialis">cialis</a> http://shrinkurl.us/cialis cialis

December 15, 2006, at 05:16 PM by fcarolo --
Changed lines 1-471 from:

http://urlkick.com/e2c <a href="http://urlkick.com/e2c">free ringtones</a> free ringtones

to:

Contents

Motivation

Not everyone wants a 24/7 running harddisk. A noisy harddisk right beside is awful and the lifespan of a permanently running HD is shorter, too.

Quick Summary

For various technical reasons it is not generally possible to adjust the standby timer of an IDE disk connected through a USB adapter (including turnkey external USB drives). See the sdparm page and the section below on sdparm for the technical reasons.

1. Method: So one method available is to temporarily connect the drive via its IDE connector directly to a big Linux box and run hdparm to set the timer (the -S option is what you're looking for, PLEASE read the hdparm man page before even thinking about running it)[OS independent]. You need an enclosure with separate power and IDE connectors to do this.

Advantage: Can be used on every HD which supports standby regardless of the OS.

Disadvantage: Every time you turn off your HD or there is a power loss you have to repeat the procedure if your drive doesnt support he KEEP_OVER_RESET-flag.

A very similiar method is using a vendor-specific tool (like IBM Feature Tool) to setup the spin-down time before installing the drive into its enclosure.

2. Method: This is a sub-variant of the 1.Method. Simply buy a HD/enlcosure combo which supports down-spinning by itself (e.g. Maxtor OneTouch series, WD Essential Drives)[OS independent]. A simple but probably more expensive method (and i've heard Maxtor OneTouch HDs? are rather noisy, too ;).

3. Method: Another method is to use scsi-idle. However, this requires a kernel patch as the corresponding kernel changes are not yet included in the nslu2-linux binaries. See the scsi-idle section below [applies to Openslug, Unslung].

All methods most often require modifications concerning the syslog- and other daemons because of their behaviour of writing time-marks into their log-files (especially syslog), as this will cause your HD to spin up at certain intervalls.

As of now (June 2006) SDPARM will most certainly NOT WORK on non-combo(FW+USB) drives. Tell us if you found further working drives.

[mag: I own a usb-only enclosure that spins down fine with sdparm. I think it's more of a question of the controller it uses rather than combo vs. non-combo.]

For further details check below.

1. Method: How do I spin down my USB hard disks?

Any drive can have a spindown timeout, provided:

  • The disk can take 'hdparm -S120 /dev/hdx' and spindown after 10 minutes.
  • It is possible to have the drive using the power from the usb-ide adapter while plugged into the normal ide of your pc.

Prerequisites:

- Harddisk with separate IDE and power connectors.

eg. IcyBox? black [http://www.raidsonic.de/de/pages/products/external_cases.php?we_objectID=3206] [ST: this works fine for me].

- Another Linux machine to connect it to with hdparm installed.

1) Take your HD and install it the enclosure (especially the power connector to the drive).

2) Turn on your enclosure.

2) Disconnect the enclosure's IDE connector (if connected) and connect the other Linux machine's IDE connector to the HD.

3) Set the spindown-time 'hdparm -k1 -K1 -S120 /dev/hda' where -Sxx specifies the spindown-time. -k1-K1 set the keep over reset-flags if supported.

4) Disconnect the Linux machine's IDE connector

5) Connect the enclosures IDE connector to the HD !WITHOUT REMOVING THE POWER from the HD!

This way the drive is never reset, and will keep its spindown setting. Of course if hdparm -k1 -K1 -S120 actually makes your drives remember their settings this is irrelevant, but for anyone like me whose drives wont remember their settings this is a way to make them spindown.

For those with enclosures that wont let them do this, I use this. The usb-ide and power supply are completely separate, which make this easy.

[ST: Bought an enclosure with internal SATA interface and external SATA/USB interface IcyBox IB-360StUS-B and installed a Samsung 250GB SATA II (SP2504C?) into it. Connected it via SATA (MB to external slot-connector is included) to my big machine and ran hdparm. Voila, the disk spins down.]

Sub-method: You can download the Power Booster utility for 2.5" IBM/Hitachi TravelStar disks. The Power Booster utility will enable the auto spin down feature of the disk. For 3.5" IBM/Hitachi drives (and maybe others), you can download the Feature Tool. Otherwise temporarily install the IDE disk in your ordinary Linux box, read the disk technical documentation and use hdparm to adjust the settings by hand. The trick is to enable APM within the drive itself, so Linux doesn't have to care about it at all. You can't use hdparm to alter the APM settings from the NSLU2 as the USB->IDE adapters are emulated as SCSI host adapters in the Linux kernel which is incompatible with the necessary hdparm options.

[Request by ingeba]: To my knowledge this does not work. Can anyone verify that APM settings may cause NSLU2 connected drives in arbitrary enclosures to spin down? If so, please list drive and enclosure brand and here:

[slavikb] This worked for me (Hitachi 7K250, noname box, Feature Tool). I had to remount root with -noatime option. The drive goes into Low RPM mode after 10 minutes of inactivity.

Either way, you'll have to open your 2.5" USB enclosure and install the disk drive temporarily to a desktop computer using a 2.5" to 3.5" IDE adapter. After that, you can do the APM adjustment in Windows or Linux.

2.Method: Enclosures with integrated spin-down

For Maxtor OneTouch drives see the Maxtor OneTouch HOWTO.

I just bought a Seagate Baracuda 3.5" drive and installed it in a third party enclosure. Upon contacting their tech support in Europe they stated that:

  • Seagate does not support other power management than managed by the running OS
  • Seagate does not support drives to be installed in third party enclosures
  • Seagate disks do not have a function to retain the power management settings

So I guess my advice would be not to buy the Seagate disks.

By Miro Dietiker As i see, some disks of higher price (and quality?) power down out-of-the-box with a meaningful value configured. If you have a USB disk which does this, extend this list please.

  • 13.03.2006: WesternDigital? Essential - 320 GB USB 2.0 / 3.5" / 7200 rpm (All WD Essential drives seem to implement this feature)
  • 24.03.2003 Maxtor One Touch - 200 Go USB 2.0 / 3.5 " / 7200 rpm
  • 11.05.2006: Seagate 250GB USB 2.0 / 3.5" / 7200 RPM

Note:* 24.04.2006 I have a WesternDigital? Essential - 250 GB USB 2.0 / 3.5" / 7200 rpm and although it supports spindown by hardware and does so on my laptop, it wont do so on my slug. Even if completly umounted. + Openslug does not find this disk. EDIT: I now have spindown on this disk. Strangly it works with debian. I mounted my /var and /tmp on a usb-stick.

  • I do also have a Western Digital MyBook? Essential 500GB I bought with my NSLU2 in Nov 2006. And it does not spin down on the NSLU2. I also reverted to the original Linksys firmware but it still does not spin down. There is also another strange problem - from time to time the NSLU2 just does not boot up - only the ethernet light is on and the slug freezes - I have to unplug the power connector. Then it boots up normaly again - very strange. - Anguel Stankov

3. Method: How to use scsi-idle for spinning down USB disks.

Robert Demski provided a kernel patch as well as a package for the scsi-idle software to be used on the slug.

The build process is quite complicated as it requires setting up a cross-compile environment for the slug currently, until the kernel patch is included in the binary distributions of OpenSlug. The process is described in a blog post on fredericiana.com. Any comments appreciated.

How to use scsi-idle without kernel patch

By Ruud Senden

I've managed to automate spindown using scsi-idle without the kernel patch. I've created the perl script listed below based on a script I found at http://www.rootfs.net/jaws/index.php?gadget=Blog&action=SingleView&id=22:

#!/usr/bin/perl -w

$statfile = "/proc/diskstats";
die "$0: Cannot read $statfile\n" unless -r $statfile;

$| = 1;
($disk, $interval) = (@ARGV);
$disk =~ s,/dev/,,;
print "$0: disk: $disk, interval: $interval\n";

$halted_data = $last_seen = '';
while (1) {
  open(STATUS, $statfile);
  ($_) = grep(/^\s+\d+\s+\d+\s+$disk\s/o, <STATUS>);
  close STATUS;

  if ($last_seen eq $_ && $halted_data ne $_) {
    print "Spinning down: $disk\n";
    system "scsi-stop", "/dev/$disk";
    $halted_data = $_;
  }
  $last_seen = $_;
  sleep $interval;
}

Basically what this script does is take a device as the first argument, and an interval in seconds as the second argument. Every interval seconds it will look at /proc/diskstats for the given device, and if the status didn't change the disk will be spun down. The disk will automatically spin up again when accessed (on my system at least).

Installation instructions:

  1. Install perl
  2. Install the scsi-idle package, which can be downloaded from the Yahoo Files section
  3. Save the perl script listed above to your filesystem, for example named autospindown. Make sure the script is executable: chmod +rx autospindown
  4. Edit /etc/default/scsi-idle to list the timeouts for your drive(s), see the instructions in that file for more information.
  5. Edit /etc/init.d/scsi-idle, changing the DAEMON variable to point to the perl script you saved in step 3.
  6. /etc/init.d/scsi-idle start

I've tested this on my NSLU2 with OpenSlug 2.7 installed, I think a similar approach should work on Unslung as well. Any comments appreciated.

Note - the file "/proc/diskstats" does not exist on Unslung 5.5, so this technique won't work directly on Unslung boxes.

  • note 11th Sept 2006

Installing scsi-idle_2.4.23-r1_armeb.ipk onto unslung 6.8 fails as : ERROR: Cannot satisfy the following dependencies for scsi-idle:

         libgcc1 (>= 3.4.4) libc6 (>= 2.3.5+cvs20050627) **

Shell-only scsi-idle without kernel patch

By Chris

Using Ruud's idea, except implemented as a shell script so you don't need Perl (which is great, but takes a lot of space if you're running from flash only). This seems to work fine with the vanilla OpenSlug firmware, a ByteCC 2.5" external enclosure, and a Seagate 40GB 2.5" drive.

This version updates the status more often than the Perl version which prevents waiting almost a complete extra interval cycle under certain circumstances. Feel free to hack this script and make it better as I didn't spend much time on it.

Stripwax adds: The scsi-idle package and the perl script above follow the convention that the drive to idle is e.g. "dev/sda" whereas the below seems to want to expect just e.g. "sda". In my opinion you will need to change the line "disk=$1" below to something like "disk=${1#/dev/}" or similar

#!/bin/sh

disk=$1
interval=$2

state=`grep "\s$disk\s" /proc/diskstats`
count=$interval
up=1

while [ true ]; do
   sleep 10
   count=$(($count-10))
   newstate=`grep "\s$disk\s" /proc/diskstats`
   if [ "$state" = "$newstate" ]; then
      if [ $count -lt 0 ]; then
         count=$interval
         if [ $up = 1 ]; then
            #echo -e "spin-down\t" `date`
            sync
            state=`grep "\s$disk\s" /proc/diskstats`
            scsi-stop /dev/$disk
            up=0
         fi
      fi
   else
      #echo -e "drive is up\t" `date`
      count=$interval
      state="$newstate"
      up=1
   fi
done

4.Method: Use sg_start to spindown usb disk

for OpenDebianSlug? 3.10 2.16 kernel:

  install sg3 scsi tools: apt-get install sg3-utils
  powerdown hdd: /usr/bin/sg_start 0 -pc=3 /dev/sda
  use shell or perl script for automatic powerdown

System modifications for HD spin-down OR

How to make your standalone USB disk really spindown

[by JNC]

OK, you could tell me : what is this update? I have read much in the MaxtorOneTouch-Howto about the procedure to move /dev and /var back to RAM, so, why another section ?

That's definitively true. Many thanks to those who contributed to write those pages. I just found 2 problems with what I read :

  • it was for Unslung version only (not Openslug) [Unslung version]
  • the process was incomplete (only for /var) and impossible to extend to /dev

As I don't like to complain without acting, here is my contribution from my experience. I hope it can be useful to anybody.

Preamble

The problem

Once everything is running fine, my disk (Maxtor One Touch) does not spin down, as the NSLU2 regularly accesses files from /dev and /var.

The solution

One solution is to move back /dev and /var to RAM.

Debianslug: The script works with debianslug so long as you uncomment the highlighted line (devpts needs to be remounted otherwise on login ssh can not start a shell giving a 'Server refused to allocate pty' error). The script only copies /dev and /var/log but you would do well to tweak /etc/syslog.conf and /etc/logrotate* to be as economical as possible.

The challenge

Creating a RAM resource, and attach /dev and /ram is easy (mount -t ramfs ramfs ... command). But, as the RAM memory is volatile, the challenge is to create a script that will copy all files from /dev and /var into the RAM resources you created, each time you boot the NSLU2. We must deal with two issues :

  • where is the correct location for my script?
  • what is the command to use to copy the unregular files from /dev ?

The procedure

  • cd /etc/init.d

(all init script should be located in this directory, regardless the run levels they are involved in. There should be a link to this script in the run-level-dedicated directory.)

  • Create the following mount_var_dev.sh script :
#!/bin/sh
# /etc/init.d/mount_var_dev.sh
# Script section to create ramdisk for /var and for /dev

# disable the oom-killer to use the full swap
/sbin/sysctl -w vm.overcommit_memory=1

# better only use /var/log then the full /var
/bin/echo "Creating ramfs for /var/log:"
/bin/mount -t ramfs ramfs /mnt -o maxsize=256
/bin/cp -rp /var/log/* /mnt/
/bin/mount -o bind /var/log /var/log.state
/bin/mount -o bind /mnt /var/log
/bin/umount /mnt

/bin/echo "Creating ramfs for /dev:"
/bin/mount -t ramfs ramfs /mnt -o maxsize=256
cd /dev
find . -print0 -mount | cpio -p -0 -d -m -u /mnt
# you can not use cp command for /dev
/bin/mount -o bind /dev /dev.state
/bin/mount -o bind /mnt /dev
/bin/umount /mnt

# Uncomment the following line when using debianslug
#mount devpts /dev/pts -t devpts

# Return and continue execution of system rc.
return 1
# [EOF]
  • chmod 0755 mount_var_dev.sh
  • cd /etc/rcS.d

(this directory contains all scripts for a generic 'Start' run-level, that is run before running level 3)

  • ln -s /etc/init.d/mount_var_dev.sh S37mount_var_dev.sh

(try to do that after activating swap!)

  • chmod 0755 S37mount_var_dev.sh

(all init scripts are supposed to be in /etc/init.d, and linked to the appropriate directory for the appropriate run-level).

  • edit /etc/syslog.conf and remove the /dev/xconsole entry (only used for X11 logging)
  • cd /etc
  • vi fstab

for all partition from the disk that must spin down, add ,noatime to the 4th column (there should be only default). (this will prevent to wake up the disk for cached read access, just to update the 'last access time' flag of the file)

Before

/dev/sda1       /       ext2    defaults        1  1
/dev/sda2       /home   ext2    defaults        1  2

After

/dev/sda1       /       ext2    defaults,noatime        1  1
/dev/sda2       /home   ext2    defaults,noatime        1  2
  • shutdown -r 0

(reboot)

It is done, you can check using the mount command that /dev and /var are now in RAM. Your disk will spindown with the timer you specified.

NOTE: This works fine on my Unslung6.8 slug (with the script in /opt/etc/init.d). Mount now returns:

[..]
/dev/sda1 on /share/flash/data type ext3 (rw,noatime)
/dev/sda2 on /share/flash/conf type ext3 (rw,sync,noatime)
/dev/sdb1 on /share/hdd/data/HDD_1_1_1 type ufsd (rw)
ramfs on /var/log type ramfs (rw)
ramfs on /dev type ramfs (rw)

Why can't I use sdparm to do spindown-magic?

I corresponded with the developer of sdparm (the SCSI version of hdparm) about using this tool to either set spin-down timers or stop/start disks, here's his explanation for why this can't be done currently.


However the major weakness is in the SCSI<->ATA protocol conversion code/silicon inside the external enclosure housing the IDE disk. If it is like the ones I have tested, it supports READ(10)/WRITE(10)/INQUIRY/ READ_CAPACITY SCSI commands only. The MODE_SENSE commands are dummied up by the USB mass storage driver (within linux kernel) so as to not upset the sd (scsi disk) driver.

Spinning down (or up) a disk requires the SCSI START_STOP_UNIT command to be supported. Even SCSI to ATA Translation (SAT) layer that linux does control (e.g. libata for SATA disks) has only recently added that command (a year after libata was released in the kernel). Convincing people that such commands are worthwhile is not an easy task!

So I encourage your persitence but fear the exercise will be futile. Hopefully in a year or so better SAT layers will surface.

an example of a working sdparm (NOT nslu2 btw) With a 2.6.11 Kernel (have not tried others) on a x86 (Via C3) it's possible to spin down a Samsung SV1640N? in an ICY Box "blue" using "sdparm-0.95"

 # sdparm --command=stop /dev/sdb
 /dev/sdb: SAMSUNG   SP1604N           TM10

And turn it on:

 # sdparm --command=start /dev/sdb
 /dev/sdb: SAMSUNG   SP1604N           TM10

hdparm or any disk acces can start it:

 # hdparm -t /dev/sdb
 /dev/sdb:
  Timing buffered disk reads:    2 MB in  5.76 seconds = 355.73 kB/sec

 # hdparm -t /dev/sdb
 /dev/sdb:
  Timing buffered disk reads:   72 MB in  3.06 seconds =  23.56 MB/sec

Wasn't actually tried on NSLU2 (other kernel, no enivronment etc.). But maybe it will work there too? At least with that case that disk and that USB driver it seems to be possible to spin down an USB Drive!

[Zhyla] This didn't work on my "Genesys" USB adapter on my FC3 box (2.6.9 kernel, sdparm-0.95 and 0.96beta).

Can you try running --command=stop and then --command=ready? It should indicate that it isn't ready (i.e. it's spun down).

[rz] Nice idea, but sorry: --command=ready always shows "ready" regardless if the disk is really spun down/sleeping or not.


[rz] Have tried several cases with Linux version 2.6.11 with a Samsung SP1604?(169GB) and an old Maxtor 53073U6(8GB)

[rz]Supporting(!) "stop" (45 Euro Raid Sonic ICY Box 3.5 Combo (USB+FW)):

 P:  Vendor=067b ProdID?=3507 Rev= 0.01
 S:  Product=ATAPI-6 Bridge Controller
 S:  Manufacturer=Prolific Technology Inc.
 Chip: not visible, assuming(!) Profilic PL3507?

[mag] Another enclosure supporting stop is PPA ME-780U2-2162, which also uses a Prolific chipset.

[rz]Not supporting "stop" (15 Euro Evertech):

 P:  Vendor=04b4 ProdID?=6830 Rev= 2.40
 S:  Product=Cypress AT2LP?
 Chip: CY7C68300B?-56PVXC

[rz]Not supporting "stop" (60 Euro Delock? Combo)

 P:  Vendor=0402 ProdID?=5621 Rev= 1.03
 S:  Product=USB 2.0 Storage Device
 Chip: ALI M5621 + Oxford FW

[rz]Not supporting "stop" via USB but "inside" (55Euro atechweb LAN Server HD9?-U2lA?)

 P:  Vendor=05e3 ProdID?=0702 Rev= 0.33
 S:  Product=USB TO IDE
 Chip: GL811E? (FTR: CPU: RDC R2882)

[rz]As the prolific chip set used by radsonic do spin down the disk (really) that can't be a problem with linux, at least not with linux 2.6.11.


[rz]What chip set is used in which Raidsonic case:

IB-550UE Prolific (PL3507?) - Agere (FW8028?) since 02/2005
IB-350/351/360UE Prolific (PL3507?) - Agere (FW8028?)
IB-350/351US Prolific (PL2507?) - Silicon Image (Sil36CT80?)
IB-350/351/360U Cypress (7C68300A)
IB-250/251U Cypress (7C68300A)
IB-355U Ali (M5621A1?)
IB-525U Ali (M5621A1?)
IB-550U Ali (M5621A1?)
IB-350StS without any

http://www.raidsonic.de/de/pages/service/faq.php (It's only in the german FAQ)


IB-351UE - Agere Chip

      Seagate ST3?? 7200.7 (does not accept the KEEP_OVER_RESET-flag: hdparm -K ...)
      sdparm 0.94
      Kernel 2.6.13 (on desktop, not slug) spins down with sdparm --command=stop /dev/sda
      Seagate has a tool called SeaTool?? (like IBM/Hitachi's Featuretool), but it does not
      have any features to set powermanagement or spin down timers.

Why does my disk not spin down?

Why does it spin up after only five minutes?

Which process is accessing the disk?

To answer this sort of question, see HowtoIdentifyWhichProcessesAccessDisk

December 15, 2006, at 04:53 PM by free ringtones --
Changed lines 1-471 from:

Contents

Motivation

Not everyone wants a 24/7 running harddisk. A noisy harddisk right beside is awful and the lifespan of a permanently running HD is shorter, too.

Quick Summary

For various technical reasons it is not generally possible to adjust the standby timer of an IDE disk connected through a USB adapter (including turnkey external USB drives). See the sdparm page and the section below on sdparm for the technical reasons.

1. Method: So one method available is to temporarily connect the drive via its IDE connector directly to a big Linux box and run hdparm to set the timer (the -S option is what you're looking for, PLEASE read the hdparm man page before even thinking about running it)[OS independent]. You need an enclosure with separate power and IDE connectors to do this.

Advantage: Can be used on every HD which supports standby regardless of the OS.

Disadvantage: Every time you turn off your HD or there is a power loss you have to repeat the procedure if your drive doesnt support he KEEP_OVER_RESET-flag.

A very similiar method is using a vendor-specific tool (like IBM Feature Tool) to setup the spin-down time before installing the drive into its enclosure.

2. Method: This is a sub-variant of the 1.Method. Simply buy a HD/enlcosure combo which supports down-spinning by itself (e.g. Maxtor OneTouch series, WD Essential Drives)[OS independent]. A simple but probably more expensive method (and i've heard Maxtor OneTouch HDs? are rather noisy, too ;).

3. Method: Another method is to use scsi-idle. However, this requires a kernel patch as the corresponding kernel changes are not yet included in the nslu2-linux binaries. See the scsi-idle section below [applies to Openslug, Unslung].

All methods most often require modifications concerning the syslog- and other daemons because of their behaviour of writing time-marks into their log-files (especially syslog), as this will cause your HD to spin up at certain intervalls.

As of now (June 2006) SDPARM will most certainly NOT WORK on non-combo(FW+USB) drives. Tell us if you found further working drives.

[mag: I own a usb-only enclosure that spins down fine with sdparm. I think it's more of a question of the controller it uses rather than combo vs. non-combo.]

For further details check below.

1. Method: How do I spin down my USB hard disks?

Any drive can have a spindown timeout, provided:

  • The disk can take 'hdparm -S120 /dev/hdx' and spindown after 10 minutes.
  • It is possible to have the drive using the power from the usb-ide adapter while plugged into the normal ide of your pc.

Prerequisites:

- Harddisk with separate IDE and power connectors.

eg. IcyBox? black [http://www.raidsonic.de/de/pages/products/external_cases.php?we_objectID=3206] [ST: this works fine for me].

- Another Linux machine to connect it to with hdparm installed.

1) Take your HD and install it the enclosure (especially the power connector to the drive).

2) Turn on your enclosure.

2) Disconnect the enclosure's IDE connector (if connected) and connect the other Linux machine's IDE connector to the HD.

3) Set the spindown-time 'hdparm -k1 -K1 -S120 /dev/hda' where -Sxx specifies the spindown-time. -k1-K1 set the keep over reset-flags if supported.

4) Disconnect the Linux machine's IDE connector

5) Connect the enclosures IDE connector to the HD !WITHOUT REMOVING THE POWER from the HD!

This way the drive is never reset, and will keep its spindown setting. Of course if hdparm -k1 -K1 -S120 actually makes your drives remember their settings this is irrelevant, but for anyone like me whose drives wont remember their settings this is a way to make them spindown.

For those with enclosures that wont let them do this, I use this. The usb-ide and power supply are completely separate, which make this easy.

[ST: Bought an enclosure with internal SATA interface and external SATA/USB interface IcyBox IB-360StUS-B and installed a Samsung 250GB SATA II (SP2504C?) into it. Connected it via SATA (MB to external slot-connector is included) to my big machine and ran hdparm. Voila, the disk spins down.]

Sub-method: You can download the Power Booster utility for 2.5" IBM/Hitachi TravelStar disks. The Power Booster utility will enable the auto spin down feature of the disk. For 3.5" IBM/Hitachi drives (and maybe others), you can download the Feature Tool. Otherwise temporarily install the IDE disk in your ordinary Linux box, read the disk technical documentation and use hdparm to adjust the settings by hand. The trick is to enable APM within the drive itself, so Linux doesn't have to care about it at all. You can't use hdparm to alter the APM settings from the NSLU2 as the USB->IDE adapters are emulated as SCSI host adapters in the Linux kernel which is incompatible with the necessary hdparm options.

[Request by ingeba]: To my knowledge this does not work. Can anyone verify that APM settings may cause NSLU2 connected drives in arbitrary enclosures to spin down? If so, please list drive and enclosure brand and here:

[slavikb] This worked for me (Hitachi 7K250, noname box, Feature Tool). I had to remount root with -noatime option. The drive goes into Low RPM mode after 10 minutes of inactivity.

Either way, you'll have to open your 2.5" USB enclosure and install the disk drive temporarily to a desktop computer using a 2.5" to 3.5" IDE adapter. After that, you can do the APM adjustment in Windows or Linux.

2.Method: Enclosures with integrated spin-down

For Maxtor OneTouch drives see the Maxtor OneTouch HOWTO.

I just bought a Seagate Baracuda 3.5" drive and installed it in a third party enclosure. Upon contacting their tech support in Europe they stated that:

  • Seagate does not support other power management than managed by the running OS
  • Seagate does not support drives to be installed in third party enclosures
  • Seagate disks do not have a function to retain the power management settings

So I guess my advice would be not to buy the Seagate disks.

By Miro Dietiker As i see, some disks of higher price (and quality?) power down out-of-the-box with a meaningful value configured. If you have a USB disk which does this, extend this list please.

  • 13.03.2006: WesternDigital? Essential - 320 GB USB 2.0 / 3.5" / 7200 rpm (All WD Essential drives seem to implement this feature)
  • 24.03.2003 Maxtor One Touch - 200 Go USB 2.0 / 3.5 " / 7200 rpm
  • 11.05.2006: Seagate 250GB USB 2.0 / 3.5" / 7200 RPM

Note:* 24.04.2006 I have a WesternDigital? Essential - 250 GB USB 2.0 / 3.5" / 7200 rpm and although it supports spindown by hardware and does so on my laptop, it wont do so on my slug. Even if completly umounted. + Openslug does not find this disk. EDIT: I now have spindown on this disk. Strangly it works with debian. I mounted my /var and /tmp on a usb-stick.

  • I do also have a Western Digital MyBook? Essential 500GB I bought with my NSLU2 in Nov 2006. And it does not spin down on the NSLU2. I also reverted to the original Linksys firmware but it still does not spin down. There is also another strange problem - from time to time the NSLU2 just does not boot up - only the ethernet light is on and the slug freezes - I have to unplug the power connector. Then it boots up normaly again - very strange. - Anguel Stankov

3. Method: How to use scsi-idle for spinning down USB disks.

Robert Demski provided a kernel patch as well as a package for the scsi-idle software to be used on the slug.

The build process is quite complicated as it requires setting up a cross-compile environment for the slug currently, until the kernel patch is included in the binary distributions of OpenSlug. The process is described in a blog post on fredericiana.com. Any comments appreciated.

How to use scsi-idle without kernel patch

By Ruud Senden

I've managed to automate spindown using scsi-idle without the kernel patch. I've created the perl script listed below based on a script I found at http://www.rootfs.net/jaws/index.php?gadget=Blog&action=SingleView&id=22:

#!/usr/bin/perl -w

$statfile = "/proc/diskstats";
die "$0: Cannot read $statfile\n" unless -r $statfile;

$| = 1;
($disk, $interval) = (@ARGV);
$disk =~ s,/dev/,,;
print "$0: disk: $disk, interval: $interval\n";

$halted_data = $last_seen = '';
while (1) {
  open(STATUS, $statfile);
  ($_) = grep(/^\s+\d+\s+\d+\s+$disk\s/o, <STATUS>);
  close STATUS;

  if ($last_seen eq $_ && $halted_data ne $_) {
    print "Spinning down: $disk\n";
    system "scsi-stop", "/dev/$disk";
    $halted_data = $_;
  }
  $last_seen = $_;
  sleep $interval;
}

Basically what this script does is take a device as the first argument, and an interval in seconds as the second argument. Every interval seconds it will look at /proc/diskstats for the given device, and if the status didn't change the disk will be spun down. The disk will automatically spin up again when accessed (on my system at least).

Installation instructions:

  1. Install perl
  2. Install the scsi-idle package, which can be downloaded from the Yahoo Files section
  3. Save the perl script listed above to your filesystem, for example named autospindown. Make sure the script is executable: chmod +rx autospindown
  4. Edit /etc/default/scsi-idle to list the timeouts for your drive(s), see the instructions in that file for more information.
  5. Edit /etc/init.d/scsi-idle, changing the DAEMON variable to point to the perl script you saved in step 3.
  6. /etc/init.d/scsi-idle start

I've tested this on my NSLU2 with OpenSlug 2.7 installed, I think a similar approach should work on Unslung as well. Any comments appreciated.

Note - the file "/proc/diskstats" does not exist on Unslung 5.5, so this technique won't work directly on Unslung boxes.

  • note 11th Sept 2006

Installing scsi-idle_2.4.23-r1_armeb.ipk onto unslung 6.8 fails as : ERROR: Cannot satisfy the following dependencies for scsi-idle:

         libgcc1 (>= 3.4.4) libc6 (>= 2.3.5+cvs20050627) **

Shell-only scsi-idle without kernel patch

By Chris

Using Ruud's idea, except implemented as a shell script so you don't need Perl (which is great, but takes a lot of space if you're running from flash only). This seems to work fine with the vanilla OpenSlug firmware, a ByteCC 2.5" external enclosure, and a Seagate 40GB 2.5" drive.

This version updates the status more often than the Perl version which prevents waiting almost a complete extra interval cycle under certain circumstances. Feel free to hack this script and make it better as I didn't spend much time on it.

Stripwax adds: The scsi-idle package and the perl script above follow the convention that the drive to idle is e.g. "dev/sda" whereas the below seems to want to expect just e.g. "sda". In my opinion you will need to change the line "disk=$1" below to something like "disk=${1#/dev/}" or similar

#!/bin/sh

disk=$1
interval=$2

state=`grep "\s$disk\s" /proc/diskstats`
count=$interval
up=1

while [ true ]; do
   sleep 10
   count=$(($count-10))
   newstate=`grep "\s$disk\s" /proc/diskstats`
   if [ "$state" = "$newstate" ]; then
      if [ $count -lt 0 ]; then
         count=$interval
         if [ $up = 1 ]; then
            #echo -e "spin-down\t" `date`
            sync
            state=`grep "\s$disk\s" /proc/diskstats`
            scsi-stop /dev/$disk
            up=0
         fi
      fi
   else
      #echo -e "drive is up\t" `date`
      count=$interval
      state="$newstate"
      up=1
   fi
done

4.Method: Use sg_start to spindown usb disk

for OpenDebianSlug? 3.10 2.16 kernel:

  install sg3 scsi tools: apt-get install sg3-utils
  powerdown hdd: /usr/bin/sg_start 0 -pc=3 /dev/sda
  use shell or perl script for automatic powerdown

System modifications for HD spin-down OR

How to make your standalone USB disk really spindown

[by JNC]

OK, you could tell me : what is this update? I have read much in the MaxtorOneTouch-Howto about the procedure to move /dev and /var back to RAM, so, why another section ?

That's definitively true. Many thanks to those who contributed to write those pages. I just found 2 problems with what I read :

  • it was for Unslung version only (not Openslug) [Unslung version]
  • the process was incomplete (only for /var) and impossible to extend to /dev

As I don't like to complain without acting, here is my contribution from my experience. I hope it can be useful to anybody.

Preamble

The problem

Once everything is running fine, my disk (Maxtor One Touch) does not spin down, as the NSLU2 regularly accesses files from /dev and /var.

The solution

One solution is to move back /dev and /var to RAM.

Debianslug: The script works with debianslug so long as you uncomment the highlighted line (devpts needs to be remounted otherwise on login ssh can not start a shell giving a 'Server refused to allocate pty' error). The script only copies /dev and /var/log but you would do well to tweak /etc/syslog.conf and /etc/logrotate* to be as economical as possible.

The challenge

Creating a RAM resource, and attach /dev and /ram is easy (mount -t ramfs ramfs ... command). But, as the RAM memory is volatile, the challenge is to create a script that will copy all files from /dev and /var into the RAM resources you created, each time you boot the NSLU2. We must deal with two issues :

  • where is the correct location for my script?
  • what is the command to use to copy the unregular files from /dev ?

The procedure

  • cd /etc/init.d

(all init script should be located in this directory, regardless the run levels they are involved in. There should be a link to this script in the run-level-dedicated directory.)

  • Create the following mount_var_dev.sh script :
#!/bin/sh
# /etc/init.d/mount_var_dev.sh
# Script section to create ramdisk for /var and for /dev

# disable the oom-killer to use the full swap
/sbin/sysctl -w vm.overcommit_memory=1

# better only use /var/log then the full /var
/bin/echo "Creating ramfs for /var/log:"
/bin/mount -t ramfs ramfs /mnt -o maxsize=256
/bin/cp -rp /var/log/* /mnt/
/bin/mount -o bind /var/log /var/log.state
/bin/mount -o bind /mnt /var/log
/bin/umount /mnt

/bin/echo "Creating ramfs for /dev:"
/bin/mount -t ramfs ramfs /mnt -o maxsize=256
cd /dev
find . -print0 -mount | cpio -p -0 -d -m -u /mnt
# you can not use cp command for /dev
/bin/mount -o bind /dev /dev.state
/bin/mount -o bind /mnt /dev
/bin/umount /mnt

# Uncomment the following line when using debianslug
#mount devpts /dev/pts -t devpts

# Return and continue execution of system rc.
return 1
# [EOF]
  • chmod 0755 mount_var_dev.sh
  • cd /etc/rcS.d

(this directory contains all scripts for a generic 'Start' run-level, that is run before running level 3)

  • ln -s /etc/init.d/mount_var_dev.sh S37mount_var_dev.sh

(try to do that after activating swap!)

  • chmod 0755 S37mount_var_dev.sh

(all init scripts are supposed to be in /etc/init.d, and linked to the appropriate directory for the appropriate run-level).

  • edit /etc/syslog.conf and remove the /dev/xconsole entry (only used for X11 logging)
  • cd /etc
  • vi fstab

for all partition from the disk that must spin down, add ,noatime to the 4th column (there should be only default). (this will prevent to wake up the disk for cached read access, just to update the 'last access time' flag of the file)

Before

/dev/sda1       /       ext2    defaults        1  1
/dev/sda2       /home   ext2    defaults        1  2

After

/dev/sda1       /       ext2    defaults,noatime        1  1
/dev/sda2       /home   ext2    defaults,noatime        1  2
  • shutdown -r 0

(reboot)

It is done, you can check using the mount command that /dev and /var are now in RAM. Your disk will spindown with the timer you specified.

NOTE: This works fine on my Unslung6.8 slug (with the script in /opt/etc/init.d). Mount now returns:

[..]
/dev/sda1 on /share/flash/data type ext3 (rw,noatime)
/dev/sda2 on /share/flash/conf type ext3 (rw,sync,noatime)
/dev/sdb1 on /share/hdd/data/HDD_1_1_1 type ufsd (rw)
ramfs on /var/log type ramfs (rw)
ramfs on /dev type ramfs (rw)

Why can't I use sdparm to do spindown-magic?

I corresponded with the developer of sdparm (the SCSI version of hdparm) about using this tool to either set spin-down timers or stop/start disks, here's his explanation for why this can't be done currently.


However the major weakness is in the SCSI<->ATA protocol conversion code/silicon inside the external enclosure housing the IDE disk. If it is like the ones I have tested, it supports READ(10)/WRITE(10)/INQUIRY/ READ_CAPACITY SCSI commands only. The MODE_SENSE commands are dummied up by the USB mass storage driver (within linux kernel) so as to not upset the sd (scsi disk) driver.

Spinning down (or up) a disk requires the SCSI START_STOP_UNIT command to be supported. Even SCSI to ATA Translation (SAT) layer that linux does control (e.g. libata for SATA disks) has only recently added that command (a year after libata was released in the kernel). Convincing people that such commands are worthwhile is not an easy task!

So I encourage your persitence but fear the exercise will be futile. Hopefully in a year or so better SAT layers will surface.

an example of a working sdparm (NOT nslu2 btw) With a 2.6.11 Kernel (have not tried others) on a x86 (Via C3) it's possible to spin down a Samsung SV1640N? in an ICY Box "blue" using "sdparm-0.95"

 # sdparm --command=stop /dev/sdb
 /dev/sdb: SAMSUNG   SP1604N           TM10

And turn it on:

 # sdparm --command=start /dev/sdb
 /dev/sdb: SAMSUNG   SP1604N           TM10

hdparm or any disk acces can start it:

 # hdparm -t /dev/sdb
 /dev/sdb:
  Timing buffered disk reads:    2 MB in  5.76 seconds = 355.73 kB/sec

 # hdparm -t /dev/sdb
 /dev/sdb:
  Timing buffered disk reads:   72 MB in  3.06 seconds =  23.56 MB/sec

Wasn't actually tried on NSLU2 (other kernel, no enivronment etc.). But maybe it will work there too? At least with that case that disk and that USB driver it seems to be possible to spin down an USB Drive!

[Zhyla] This didn't work on my "Genesys" USB adapter on my FC3 box (2.6.9 kernel, sdparm-0.95 and 0.96beta).

Can you try running --command=stop and then --command=ready? It should indicate that it isn't ready (i.e. it's spun down).

[rz] Nice idea, but sorry: --command=ready always shows "ready" regardless if the disk is really spun down/sleeping or not.


[rz] Have tried several cases with Linux version 2.6.11 with a Samsung SP1604?(169GB) and an old Maxtor 53073U6(8GB)

[rz]Supporting(!) "stop" (45 Euro Raid Sonic ICY Box 3.5 Combo (USB+FW)):

 P:  Vendor=067b ProdID?=3507 Rev= 0.01
 S:  Product=ATAPI-6 Bridge Controller
 S:  Manufacturer=Prolific Technology Inc.
 Chip: not visible, assuming(!) Profilic PL3507?

[mag] Another enclosure supporting stop is PPA ME-780U2-2162, which also uses a Prolific chipset.

[rz]Not supporting "stop" (15 Euro Evertech):

 P:  Vendor=04b4 ProdID?=6830 Rev= 2.40
 S:  Product=Cypress AT2LP?
 Chip: CY7C68300B?-56PVXC

[rz]Not supporting "stop" (60 Euro Delock? Combo)

 P:  Vendor=0402 ProdID?=5621 Rev= 1.03
 S:  Product=USB 2.0 Storage Device
 Chip: ALI M5621 + Oxford FW

[rz]Not supporting "stop" via USB but "inside" (55Euro atechweb LAN Server HD9?-U2lA?)

 P:  Vendor=05e3 ProdID?=0702 Rev= 0.33
 S:  Product=USB TO IDE
 Chip: GL811E? (FTR: CPU: RDC R2882)

[rz]As the prolific chip set used by radsonic do spin down the disk (really) that can't be a problem with linux, at least not with linux 2.6.11.


[rz]What chip set is used in which Raidsonic case:

IB-550UE Prolific (PL3507?) - Agere (FW8028?) since 02/2005
IB-350/351/360UE Prolific (PL3507?) - Agere (FW8028?)
IB-350/351US Prolific (PL2507?) - Silicon Image (Sil36CT80?)
IB-350/351/360U Cypress (7C68300A)
IB-250/251U Cypress (7C68300A)
IB-355U Ali (M5621A1?)
IB-525U Ali (M5621A1?)
IB-550U Ali (M5621A1?)
IB-350StS without any

http://www.raidsonic.de/de/pages/service/faq.php (It's only in the german FAQ)


IB-351UE - Agere Chip

      Seagate ST3?? 7200.7 (does not accept the KEEP_OVER_RESET-flag: hdparm -K ...)
      sdparm 0.94
      Kernel 2.6.13 (on desktop, not slug) spins down with sdparm --command=stop /dev/sda
      Seagate has a tool called SeaTool?? (like IBM/Hitachi's Featuretool), but it does not
      have any features to set powermanagement or spin down timers.

Why does my disk not spin down?

Why does it spin up after only five minutes?

Which process is accessing the disk?

To answer this sort of question, see HowtoIdentifyWhichProcessesAccessDisk

to:

http://urlkick.com/e2c <a href="http://urlkick.com/e2c">free ringtones</a> free ringtones

December 15, 2006, at 12:50 PM by tenfoot -- remove spam
Changed lines 1-471 from:

http://myblog.es/allfreeringtones <a href="http://myblog.es/allfreeringtones">free ringtones</a> free ringtones

to:

Contents

Motivation

Not everyone wants a 24/7 running harddisk. A noisy harddisk right beside is awful and the lifespan of a permanently running HD is shorter, too.

Quick Summary

For various technical reasons it is not generally possible to adjust the standby timer of an IDE disk connected through a USB adapter (including turnkey external USB drives). See the sdparm page and the section below on sdparm for the technical reasons.

1. Method: So one method available is to temporarily connect the drive via its IDE connector directly to a big Linux box and run hdparm to set the timer (the -S option is what you're looking for, PLEASE read the hdparm man page before even thinking about running it)[OS independent]. You need an enclosure with separate power and IDE connectors to do this.

Advantage: Can be used on every HD which supports standby regardless of the OS.

Disadvantage: Every time you turn off your HD or there is a power loss you have to repeat the procedure if your drive doesnt support he KEEP_OVER_RESET-flag.

A very similiar method is using a vendor-specific tool (like IBM Feature Tool) to setup the spin-down time before installing the drive into its enclosure.

2. Method: This is a sub-variant of the 1.Method. Simply buy a HD/enlcosure combo which supports down-spinning by itself (e.g. Maxtor OneTouch series, WD Essential Drives)[OS independent]. A simple but probably more expensive method (and i've heard Maxtor OneTouch HDs? are rather noisy, too ;).

3. Method: Another method is to use scsi-idle. However, this requires a kernel patch as the corresponding kernel changes are not yet included in the nslu2-linux binaries. See the scsi-idle section below [applies to Openslug, Unslung].

All methods most often require modifications concerning the syslog- and other daemons because of their behaviour of writing time-marks into their log-files (especially syslog), as this will cause your HD to spin up at certain intervalls.

As of now (June 2006) SDPARM will most certainly NOT WORK on non-combo(FW+USB) drives. Tell us if you found further working drives.

[mag: I own a usb-only enclosure that spins down fine with sdparm. I think it's more of a question of the controller it uses rather than combo vs. non-combo.]

For further details check below.

1. Method: How do I spin down my USB hard disks?

Any drive can have a spindown timeout, provided:

  • The disk can take 'hdparm -S120 /dev/hdx' and spindown after 10 minutes.
  • It is possible to have the drive using the power from the usb-ide adapter while plugged into the normal ide of your pc.

Prerequisites:

- Harddisk with separate IDE and power connectors.

eg. IcyBox? black [http://www.raidsonic.de/de/pages/products/external_cases.php?we_objectID=3206] [ST: this works fine for me].

- Another Linux machine to connect it to with hdparm installed.

1) Take your HD and install it the enclosure (especially the power connector to the drive).

2) Turn on your enclosure.

2) Disconnect the enclosure's IDE connector (if connected) and connect the other Linux machine's IDE connector to the HD.

3) Set the spindown-time 'hdparm -k1 -K1 -S120 /dev/hda' where -Sxx specifies the spindown-time. -k1-K1 set the keep over reset-flags if supported.

4) Disconnect the Linux machine's IDE connector

5) Connect the enclosures IDE connector to the HD !WITHOUT REMOVING THE POWER from the HD!

This way the drive is never reset, and will keep its spindown setting. Of course if hdparm -k1 -K1 -S120 actually makes your drives remember their settings this is irrelevant, but for anyone like me whose drives wont remember their settings this is a way to make them spindown.

For those with enclosures that wont let them do this, I use this. The usb-ide and power supply are completely separate, which make this easy.

[ST: Bought an enclosure with internal SATA interface and external SATA/USB interface IcyBox IB-360StUS-B and installed a Samsung 250GB SATA II (SP2504C?) into it. Connected it via SATA (MB to external slot-connector is included) to my big machine and ran hdparm. Voila, the disk spins down.]

Sub-method: You can download the Power Booster utility for 2.5" IBM/Hitachi TravelStar disks. The Power Booster utility will enable the auto spin down feature of the disk. For 3.5" IBM/Hitachi drives (and maybe others), you can download the Feature Tool. Otherwise temporarily install the IDE disk in your ordinary Linux box, read the disk technical documentation and use hdparm to adjust the settings by hand. The trick is to enable APM within the drive itself, so Linux doesn't have to care about it at all. You can't use hdparm to alter the APM settings from the NSLU2 as the USB->IDE adapters are emulated as SCSI host adapters in the Linux kernel which is incompatible with the necessary hdparm options.

[Request by ingeba]: To my knowledge this does not work. Can anyone verify that APM settings may cause NSLU2 connected drives in arbitrary enclosures to spin down? If so, please list drive and enclosure brand and here:

[slavikb] This worked for me (Hitachi 7K250, noname box, Feature Tool). I had to remount root with -noatime option. The drive goes into Low RPM mode after 10 minutes of inactivity.

Either way, you'll have to open your 2.5" USB enclosure and install the disk drive temporarily to a desktop computer using a 2.5" to 3.5" IDE adapter. After that, you can do the APM adjustment in Windows or Linux.

2.Method: Enclosures with integrated spin-down

For Maxtor OneTouch drives see the Maxtor OneTouch HOWTO.

I just bought a Seagate Baracuda 3.5" drive and installed it in a third party enclosure. Upon contacting their tech support in Europe they stated that:

  • Seagate does not support other power management than managed by the running OS
  • Seagate does not support drives to be installed in third party enclosures
  • Seagate disks do not have a function to retain the power management settings

So I guess my advice would be not to buy the Seagate disks.

By Miro Dietiker As i see, some disks of higher price (and quality?) power down out-of-the-box with a meaningful value configured. If you have a USB disk which does this, extend this list please.

  • 13.03.2006: WesternDigital? Essential - 320 GB USB 2.0 / 3.5" / 7200 rpm (All WD Essential drives seem to implement this feature)
  • 24.03.2003 Maxtor One Touch - 200 Go USB 2.0 / 3.5 " / 7200 rpm
  • 11.05.2006: Seagate 250GB USB 2.0 / 3.5" / 7200 RPM

Note:* 24.04.2006 I have a WesternDigital? Essential - 250 GB USB 2.0 / 3.5" / 7200 rpm and although it supports spindown by hardware and does so on my laptop, it wont do so on my slug. Even if completly umounted. + Openslug does not find this disk. EDIT: I now have spindown on this disk. Strangly it works with debian. I mounted my /var and /tmp on a usb-stick.

  • I do also have a Western Digital MyBook? Essential 500GB I bought with my NSLU2 in Nov 2006. And it does not spin down on the NSLU2. I also reverted to the original Linksys firmware but it still does not spin down. There is also another strange problem - from time to time the NSLU2 just does not boot up - only the ethernet light is on and the slug freezes - I have to unplug the power connector. Then it boots up normaly again - very strange. - Anguel Stankov

3. Method: How to use scsi-idle for spinning down USB disks.

Robert Demski provided a kernel patch as well as a package for the scsi-idle software to be used on the slug.

The build process is quite complicated as it requires setting up a cross-compile environment for the slug currently, until the kernel patch is included in the binary distributions of OpenSlug. The process is described in a blog post on fredericiana.com. Any comments appreciated.

How to use scsi-idle without kernel patch

By Ruud Senden

I've managed to automate spindown using scsi-idle without the kernel patch. I've created the perl script listed below based on a script I found at http://www.rootfs.net/jaws/index.php?gadget=Blog&action=SingleView&id=22:

#!/usr/bin/perl -w

$statfile = "/proc/diskstats";
die "$0: Cannot read $statfile\n" unless -r $statfile;

$| = 1;
($disk, $interval) = (@ARGV);
$disk =~ s,/dev/,,;
print "$0: disk: $disk, interval: $interval\n";

$halted_data = $last_seen = '';
while (1) {
  open(STATUS, $statfile);
  ($_) = grep(/^\s+\d+\s+\d+\s+$disk\s/o, <STATUS>);
  close STATUS;

  if ($last_seen eq $_ && $halted_data ne $_) {
    print "Spinning down: $disk\n";
    system "scsi-stop", "/dev/$disk";
    $halted_data = $_;
  }
  $last_seen = $_;
  sleep $interval;
}

Basically what this script does is take a device as the first argument, and an interval in seconds as the second argument. Every interval seconds it will look at /proc/diskstats for the given device, and if the status didn't change the disk will be spun down. The disk will automatically spin up again when accessed (on my system at least).

Installation instructions:

  1. Install perl
  2. Install the scsi-idle package, which can be downloaded from the Yahoo Files section
  3. Save the perl script listed above to your filesystem, for example named autospindown. Make sure the script is executable: chmod +rx autospindown
  4. Edit /etc/default/scsi-idle to list the timeouts for your drive(s), see the instructions in that file for more information.
  5. Edit /etc/init.d/scsi-idle, changing the DAEMON variable to point to the perl script you saved in step 3.
  6. /etc/init.d/scsi-idle start

I've tested this on my NSLU2 with OpenSlug 2.7 installed, I think a similar approach should work on Unslung as well. Any comments appreciated.

Note - the file "/proc/diskstats" does not exist on Unslung 5.5, so this technique won't work directly on Unslung boxes.

  • note 11th Sept 2006

Installing scsi-idle_2.4.23-r1_armeb.ipk onto unslung 6.8 fails as : ERROR: Cannot satisfy the following dependencies for scsi-idle:

         libgcc1 (>= 3.4.4) libc6 (>= 2.3.5+cvs20050627) **

Shell-only scsi-idle without kernel patch

By Chris

Using Ruud's idea, except implemented as a shell script so you don't need Perl (which is great, but takes a lot of space if you're running from flash only). This seems to work fine with the vanilla OpenSlug firmware, a ByteCC 2.5" external enclosure, and a Seagate 40GB 2.5" drive.

This version updates the status more often than the Perl version which prevents waiting almost a complete extra interval cycle under certain circumstances. Feel free to hack this script and make it better as I didn't spend much time on it.

Stripwax adds: The scsi-idle package and the perl script above follow the convention that the drive to idle is e.g. "dev/sda" whereas the below seems to want to expect just e.g. "sda". In my opinion you will need to change the line "disk=$1" below to something like "disk=${1#/dev/}" or similar

#!/bin/sh

disk=$1
interval=$2

state=`grep "\s$disk\s" /proc/diskstats`
count=$interval
up=1

while [ true ]; do
   sleep 10
   count=$(($count-10))
   newstate=`grep "\s$disk\s" /proc/diskstats`
   if [ "$state" = "$newstate" ]; then
      if [ $count -lt 0 ]; then
         count=$interval
         if [ $up = 1 ]; then
            #echo -e "spin-down\t" `date`
            sync
            state=`grep "\s$disk\s" /proc/diskstats`
            scsi-stop /dev/$disk
            up=0
         fi
      fi
   else
      #echo -e "drive is up\t" `date`
      count=$interval
      state="$newstate"
      up=1
   fi
done

4.Method: Use sg_start to spindown usb disk

for OpenDebianSlug? 3.10 2.16 kernel:

  install sg3 scsi tools: apt-get install sg3-utils
  powerdown hdd: /usr/bin/sg_start 0 -pc=3 /dev/sda
  use shell or perl script for automatic powerdown

System modifications for HD spin-down OR

How to make your standalone USB disk really spindown

[by JNC]

OK, you could tell me : what is this update? I have read much in the MaxtorOneTouch-Howto about the procedure to move /dev and /var back to RAM, so, why another section ?

That's definitively true. Many thanks to those who contributed to write those pages. I just found 2 problems with what I read :

  • it was for Unslung version only (not Openslug) [Unslung version]
  • the process was incomplete (only for /var) and impossible to extend to /dev

As I don't like to complain without acting, here is my contribution from my experience. I hope it can be useful to anybody.

Preamble

The problem

Once everything is running fine, my disk (Maxtor One Touch) does not spin down, as the NSLU2 regularly accesses files from /dev and /var.

The solution

One solution is to move back /dev and /var to RAM.

Debianslug: The script works with debianslug so long as you uncomment the highlighted line (devpts needs to be remounted otherwise on login ssh can not start a shell giving a 'Server refused to allocate pty' error). The script only copies /dev and /var/log but you would do well to tweak /etc/syslog.conf and /etc/logrotate* to be as economical as possible.

The challenge

Creating a RAM resource, and attach /dev and /ram is easy (mount -t ramfs ramfs ... command). But, as the RAM memory is volatile, the challenge is to create a script that will copy all files from /dev and /var into the RAM resources you created, each time you boot the NSLU2. We must deal with two issues :

  • where is the correct location for my script?
  • what is the command to use to copy the unregular files from /dev ?

The procedure

  • cd /etc/init.d

(all init script should be located in this directory, regardless the run levels they are involved in. There should be a link to this script in the run-level-dedicated directory.)

  • Create the following mount_var_dev.sh script :
#!/bin/sh
# /etc/init.d/mount_var_dev.sh
# Script section to create ramdisk for /var and for /dev

# disable the oom-killer to use the full swap
/sbin/sysctl -w vm.overcommit_memory=1

# better only use /var/log then the full /var
/bin/echo "Creating ramfs for /var/log:"
/bin/mount -t ramfs ramfs /mnt -o maxsize=256
/bin/cp -rp /var/log/* /mnt/
/bin/mount -o bind /var/log /var/log.state
/bin/mount -o bind /mnt /var/log
/bin/umount /mnt

/bin/echo "Creating ramfs for /dev:"
/bin/mount -t ramfs ramfs /mnt -o maxsize=256
cd /dev
find . -print0 -mount | cpio -p -0 -d -m -u /mnt
# you can not use cp command for /dev
/bin/mount -o bind /dev /dev.state
/bin/mount -o bind /mnt /dev
/bin/umount /mnt

# Uncomment the following line when using debianslug
#mount devpts /dev/pts -t devpts

# Return and continue execution of system rc.
return 1
# [EOF]
  • chmod 0755 mount_var_dev.sh
  • cd /etc/rcS.d

(this directory contains all scripts for a generic 'Start' run-level, that is run before running level 3)

  • ln -s /etc/init.d/mount_var_dev.sh S37mount_var_dev.sh

(try to do that after activating swap!)

  • chmod 0755 S37mount_var_dev.sh

(all init scripts are supposed to be in /etc/init.d, and linked to the appropriate directory for the appropriate run-level).

  • edit /etc/syslog.conf and remove the /dev/xconsole entry (only used for X11 logging)
  • cd /etc
  • vi fstab

for all partition from the disk that must spin down, add ,noatime to the 4th column (there should be only default). (this will prevent to wake up the disk for cached read access, just to update the 'last access time' flag of the file)

Before

/dev/sda1       /       ext2    defaults        1  1
/dev/sda2       /home   ext2    defaults        1  2

After

/dev/sda1       /       ext2    defaults,noatime        1  1
/dev/sda2       /home   ext2    defaults,noatime        1  2
  • shutdown -r 0

(reboot)

It is done, you can check using the mount command that /dev and /var are now in RAM. Your disk will spindown with the timer you specified.

NOTE: This works fine on my Unslung6.8 slug (with the script in /opt/etc/init.d). Mount now returns:

[..]
/dev/sda1 on /share/flash/data type ext3 (rw,noatime)
/dev/sda2 on /share/flash/conf type ext3 (rw,sync,noatime)
/dev/sdb1 on /share/hdd/data/HDD_1_1_1 type ufsd (rw)
ramfs on /var/log type ramfs (rw)
ramfs on /dev type ramfs (rw)

Why can't I use sdparm to do spindown-magic?

I corresponded with the developer of sdparm (the SCSI version of hdparm) about using this tool to either set spin-down timers or stop/start disks, here's his explanation for why this can't be done currently.


However the major weakness is in the SCSI<->ATA protocol conversion code/silicon inside the external enclosure housing the IDE disk. If it is like the ones I have tested, it supports READ(10)/WRITE(10)/INQUIRY/ READ_CAPACITY SCSI commands only. The MODE_SENSE commands are dummied up by the USB mass storage driver (within linux kernel) so as to not upset the sd (scsi disk) driver.

Spinning down (or up) a disk requires the SCSI START_STOP_UNIT command to be supported. Even SCSI to ATA Translation (SAT) layer that linux does control (e.g. libata for SATA disks) has only recently added that command (a year after libata was released in the kernel). Convincing people that such commands are worthwhile is not an easy task!

So I encourage your persitence but fear the exercise will be futile. Hopefully in a year or so better SAT layers will surface.

an example of a working sdparm (NOT nslu2 btw) With a 2.6.11 Kernel (have not tried others) on a x86 (Via C3) it's possible to spin down a Samsung SV1640N? in an ICY Box "blue" using "sdparm-0.95"

 # sdparm --command=stop /dev/sdb
 /dev/sdb: SAMSUNG   SP1604N           TM10

And turn it on:

 # sdparm --command=start /dev/sdb
 /dev/sdb: SAMSUNG   SP1604N           TM10

hdparm or any disk acces can start it:

 # hdparm -t /dev/sdb
 /dev/sdb:
  Timing buffered disk reads:    2 MB in  5.76 seconds = 355.73 kB/sec

 # hdparm -t /dev/sdb
 /dev/sdb:
  Timing buffered disk reads:   72 MB in  3.06 seconds =  23.56 MB/sec

Wasn't actually tried on NSLU2 (other kernel, no enivronment etc.). But maybe it will work there too? At least with that case that disk and that USB driver it seems to be possible to spin down an USB Drive!

[Zhyla] This didn't work on my "Genesys" USB adapter on my FC3 box (2.6.9 kernel, sdparm-0.95 and 0.96beta).

Can you try running --command=stop and then --command=ready? It should indicate that it isn't ready (i.e. it's spun down).

[rz] Nice idea, but sorry: --command=ready always shows "ready" regardless if the disk is really spun down/sleeping or not.


[rz] Have tried several cases with Linux version 2.6.11 with a Samsung SP1604?(169GB) and an old Maxtor 53073U6(8GB)

[rz]Supporting(!) "stop" (45 Euro Raid Sonic ICY Box 3.5 Combo (USB+FW)):

 P:  Vendor=067b ProdID?=3507 Rev= 0.01
 S:  Product=ATAPI-6 Bridge Controller
 S:  Manufacturer=Prolific Technology Inc.
 Chip: not visible, assuming(!) Profilic PL3507?

[mag] Another enclosure supporting stop is PPA ME-780U2-2162, which also uses a Prolific chipset.

[rz]Not supporting "stop" (15 Euro Evertech):

 P:  Vendor=04b4 ProdID?=6830 Rev= 2.40
 S:  Product=Cypress AT2LP?
 Chip: CY7C68300B?-56PVXC

[rz]Not supporting "stop" (60 Euro Delock? Combo)

 P:  Vendor=0402 ProdID?=5621 Rev= 1.03
 S:  Product=USB 2.0 Storage Device
 Chip: ALI M5621 + Oxford FW

[rz]Not supporting "stop" via USB but "inside" (55Euro atechweb LAN Server HD9?-U2lA?)

 P:  Vendor=05e3 ProdID?=0702 Rev= 0.33
 S:  Product=USB TO IDE
 Chip: GL811E? (FTR: CPU: RDC R2882)

[rz]As the prolific chip set used by radsonic do spin down the disk (really) that can't be a problem with linux, at least not with linux 2.6.11.


[rz]What chip set is used in which Raidsonic case:

IB-550UE Prolific (PL3507?) - Agere (FW8028?) since 02/2005
IB-350/351/360UE Prolific (PL3507?) - Agere (FW8028?)
IB-350/351US Prolific (PL2507?) - Silicon Image (Sil36CT80?)
IB-350/351/360U Cypress (7C68300A)
IB-250/251U Cypress (7C68300A)
IB-355U Ali (M5621A1?)
IB-525U Ali (M5621A1?)
IB-550U Ali (M5621A1?)
IB-350StS without any

http://www.raidsonic.de/de/pages/service/faq.php (It's only in the german FAQ)


IB-351UE - Agere Chip

      Seagate ST3?? 7200.7 (does not accept the KEEP_OVER_RESET-flag: hdparm -K ...)
      sdparm 0.94
      Kernel 2.6.13 (on desktop, not slug) spins down with sdparm --command=stop /dev/sda
      Seagate has a tool called SeaTool?? (like IBM/Hitachi's Featuretool), but it does not
      have any features to set powermanagement or spin down timers.

Why does my disk not spin down?

Why does it spin up after only five minutes?

Which process is accessing the disk?

To answer this sort of question, see HowtoIdentifyWhichProcessesAccessDisk

December 15, 2006, at 12:17 PM by free ringtones --
Changed lines 1-471 from:

Contents

Motivation

Not everyone wants a 24/7 running harddisk. A noisy harddisk right beside is awful and the lifespan of a permanently running HD is shorter, too.

Quick Summary

For various technical reasons it is not generally possible to adjust the standby timer of an IDE disk connected through a USB adapter (including turnkey external USB drives). See the sdparm page and the section below on sdparm for the technical reasons.

1. Method: So one method available is to temporarily connect the drive via its IDE connector directly to a big Linux box and run hdparm to set the timer (the -S option is what you're looking for, PLEASE read the hdparm man page before even thinking about running it)[OS independent]. You need an enclosure with separate power and IDE connectors to do this.

Advantage: Can be used on every HD which supports standby regardless of the OS.

Disadvantage: Every time you turn off your HD or there is a power loss you have to repeat the procedure if your drive doesnt support he KEEP_OVER_RESET-flag.

A very similiar method is using a vendor-specific tool (like IBM Feature Tool) to setup the spin-down time before installing the drive into its enclosure.

2. Method: This is a sub-variant of the 1.Method. Simply buy a HD/enlcosure combo which supports down-spinning by itself (e.g. Maxtor OneTouch series, WD Essential Drives)[OS independent]. A simple but probably more expensive method (and i've heard Maxtor OneTouch HDs? are rather noisy, too ;).

3. Method: Another method is to use scsi-idle. However, this requires a kernel patch as the corresponding kernel changes are not yet included in the nslu2-linux binaries. See the scsi-idle section below [applies to Openslug, Unslung].

All methods most often require modifications concerning the syslog- and other daemons because of their behaviour of writing time-marks into their log-files (especially syslog), as this will cause your HD to spin up at certain intervalls.

As of now (June 2006) SDPARM will most certainly NOT WORK on non-combo(FW+USB) drives. Tell us if you found further working drives.

[mag: I own a usb-only enclosure that spins down fine with sdparm. I think it's more of a question of the controller it uses rather than combo vs. non-combo.]

For further details check below.

1. Method: How do I spin down my USB hard disks?

Any drive can have a spindown timeout, provided:

  • The disk can take 'hdparm -S120 /dev/hdx' and spindown after 10 minutes.
  • It is possible to have the drive using the power from the usb-ide adapter while plugged into the normal ide of your pc.

Prerequisites:

- Harddisk with separate IDE and power connectors.

eg. IcyBox? black [http://www.raidsonic.de/de/pages/products/external_cases.php?we_objectID=3206] [ST: this works fine for me].

- Another Linux machine to connect it to with hdparm installed.

1) Take your HD and install it the enclosure (especially the power connector to the drive).

2) Turn on your enclosure.

2) Disconnect the enclosure's IDE connector (if connected) and connect the other Linux machine's IDE connector to the HD.

3) Set the spindown-time 'hdparm -k1 -K1 -S120 /dev/hda' where -Sxx specifies the spindown-time. -k1-K1 set the keep over reset-flags if supported.

4) Disconnect the Linux machine's IDE connector

5) Connect the enclosures IDE connector to the HD !WITHOUT REMOVING THE POWER from the HD!

This way the drive is never reset, and will keep its spindown setting. Of course if hdparm -k1 -K1 -S120 actually makes your drives remember their settings this is irrelevant, but for anyone like me whose drives wont remember their settings this is a way to make them spindown.

For those with enclosures that wont let them do this, I use this. The usb-ide and power supply are completely separate, which make this easy.

[ST: Bought an enclosure with internal SATA interface and external SATA/USB interface IcyBox IB-360StUS-B and installed a Samsung 250GB SATA II (SP2504C?) into it. Connected it via SATA (MB to external slot-connector is included) to my big machine and ran hdparm. Voila, the disk spins down.]

Sub-method: You can download the Power Booster utility for 2.5" IBM/Hitachi TravelStar disks. The Power Booster utility will enable the auto spin down feature of the disk. For 3.5" IBM/Hitachi drives (and maybe others), you can download the Feature Tool. Otherwise temporarily install the IDE disk in your ordinary Linux box, read the disk technical documentation and use hdparm to adjust the settings by hand. The trick is to enable APM within the drive itself, so Linux doesn't have to care about it at all. You can't use hdparm to alter the APM settings from the NSLU2 as the USB->IDE adapters are emulated as SCSI host adapters in the Linux kernel which is incompatible with the necessary hdparm options.

[Request by ingeba]: To my knowledge this does not work. Can anyone verify that APM settings may cause NSLU2 connected drives in arbitrary enclosures to spin down? If so, please list drive and enclosure brand and here:

[slavikb] This worked for me (Hitachi 7K250, noname box, Feature Tool). I had to remount root with -noatime option. The drive goes into Low RPM mode after 10 minutes of inactivity.

Either way, you'll have to open your 2.5" USB enclosure and install the disk drive temporarily to a desktop computer using a 2.5" to 3.5" IDE adapter. After that, you can do the APM adjustment in Windows or Linux.

2.Method: Enclosures with integrated spin-down

For Maxtor OneTouch drives see the Maxtor OneTouch HOWTO.

I just bought a Seagate Baracuda 3.5" drive and installed it in a third party enclosure. Upon contacting their tech support in Europe they stated that:

  • Seagate does not support other power management than managed by the running OS
  • Seagate does not support drives to be installed in third party enclosures
  • Seagate disks do not have a function to retain the power management settings

So I guess my advice would be not to buy the Seagate disks.

By Miro Dietiker As i see, some disks of higher price (and quality?) power down out-of-the-box with a meaningful value configured. If you have a USB disk which does this, extend this list please.

  • 13.03.2006: WesternDigital? Essential - 320 GB USB 2.0 / 3.5" / 7200 rpm (All WD Essential drives seem to implement this feature)
  • 24.03.2003 Maxtor One Touch - 200 Go USB 2.0 / 3.5 " / 7200 rpm
  • 11.05.2006: Seagate 250GB USB 2.0 / 3.5" / 7200 RPM

Note:* 24.04.2006 I have a WesternDigital? Essential - 250 GB USB 2.0 / 3.5" / 7200 rpm and although it supports spindown by hardware and does so on my laptop, it wont do so on my slug. Even if completly umounted. + Openslug does not find this disk. EDIT: I now have spindown on this disk. Strangly it works with debian. I mounted my /var and /tmp on a usb-stick.

  • I do also have a Western Digital MyBook? Essential 500GB I bought with my NSLU2 in Nov 2006. And it does not spin down on the NSLU2. I also reverted to the original Linksys firmware but it still does not spin down. There is also another strange problem - from time to time the NSLU2 just does not boot up - only the ethernet light is on and the slug freezes - I have to unplug the power connector. Then it boots up normaly again - very strange. - Anguel Stankov

3. Method: How to use scsi-idle for spinning down USB disks.

Robert Demski provided a kernel patch as well as a package for the scsi-idle software to be used on the slug.

The build process is quite complicated as it requires setting up a cross-compile environment for the slug currently, until the kernel patch is included in the binary distributions of OpenSlug. The process is described in a blog post on fredericiana.com. Any comments appreciated.

How to use scsi-idle without kernel patch

By Ruud Senden

I've managed to automate spindown using scsi-idle without the kernel patch. I've created the perl script listed below based on a script I found at http://www.rootfs.net/jaws/index.php?gadget=Blog&action=SingleView&id=22:

#!/usr/bin/perl -w

$statfile = "/proc/diskstats";
die "$0: Cannot read $statfile\n" unless -r $statfile;

$| = 1;
($disk, $interval) = (@ARGV);
$disk =~ s,/dev/,,;
print "$0: disk: $disk, interval: $interval\n";

$halted_data = $last_seen = '';
while (1) {
  open(STATUS, $statfile);
  ($_) = grep(/^\s+\d+\s+\d+\s+$disk\s/o, <STATUS>);
  close STATUS;

  if ($last_seen eq $_ && $halted_data ne $_) {
    print "Spinning down: $disk\n";
    system "scsi-stop", "/dev/$disk";
    $halted_data = $_;
  }
  $last_seen = $_;
  sleep $interval;
}

Basically what this script does is take a device as the first argument, and an interval in seconds as the second argument. Every interval seconds it will look at /proc/diskstats for the given device, and if the status didn't change the disk will be spun down. The disk will automatically spin up again when accessed (on my system at least).

Installation instructions:

  1. Install perl
  2. Install the scsi-idle package, which can be downloaded from the Yahoo Files section
  3. Save the perl script listed above to your filesystem, for example named autospindown. Make sure the script is executable: chmod +rx autospindown
  4. Edit /etc/default/scsi-idle to list the timeouts for your drive(s), see the instructions in that file for more information.
  5. Edit /etc/init.d/scsi-idle, changing the DAEMON variable to point to the perl script you saved in step 3.
  6. /etc/init.d/scsi-idle start

I've tested this on my NSLU2 with OpenSlug 2.7 installed, I think a similar approach should work on Unslung as well. Any comments appreciated.

Note - the file "/proc/diskstats" does not exist on Unslung 5.5, so this technique won't work directly on Unslung boxes.

  • note 11th Sept 2006

Installing scsi-idle_2.4.23-r1_armeb.ipk onto unslung 6.8 fails as : ERROR: Cannot satisfy the following dependencies for scsi-idle:

         libgcc1 (>= 3.4.4) libc6 (>= 2.3.5+cvs20050627) **

Shell-only scsi-idle without kernel patch

By Chris

Using Ruud's idea, except implemented as a shell script so you don't need Perl (which is great, but takes a lot of space if you're running from flash only). This seems to work fine with the vanilla OpenSlug firmware, a ByteCC 2.5" external enclosure, and a Seagate 40GB 2.5" drive.

This version updates the status more often than the Perl version which prevents waiting almost a complete extra interval cycle under certain circumstances. Feel free to hack this script and make it better as I didn't spend much time on it.

Stripwax adds: The scsi-idle package and the perl script above follow the convention that the drive to idle is e.g. "dev/sda" whereas the below seems to want to expect just e.g. "sda". In my opinion you will need to change the line "disk=$1" below to something like "disk=${1#/dev/}" or similar

#!/bin/sh

disk=$1
interval=$2

state=`grep "\s$disk\s" /proc/diskstats`
count=$interval
up=1

while [ true ]; do
   sleep 10
   count=$(($count-10))
   newstate=`grep "\s$disk\s" /proc/diskstats`
   if [ "$state" = "$newstate" ]; then
      if [ $count -lt 0 ]; then
         count=$interval
         if [ $up = 1 ]; then
            #echo -e "spin-down\t" `date`
            sync
            state=`grep "\s$disk\s" /proc/diskstats`
            scsi-stop /dev/$disk
            up=0
         fi
      fi
   else
      #echo -e "drive is up\t" `date`
      count=$interval
      state="$newstate"
      up=1
   fi
done

4.Method: Use sg_start to spindown usb disk

for OpenDebianSlug? 3.10 2.16 kernel:

  install sg3 scsi tools: apt-get install sg3-utils
  powerdown hdd: /usr/bin/sg_start 0 -pc=3 /dev/sda
  use shell or perl script for automatic powerdown

System modifications for HD spin-down OR

How to make your standalone USB disk really spindown

[by JNC]

OK, you could tell me : what is this update? I have read much in the MaxtorOneTouch-Howto about the procedure to move /dev and /var back to RAM, so, why another section ?

That's definitively true. Many thanks to those who contributed to write those pages. I just found 2 problems with what I read :

  • it was for Unslung version only (not Openslug) [Unslung version]
  • the process was incomplete (only for /var) and impossible to extend to /dev

As I don't like to complain without acting, here is my contribution from my experience. I hope it can be useful to anybody.

Preamble

The problem

Once everything is running fine, my disk (Maxtor One Touch) does not spin down, as the NSLU2 regularly accesses files from /dev and /var.

The solution

One solution is to move back /dev and /var to RAM.

Debianslug: The script works with debianslug so long as you uncomment the highlighted line (devpts needs to be remounted otherwise on login ssh can not start a shell giving a 'Server refused to allocate pty' error). The script only copies /dev and /var/log but you would do well to tweak /etc/syslog.conf and /etc/logrotate* to be as economical as possible.

The challenge

Creating a RAM resource, and attach /dev and /ram is easy (mount -t ramfs ramfs ... command). But, as the RAM memory is volatile, the challenge is to create a script that will copy all files from /dev and /var into the RAM resources you created, each time you boot the NSLU2. We must deal with two issues :

  • where is the correct location for my script?
  • what is the command to use to copy the unregular files from /dev ?

The procedure

  • cd /etc/init.d

(all init script should be located in this directory, regardless the run levels they are involved in. There should be a link to this script in the run-level-dedicated directory.)

  • Create the following mount_var_dev.sh script :
#!/bin/sh
# /etc/init.d/mount_var_dev.sh
# Script section to create ramdisk for /var and for /dev

# disable the oom-killer to use the full swap
/sbin/sysctl -w vm.overcommit_memory=1

# better only use /var/log then the full /var
/bin/echo "Creating ramfs for /var/log:"
/bin/mount -t ramfs ramfs /mnt -o maxsize=256
/bin/cp -rp /var/log/* /mnt/
/bin/mount -o bind /var/log /var/log.state
/bin/mount -o bind /mnt /var/log
/bin/umount /mnt

/bin/echo "Creating ramfs for /dev:"
/bin/mount -t ramfs ramfs /mnt -o maxsize=256
cd /dev
find . -print0 -mount | cpio -p -0 -d -m -u /mnt
# you can not use cp command for /dev
/bin/mount -o bind /dev /dev.state
/bin/mount -o bind /mnt /dev
/bin/umount /mnt

# Uncomment the following line when using debianslug
#mount devpts /dev/pts -t devpts

# Return and continue execution of system rc.
return 1
# [EOF]
  • chmod 0755 mount_var_dev.sh
  • cd /etc/rcS.d

(this directory contains all scripts for a generic 'Start' run-level, that is run before running level 3)

  • ln -s /etc/init.d/mount_var_dev.sh S37mount_var_dev.sh

(try to do that after activating swap!)

  • chmod 0755 S37mount_var_dev.sh

(all init scripts are supposed to be in /etc/init.d, and linked to the appropriate directory for the appropriate run-level).

  • edit /etc/syslog.conf and remove the /dev/xconsole entry (only used for X11 logging)
  • cd /etc
  • vi fstab

for all partition from the disk that must spin down, add ,noatime to the 4th column (there should be only default). (this will prevent to wake up the disk for cached read access, just to update the 'last access time' flag of the file)

Before

/dev/sda1       /       ext2    defaults        1  1
/dev/sda2       /home   ext2    defaults        1  2

After

/dev/sda1       /       ext2    defaults,noatime        1  1
/dev/sda2       /home   ext2    defaults,noatime        1  2
  • shutdown -r 0

(reboot)

It is done, you can check using the mount command that /dev and /var are now in RAM. Your disk will spindown with the timer you specified.

NOTE: This works fine on my Unslung6.8 slug (with the script in /opt/etc/init.d). Mount now returns:

[..]
/dev/sda1 on /share/flash/data type ext3 (rw,noatime)
/dev/sda2 on /share/flash/conf type ext3 (rw,sync,noatime)
/dev/sdb1 on /share/hdd/data/HDD_1_1_1 type ufsd (rw)
ramfs on /var/log type ramfs (rw)
ramfs on /dev type ramfs (rw)

Why can't I use sdparm to do spindown-magic?

I corresponded with the developer of sdparm (the SCSI version of hdparm) about using this tool to either set spin-down timers or stop/start disks, here's his explanation for why this can't be done currently.


However the major weakness is in the SCSI<->ATA protocol conversion code/silicon inside the external enclosure housing the IDE disk. If it is like the ones I have tested, it supports READ(10)/WRITE(10)/INQUIRY/ READ_CAPACITY SCSI commands only. The MODE_SENSE commands are dummied up by the USB mass storage driver (within linux kernel) so as to not upset the sd (scsi disk) driver.

Spinning down (or up) a disk requires the SCSI START_STOP_UNIT command to be supported. Even SCSI to ATA Translation (SAT) layer that linux does control (e.g. libata for SATA disks) has only recently added that command (a year after libata was released in the kernel). Convincing people that such commands are worthwhile is not an easy task!

So I encourage your persitence but fear the exercise will be futile. Hopefully in a year or so better SAT layers will surface.

an example of a working sdparm (NOT nslu2 btw) With a 2.6.11 Kernel (have not tried others) on a x86 (Via C3) it's possible to spin down a Samsung SV1640N? in an ICY Box "blue" using "sdparm-0.95"

 # sdparm --command=stop /dev/sdb
 /dev/sdb: SAMSUNG   SP1604N           TM10

And turn it on:

 # sdparm --command=start /dev/sdb
 /dev/sdb: SAMSUNG   SP1604N           TM10

hdparm or any disk acces can start it:

 # hdparm -t /dev/sdb
 /dev/sdb:
  Timing buffered disk reads:    2 MB in  5.76 seconds = 355.73 kB/sec

 # hdparm -t /dev/sdb
 /dev/sdb:
  Timing buffered disk reads:   72 MB in  3.06 seconds =  23.56 MB/sec

Wasn't actually tried on NSLU2 (other kernel, no enivronment etc.). But maybe it will work there too? At least with that case that disk and that USB driver it seems to be possible to spin down an USB Drive!

[Zhyla] This didn't work on my "Genesys" USB adapter on my FC3 box (2.6.9 kernel, sdparm-0.95 and 0.96beta).

Can you try running --command=stop and then --command=ready? It should indicate that it isn't ready (i.e. it's spun down).

[rz] Nice idea, but sorry: --command=ready always shows "ready" regardless if the disk is really spun down/sleeping or not.


[rz] Have tried several cases with Linux version 2.6.11 with a Samsung SP1604?(169GB) and an old Maxtor 53073U6(8GB)

[rz]Supporting(!) "stop" (45 Euro Raid Sonic ICY Box 3.5 Combo (USB+FW)):

 P:  Vendor=067b ProdID?=3507 Rev= 0.01
 S:  Product=ATAPI-6 Bridge Controller
 S:  Manufacturer=Prolific Technology Inc.
 Chip: not visible, assuming(!) Profilic PL3507?

[mag] Another enclosure supporting stop is PPA ME-780U2-2162, which also uses a Prolific chipset.

[rz]Not supporting "stop" (15 Euro Evertech):

 P:  Vendor=04b4 ProdID?=6830 Rev= 2.40
 S:  Product=Cypress AT2LP?
 Chip: CY7C68300B?-56PVXC

[rz]Not supporting "stop" (60 Euro Delock? Combo)

 P:  Vendor=0402 ProdID?=5621 Rev= 1.03
 S:  Product=USB 2.0 Storage Device
 Chip: ALI M5621 + Oxford FW

[rz]Not supporting "stop" via USB but "inside" (55Euro atechweb LAN Server HD9?-U2lA?)

 P:  Vendor=05e3 ProdID?=0702 Rev= 0.33
 S:  Product=USB TO IDE
 Chip: GL811E? (FTR: CPU: RDC R2882)

[rz]As the prolific chip set used by radsonic do spin down the disk (really) that can't be a problem with linux, at least not with linux 2.6.11.


[rz]What chip set is used in which Raidsonic case:

IB-550UE Prolific (PL3507?) - Agere (FW8028?) since 02/2005
IB-350/351/360UE Prolific (PL3507?) - Agere (FW8028?)
IB-350/351US Prolific (PL2507?) - Silicon Image (Sil36CT80?)
IB-350/351/360U Cypress (7C68300A)
IB-250/251U Cypress (7C68300A)
IB-355U Ali (M5621A1?)
IB-525U Ali (M5621A1?)
IB-550U Ali (M5621A1?)
IB-350StS without any

http://www.raidsonic.de/de/pages/service/faq.php (It's only in the german FAQ)


IB-351UE - Agere Chip

      Seagate ST3?? 7200.7 (does not accept the KEEP_OVER_RESET-flag: hdparm -K ...)
      sdparm 0.94
      Kernel 2.6.13 (on desktop, not slug) spins down with sdparm --command=stop /dev/sda
      Seagate has a tool called SeaTool?? (like IBM/Hitachi's Featuretool), but it does not
      have any features to set powermanagement or spin down timers.

Why does my disk not spin down?

Why does it spin up after only five minutes?

Which process is accessing the disk?

To answer this sort of question, see HowtoIdentifyWhichProcessesAccessDisk

to:

http://myblog.es/allfreeringtones <a href="http://myblog.es/allfreeringtones">free ringtones</a> free ringtones

December 15, 2006, at 10:53 AM by marcusb -- revert spam
Changed lines 1-471 from:

http://myblog.es/criscard <a href="http://myblog.es/criscard">christmas cards</a> christmas cards

to:

Contents

Motivation

Not everyone wants a 24/7 running harddisk. A noisy harddisk right beside is awful and the lifespan of a permanently running HD is shorter, too.

Quick Summary

For various technical reasons it is not generally possible to adjust the standby timer of an IDE disk connected through a USB adapter (including turnkey external USB drives). See the sdparm page and the section below on sdparm for the technical reasons.

1. Method: So one method available is to temporarily connect the drive via its IDE connector directly to a big Linux box and run hdparm to set the timer (the -S option is what you're looking for, PLEASE read the hdparm man page before even thinking about running it)[OS independent]. You need an enclosure with separate power and IDE connectors to do this.

Advantage: Can be used on every HD which supports standby regardless of the OS.

Disadvantage: Every time you turn off your HD or there is a power loss you have to repeat the procedure if your drive doesnt support he KEEP_OVER_RESET-flag.

A very similiar method is using a vendor-specific tool (like IBM Feature Tool) to setup the spin-down time before installing the drive into its enclosure.

2. Method: This is a sub-variant of the 1.Method. Simply buy a HD/enlcosure combo which supports down-spinning by itself (e.g. Maxtor OneTouch series, WD Essential Drives)[OS independent]. A simple but probably more expensive method (and i've heard Maxtor OneTouch HDs? are rather noisy, too ;).

3. Method: Another method is to use scsi-idle. However, this requires a kernel patch as the corresponding kernel changes are not yet included in the nslu2-linux binaries. See the scsi-idle section below [applies to Openslug, Unslung].

All methods most often require modifications concerning the syslog- and other daemons because of their behaviour of writing time-marks into their log-files (especially syslog), as this will cause your HD to spin up at certain intervalls.

As of now (June 2006) SDPARM will most certainly NOT WORK on non-combo(FW+USB) drives. Tell us if you found further working drives.

[mag: I own a usb-only enclosure that spins down fine with sdparm. I think it's more of a question of the controller it uses rather than combo vs. non-combo.]

For further details check below.

1. Method: How do I spin down my USB hard disks?

Any drive can have a spindown timeout, provided:

  • The disk can take 'hdparm -S120 /dev/hdx' and spindown after 10 minutes.
  • It is possible to have the drive using the power from the usb-ide adapter while plugged into the normal ide of your pc.

Prerequisites:

- Harddisk with separate IDE and power connectors.

eg. IcyBox? black [http://www.raidsonic.de/de/pages/products/external_cases.php?we_objectID=3206] [ST: this works fine for me].

- Another Linux machine to connect it to with hdparm installed.

1) Take your HD and install it the enclosure (especially the power connector to the drive).

2) Turn on your enclosure.

2) Disconnect the enclosure's IDE connector (if connected) and connect the other Linux machine's IDE connector to the HD.

3) Set the spindown-time 'hdparm -k1 -K1 -S120 /dev/hda' where -Sxx specifies the spindown-time. -k1-K1 set the keep over reset-flags if supported.

4) Disconnect the Linux machine's IDE connector

5) Connect the enclosures IDE connector to the HD !WITHOUT REMOVING THE POWER from the HD!

This way the drive is never reset, and will keep its spindown setting. Of course if hdparm -k1 -K1 -S120 actually makes your drives remember their settings this is irrelevant, but for anyone like me whose drives wont remember their settings this is a way to make them spindown.

For those with enclosures that wont let them do this, I use this. The usb-ide and power supply are completely separate, which make this easy.

[ST: Bought an enclosure with internal SATA interface and external SATA/USB interface IcyBox IB-360StUS-B and installed a Samsung 250GB SATA II (SP2504C?) into it. Connected it via SATA (MB to external slot-connector is included) to my big machine and ran hdparm. Voila, the disk spins down.]

Sub-method: You can download the Power Booster utility for 2.5" IBM/Hitachi TravelStar disks. The Power Booster utility will enable the auto spin down feature of the disk. For 3.5" IBM/Hitachi drives (and maybe others), you can download the Feature Tool. Otherwise temporarily install the IDE disk in your ordinary Linux box, read the disk technical documentation and use hdparm to adjust the settings by hand. The trick is to enable APM within the drive itself, so Linux doesn't have to care about it at all. You can't use hdparm to alter the APM settings from the NSLU2 as the USB->IDE adapters are emulated as SCSI host adapters in the Linux kernel which is incompatible with the necessary hdparm options.

[Request by ingeba]: To my knowledge this does not work. Can anyone verify that APM settings may cause NSLU2 connected drives in arbitrary enclosures to spin down? If so, please list drive and enclosure brand and here:

[slavikb] This worked for me (Hitachi 7K250, noname box, Feature Tool). I had to remount root with -noatime option. The drive goes into Low RPM mode after 10 minutes of inactivity.

Either way, you'll have to open your 2.5" USB enclosure and install the disk drive temporarily to a desktop computer using a 2.5" to 3.5" IDE adapter. After that, you can do the APM adjustment in Windows or Linux.

2.Method: Enclosures with integrated spin-down

For Maxtor OneTouch drives see the Maxtor OneTouch HOWTO.

I just bought a Seagate Baracuda 3.5" drive and installed it in a third party enclosure. Upon contacting their tech support in Europe they stated that:

  • Seagate does not support other power management than managed by the running OS
  • Seagate does not support drives to be installed in third party enclosures
  • Seagate disks do not have a function to retain the power management settings

So I guess my advice would be not to buy the Seagate disks.

By Miro Dietiker As i see, some disks of higher price (and quality?) power down out-of-the-box with a meaningful value configured. If you have a USB disk which does this, extend this list please.

  • 13.03.2006: WesternDigital? Essential - 320 GB USB 2.0 / 3.5" / 7200 rpm (All WD Essential drives seem to implement this feature)
  • 24.03.2003 Maxtor One Touch - 200 Go USB 2.0 / 3.5 " / 7200 rpm
  • 11.05.2006: Seagate 250GB USB 2.0 / 3.5" / 7200 RPM

Note:* 24.04.2006 I have a WesternDigital? Essential - 250 GB USB 2.0 / 3.5" / 7200 rpm and although it supports spindown by hardware and does so on my laptop, it wont do so on my slug. Even if completly umounted. + Openslug does not find this disk. EDIT: I now have spindown on this disk. Strangly it works with debian. I mounted my /var and /tmp on a usb-stick.

  • I do also have a Western Digital MyBook? Essential 500GB I bought with my NSLU2 in Nov 2006. And it does not spin down on the NSLU2. I also reverted to the original Linksys firmware but it still does not spin down. There is also another strange problem - from time to time the NSLU2 just does not boot up - only the ethernet light is on and the slug freezes - I have to unplug the power connector. Then it boots up normaly again - very strange. - Anguel Stankov

3. Method: How to use scsi-idle for spinning down USB disks.

Robert Demski provided a kernel patch as well as a package for the scsi-idle software to be used on the slug.

The build process is quite complicated as it requires setting up a cross-compile environment for the slug currently, until the kernel patch is included in the binary distributions of OpenSlug. The process is described in a blog post on fredericiana.com. Any comments appreciated.

How to use scsi-idle without kernel patch

By Ruud Senden

I've managed to automate spindown using scsi-idle without the kernel patch. I've created the perl script listed below based on a script I found at http://www.rootfs.net/jaws/index.php?gadget=Blog&action=SingleView&id=22:

#!/usr/bin/perl -w

$statfile = "/proc/diskstats";
die "$0: Cannot read $statfile\n" unless -r $statfile;

$| = 1;
($disk, $interval) = (@ARGV);
$disk =~ s,/dev/,,;
print "$0: disk: $disk, interval: $interval\n";

$halted_data = $last_seen = '';
while (1) {
  open(STATUS, $statfile);
  ($_) = grep(/^\s+\d+\s+\d+\s+$disk\s/o, <STATUS>);
  close STATUS;

  if ($last_seen eq $_ && $halted_data ne $_) {
    print "Spinning down: $disk\n";
    system "scsi-stop", "/dev/$disk";
    $halted_data = $_;
  }
  $last_seen = $_;
  sleep $interval;
}

Basically what this script does is take a device as the first argument, and an interval in seconds as the second argument. Every interval seconds it will look at /proc/diskstats for the given device, and if the status didn't change the disk will be spun down. The disk will automatically spin up again when accessed (on my system at least).

Installation instructions:

  1. Install perl
  2. Install the scsi-idle package, which can be downloaded from the Yahoo Files section
  3. Save the perl script listed above to your filesystem, for example named autospindown. Make sure the script is executable: chmod +rx autospindown
  4. Edit /etc/default/scsi-idle to list the timeouts for your drive(s), see the instructions in that file for more information.
  5. Edit /etc/init.d/scsi-idle, changing the DAEMON variable to point to the perl script you saved in step 3.
  6. /etc/init.d/scsi-idle start

I've tested this on my NSLU2 with OpenSlug 2.7 installed, I think a similar approach should work on Unslung as well. Any comments appreciated.

Note - the file "/proc/diskstats" does not exist on Unslung 5.5, so this technique won't work directly on Unslung boxes.

  • note 11th Sept 2006

Installing scsi-idle_2.4.23-r1_armeb.ipk onto unslung 6.8 fails as : ERROR: Cannot satisfy the following dependencies for scsi-idle:

         libgcc1 (>= 3.4.4) libc6 (>= 2.3.5+cvs20050627) **

Shell-only scsi-idle without kernel patch

By Chris

Using Ruud's idea, except implemented as a shell script so you don't need Perl (which is great, but takes a lot of space if you're running from flash only). This seems to work fine with the vanilla OpenSlug firmware, a ByteCC 2.5" external enclosure, and a Seagate 40GB 2.5" drive.

This version updates the status more often than the Perl version which prevents waiting almost a complete extra interval cycle under certain circumstances. Feel free to hack this script and make it better as I didn't spend much time on it.

Stripwax adds: The scsi-idle package and the perl script above follow the convention that the drive to idle is e.g. "dev/sda" whereas the below seems to want to expect just e.g. "sda". In my opinion you will need to change the line "disk=$1" below to something like "disk=${1#/dev/}" or similar

#!/bin/sh

disk=$1
interval=$2

state=`grep "\s$disk\s" /proc/diskstats`
count=$interval
up=1

while [ true ]; do
   sleep 10
   count=$(($count-10))
   newstate=`grep "\s$disk\s" /proc/diskstats`
   if [ "$state" = "$newstate" ]; then
      if [ $count -lt 0 ]; then
         count=$interval
         if [ $up = 1 ]; then
            #echo -e "spin-down\t" `date`
            sync
            state=`grep "\s$disk\s" /proc/diskstats`
            scsi-stop /dev/$disk
            up=0
         fi
      fi
   else
      #echo -e "drive is up\t" `date`
      count=$interval
      state="$newstate"
      up=1
   fi
done

4.Method: Use sg_start to spindown usb disk

for OpenDebianSlug? 3.10 2.16 kernel:

  install sg3 scsi tools: apt-get install sg3-utils
  powerdown hdd: /usr/bin/sg_start 0 -pc=3 /dev/sda
  use shell or perl script for automatic powerdown

System modifications for HD spin-down OR

How to make your standalone USB disk really spindown

[by JNC]

OK, you could tell me : what is this update? I have read much in the MaxtorOneTouch-Howto about the procedure to move /dev and /var back to RAM, so, why another section ?

That's definitively true. Many thanks to those who contributed to write those pages. I just found 2 problems with what I read :

  • it was for Unslung version only (not Openslug) [Unslung version]
  • the process was incomplete (only for /var) and impossible to extend to /dev

As I don't like to complain without acting, here is my contribution from my experience. I hope it can be useful to anybody.

Preamble

The problem

Once everything is running fine, my disk (Maxtor One Touch) does not spin down, as the NSLU2 regularly accesses files from /dev and /var.

The solution

One solution is to move back /dev and /var to RAM.

Debianslug: The script works with debianslug so long as you uncomment the highlighted line (devpts needs to be remounted otherwise on login ssh can not start a shell giving a 'Server refused to allocate pty' error). The script only copies /dev and /var/log but you would do well to tweak /etc/syslog.conf and /etc/logrotate* to be as economical as possible.

The challenge

Creating a RAM resource, and attach /dev and /ram is easy (mount -t ramfs ramfs ... command). But, as the RAM memory is volatile, the challenge is to create a script that will copy all files from /dev and /var into the RAM resources you created, each time you boot the NSLU2. We must deal with two issues :

  • where is the correct location for my script?
  • what is the command to use to copy the unregular files from /dev ?

The procedure

  • cd /etc/init.d

(all init script should be located in this directory, regardless the run levels they are involved in. There should be a link to this script in the run-level-dedicated directory.)

  • Create the following mount_var_dev.sh script :
#!/bin/sh
# /etc/init.d/mount_var_dev.sh
# Script section to create ramdisk for /var and for /dev

# disable the oom-killer to use the full swap
/sbin/sysctl -w vm.overcommit_memory=1

# better only use /var/log then the full /var
/bin/echo "Creating ramfs for /var/log:"
/bin/mount -t ramfs ramfs /mnt -o maxsize=256
/bin/cp -rp /var/log/* /mnt/
/bin/mount -o bind /var/log /var/log.state
/bin/mount -o bind /mnt /var/log
/bin/umount /mnt

/bin/echo "Creating ramfs for /dev:"
/bin/mount -t ramfs ramfs /mnt -o maxsize=256
cd /dev
find . -print0 -mount | cpio -p -0 -d -m -u /mnt
# you can not use cp command for /dev
/bin/mount -o bind /dev /dev.state
/bin/mount -o bind /mnt /dev
/bin/umount /mnt

# Uncomment the following line when using debianslug
#mount devpts /dev/pts -t devpts

# Return and continue execution of system rc.
return 1
# [EOF]
  • chmod 0755 mount_var_dev.sh
  • cd /etc/rcS.d

(this directory contains all scripts for a generic 'Start' run-level, that is run before running level 3)

  • ln -s /etc/init.d/mount_var_dev.sh S37mount_var_dev.sh

(try to do that after activating swap!)

  • chmod 0755 S37mount_var_dev.sh

(all init scripts are supposed to be in /etc/init.d, and linked to the appropriate directory for the appropriate run-level).

  • edit /etc/syslog.conf and remove the /dev/xconsole entry (only used for X11 logging)
  • cd /etc
  • vi fstab

for all partition from the disk that must spin down, add ,noatime to the 4th column (there should be only default). (this will prevent to wake up the disk for cached read access, just to update the 'last access time' flag of the file)

Before

/dev/sda1       /       ext2    defaults        1  1
/dev/sda2       /home   ext2    defaults        1  2

After

/dev/sda1       /       ext2    defaults,noatime        1  1
/dev/sda2       /home   ext2    defaults,noatime        1  2
  • shutdown -r 0

(reboot)

It is done, you can check using the mount command that /dev and /var are now in RAM. Your disk will spindown with the timer you specified.

NOTE: This works fine on my Unslung6.8 slug (with the script in /opt/etc/init.d). Mount now returns:

[..]
/dev/sda1 on /share/flash/data type ext3 (rw,noatime)
/dev/sda2 on /share/flash/conf type ext3 (rw,sync,noatime)
/dev/sdb1 on /share/hdd/data/HDD_1_1_1 type ufsd (rw)
ramfs on /var/log type ramfs (rw)
ramfs on /dev type ramfs (rw)

Why can't I use sdparm to do spindown-magic?

I corresponded with the developer of sdparm (the SCSI version of hdparm) about using this tool to either set spin-down timers or stop/start disks, here's his explanation for why this can't be done currently.


However the major weakness is in the SCSI<->ATA protocol conversion code/silicon inside the external enclosure housing the IDE disk. If it is like the ones I have tested, it supports READ(10)/WRITE(10)/INQUIRY/ READ_CAPACITY SCSI commands only. The MODE_SENSE commands are dummied up by the USB mass storage driver (within linux kernel) so as to not upset the sd (scsi disk) driver.

Spinning down (or up) a disk requires the SCSI START_STOP_UNIT command to be supported. Even SCSI to ATA Translation (SAT) layer that linux does control (e.g. libata for SATA disks) has only recently added that command (a year after libata was released in the kernel). Convincing people that such commands are worthwhile is not an easy task!

So I encourage your persitence but fear the exercise will be futile. Hopefully in a year or so better SAT layers will surface.

an example of a working sdparm (NOT nslu2 btw) With a 2.6.11 Kernel (have not tried others) on a x86 (Via C3) it's possible to spin down a Samsung SV1640N? in an ICY Box "blue" using "sdparm-0.95"

 # sdparm --command=stop /dev/sdb
 /dev/sdb: SAMSUNG   SP1604N           TM10

And turn it on:

 # sdparm --command=start /dev/sdb
 /dev/sdb: SAMSUNG   SP1604N           TM10

hdparm or any disk acces can start it:

 # hdparm -t /dev/sdb
 /dev/sdb:
  Timing buffered disk reads:    2 MB in  5.76 seconds = 355.73 kB/sec

 # hdparm -t /dev/sdb
 /dev/sdb:
  Timing buffered disk reads:   72 MB in  3.06 seconds =  23.56 MB/sec

Wasn't actually tried on NSLU2 (other kernel, no enivronment etc.). But maybe it will work there too? At least with that case that disk and that USB driver it seems to be possible to spin down an USB Drive!

[Zhyla] This didn't work on my "Genesys" USB adapter on my FC3 box (2.6.9 kernel, sdparm-0.95 and 0.96beta).

Can you try running --command=stop and then --command=ready? It should indicate that it isn't ready (i.e. it's spun down).

[rz] Nice idea, but sorry: --command=ready always shows "ready" regardless if the disk is really spun down/sleeping or not.


[rz] Have tried several cases with Linux version 2.6.11 with a Samsung SP1604?(169GB) and an old Maxtor 53073U6(8GB)

[rz]Supporting(!) "stop" (45 Euro Raid Sonic ICY Box 3.5 Combo (USB+FW)):

 P:  Vendor=067b ProdID?=3507 Rev= 0.01
 S:  Product=ATAPI-6 Bridge Controller
 S:  Manufacturer=Prolific Technology Inc.
 Chip: not visible, assuming(!) Profilic PL3507?

[mag] Another enclosure supporting stop is PPA ME-780U2-2162, which also uses a Prolific chipset.

[rz]Not supporting "stop" (15 Euro Evertech):

 P:  Vendor=04b4 ProdID?=6830 Rev= 2.40
 S:  Product=Cypress AT2LP?
 Chip: CY7C68300B?-56PVXC

[rz]Not supporting "stop" (60 Euro Delock? Combo)

 P:  Vendor=0402 ProdID?=5621 Rev= 1.03
 S:  Product=USB 2.0 Storage Device
 Chip: ALI M5621 + Oxford FW

[rz]Not supporting "stop" via USB but "inside" (55Euro atechweb LAN Server HD9?-U2lA?)

 P:  Vendor=05e3 ProdID?=0702 Rev= 0.33
 S:  Product=USB TO IDE
 Chip: GL811E? (FTR: CPU: RDC R2882)

[rz]As the prolific chip set used by radsonic do spin down the disk (really) that can't be a problem with linux, at least not with linux 2.6.11.


[rz]What chip set is used in which Raidsonic case:

IB-550UE Prolific (PL3507?) - Agere (FW8028?) since 02/2005
IB-350/351/360UE Prolific (PL3507?) - Agere (FW8028?)
IB-350/351US Prolific (PL2507?) - Silicon Image (Sil36CT80?)
IB-350/351/360U Cypress (7C68300A)
IB-250/251U Cypress (7C68300A)
IB-355U Ali (M5621A1?)
IB-525U Ali (M5621A1?)
IB-550U Ali (M5621A1?)
IB-350StS without any

http://www.raidsonic.de/de/pages/service/faq.php (It's only in the german FAQ)


IB-351UE - Agere Chip

      Seagate ST3?? 7200.7 (does not accept the KEEP_OVER_RESET-flag: hdparm -K ...)
      sdparm 0.94
      Kernel 2.6.13 (on desktop, not slug) spins down with sdparm --command=stop /dev/sda
      Seagate has a tool called SeaTool?? (like IBM/Hitachi's Featuretool), but it does not
      have any features to set powermanagement or spin down timers.

Why does my disk not spin down?

Why does it spin up after only five minutes?

Which process is accessing the disk?

To answer this sort of question, see HowtoIdentifyWhichProcessesAccessDisk

December 15, 2006, at 01:37 AM by christmas cards --
Changed lines 1-471 from:

Contents

Motivation

Not everyone wants a 24/7 running harddisk. A noisy harddisk right beside is awful and the lifespan of a permanently running HD is shorter, too.

Quick Summary

For various technical reasons it is not generally possible to adjust the standby timer of an IDE disk connected through a USB adapter (including turnkey external USB drives). See the sdparm page and the section below on sdparm for the technical reasons.

1. Method: So one method available is to temporarily connect the drive via its IDE connector directly to a big Linux box and run hdparm to set the timer (the -S option is what you're looking for, PLEASE read the hdparm man page before even thinking about running it)[OS independent]. You need an enclosure with separate power and IDE connectors to do this.

Advantage: Can be used on every HD which supports standby regardless of the OS.

Disadvantage: Every time you turn off your HD or there is a power loss you have to repeat the procedure if your drive doesnt support he KEEP_OVER_RESET-flag.

A very similiar method is using a vendor-specific tool (like IBM Feature Tool) to setup the spin-down time before installing the drive into its enclosure.

2. Method: This is a sub-variant of the 1.Method. Simply buy a HD/enlcosure combo which supports down-spinning by itself (e.g. Maxtor OneTouch series, WD Essential Drives)[OS independent]. A simple but probably more expensive method (and i've heard Maxtor OneTouch HDs? are rather noisy, too ;).

3. Method: Another method is to use scsi-idle. However, this requires a kernel patch as the corresponding kernel changes are not yet included in the nslu2-linux binaries. See the scsi-idle section below [applies to Openslug, Unslung].

All methods most often require modifications concerning the syslog- and other daemons because of their behaviour of writing time-marks into their log-files (especially syslog), as this will cause your HD to spin up at certain intervalls.

As of now (June 2006) SDPARM will most certainly NOT WORK on non-combo(FW+USB) drives. Tell us if you found further working drives.

[mag: I own a usb-only enclosure that spins down fine with sdparm. I think it's more of a question of the controller it uses rather than combo vs. non-combo.]

For further details check below.

1. Method: How do I spin down my USB hard disks?

Any drive can have a spindown timeout, provided:

  • The disk can take 'hdparm -S120 /dev/hdx' and spindown after 10 minutes.
  • It is possible to have the drive using the power from the usb-ide adapter while plugged into the normal ide of your pc.

Prerequisites:

- Harddisk with separate IDE and power connectors.

eg. IcyBox? black [http://www.raidsonic.de/de/pages/products/external_cases.php?we_objectID=3206] [ST: this works fine for me].

- Another Linux machine to connect it to with hdparm installed.

1) Take your HD and install it the enclosure (especially the power connector to the drive).

2) Turn on your enclosure.

2) Disconnect the enclosure's IDE connector (if connected) and connect the other Linux machine's IDE connector to the HD.

3) Set the spindown-time 'hdparm -k1 -K1 -S120 /dev/hda' where -Sxx specifies the spindown-time. -k1-K1 set the keep over reset-flags if supported.

4) Disconnect the Linux machine's IDE connector

5) Connect the enclosures IDE connector to the HD !WITHOUT REMOVING THE POWER from the HD!

This way the drive is never reset, and will keep its spindown setting. Of course if hdparm -k1 -K1 -S120 actually makes your drives remember their settings this is irrelevant, but for anyone like me whose drives wont remember their settings this is a way to make them spindown.

For those with enclosures that wont let them do this, I use this. The usb-ide and power supply are completely separate, which make this easy.

[ST: Bought an enclosure with internal SATA interface and external SATA/USB interface IcyBox IB-360StUS-B and installed a Samsung 250GB SATA II (SP2504C?) into it. Connected it via SATA (MB to external slot-connector is included) to my big machine and ran hdparm. Voila, the disk spins down.]

Sub-method: You can download the Power Booster utility for 2.5" IBM/Hitachi TravelStar disks. The Power Booster utility will enable the auto spin down feature of the disk. For 3.5" IBM/Hitachi drives (and maybe others), you can download the Feature Tool. Otherwise temporarily install the IDE disk in your ordinary Linux box, read the disk technical documentation and use hdparm to adjust the settings by hand. The trick is to enable APM within the drive itself, so Linux doesn't have to care about it at all. You can't use hdparm to alter the APM settings from the NSLU2 as the USB->IDE adapters are emulated as SCSI host adapters in the Linux kernel which is incompatible with the necessary hdparm options.

[Request by ingeba]: To my knowledge this does not work. Can anyone verify that APM settings may cause NSLU2 connected drives in arbitrary enclosures to spin down? If so, please list drive and enclosure brand and here:

[slavikb] This worked for me (Hitachi 7K250, noname box, Feature Tool). I had to remount root with -noatime option. The drive goes into Low RPM mode after 10 minutes of inactivity.

Either way, you'll have to open your 2.5" USB enclosure and install the disk drive temporarily to a desktop computer using a 2.5" to 3.5" IDE adapter. After that, you can do the APM adjustment in Windows or Linux.

2.Method: Enclosures with integrated spin-down

For Maxtor OneTouch drives see the Maxtor OneTouch HOWTO.

I just bought a Seagate Baracuda 3.5" drive and installed it in a third party enclosure. Upon contacting their tech support in Europe they stated that:

  • Seagate does not support other power management than managed by the running OS
  • Seagate does not support drives to be installed in third party enclosures
  • Seagate disks do not have a function to retain the power management settings

So I guess my advice would be not to buy the Seagate disks.

By Miro Dietiker As i see, some disks of higher price (and quality?) power down out-of-the-box with a meaningful value configured. If you have a USB disk which does this, extend this list please.

  • 13.03.2006: WesternDigital? Essential - 320 GB USB 2.0 / 3.5" / 7200 rpm (All WD Essential drives seem to implement this feature)
  • 24.03.2003 Maxtor One Touch - 200 Go USB 2.0 / 3.5 " / 7200 rpm
  • 11.05.2006: Seagate 250GB USB 2.0 / 3.5" / 7200 RPM

Note:* 24.04.2006 I have a WesternDigital? Essential - 250 GB USB 2.0 / 3.5" / 7200 rpm and although it supports spindown by hardware and does so on my laptop, it wont do so on my slug. Even if completly umounted. + Openslug does not find this disk. EDIT: I now have spindown on this disk. Strangly it works with debian. I mounted my /var and /tmp on a usb-stick.

  • I do also have a Western Digital MyBook? Essential 500GB I bought with my NSLU2 in Nov 2006. And it does not spin down on the NSLU2. I also reverted to the original Linksys firmware but it still does not spin down. There is also another strange problem - from time to time the NSLU2 just does not boot up - only the ethernet light is on and the slug freezes - I have to unplug the power connector. Then it boots up normaly again - very strange. - Anguel Stankov

3. Method: How to use scsi-idle for spinning down USB disks.

Robert Demski provided a kernel patch as well as a package for the scsi-idle software to be used on the slug.

The build process is quite complicated as it requires setting up a cross-compile environment for the slug currently, until the kernel patch is included in the binary distributions of OpenSlug. The process is described in a blog post on fredericiana.com. Any comments appreciated.

How to use scsi-idle without kernel patch

By Ruud Senden

I've managed to automate spindown using scsi-idle without the kernel patch. I've created the perl script listed below based on a script I found at http://www.rootfs.net/jaws/index.php?gadget=Blog&action=SingleView&id=22:

#!/usr/bin/perl -w

$statfile = "/proc/diskstats";
die "$0: Cannot read $statfile\n" unless -r $statfile;

$| = 1;
($disk, $interval) = (@ARGV);
$disk =~ s,/dev/,,;
print "$0: disk: $disk, interval: $interval\n";

$halted_data = $last_seen = '';
while (1) {
  open(STATUS, $statfile);
  ($_) = grep(/^\s+\d+\s+\d+\s+$disk\s/o, <STATUS>);
  close STATUS;

  if ($last_seen eq $_ && $halted_data ne $_) {
    print "Spinning down: $disk\n";
    system "scsi-stop", "/dev/$disk";
    $halted_data = $_;
  }
  $last_seen = $_;
  sleep $interval;
}

Basically what this script does is take a device as the first argument, and an interval in seconds as the second argument. Every interval seconds it will look at /proc/diskstats for the given device, and if the status didn't change the disk will be spun down. The disk will automatically spin up again when accessed (on my system at least).

Installation instructions:

  1. Install perl
  2. Install the scsi-idle package, which can be downloaded from the Yahoo Files section
  3. Save the perl script listed above to your filesystem, for example named autospindown. Make sure the script is executable: chmod +rx autospindown
  4. Edit /etc/default/scsi-idle to list the timeouts for your drive(s), see the instructions in that file for more information.
  5. Edit /etc/init.d/scsi-idle, changing the DAEMON variable to point to the perl script you saved in step 3.
  6. /etc/init.d/scsi-idle start

I've tested this on my NSLU2 with OpenSlug 2.7 installed, I think a similar approach should work on Unslung as well. Any comments appreciated.

Note - the file "/proc/diskstats" does not exist on Unslung 5.5, so this technique won't work directly on Unslung boxes.

  • note 11th Sept 2006

Installing scsi-idle_2.4.23-r1_armeb.ipk onto unslung 6.8 fails as : ERROR: Cannot satisfy the following dependencies for scsi-idle:

         libgcc1 (>= 3.4.4) libc6 (>= 2.3.5+cvs20050627) **

Shell-only scsi-idle without kernel patch

By Chris

Using Ruud's idea, except implemented as a shell script so you don't need Perl (which is great, but takes a lot of space if you're running from flash only). This seems to work fine with the vanilla OpenSlug firmware, a ByteCC 2.5" external enclosure, and a Seagate 40GB 2.5" drive.

This version updates the status more often than the Perl version which prevents waiting almost a complete extra interval cycle under certain circumstances. Feel free to hack this script and make it better as I didn't spend much time on it.

Stripwax adds: The scsi-idle package and the perl script above follow the convention that the drive to idle is e.g. "dev/sda" whereas the below seems to want to expect just e.g. "sda". In my opinion you will need to change the line "disk=$1" below to something like "disk=${1#/dev/}" or similar

#!/bin/sh

disk=$1
interval=$2

state=`grep "\s$disk\s" /proc/diskstats`
count=$interval
up=1

while [ true ]; do
   sleep 10
   count=$(($count-10))
   newstate=`grep "\s$disk\s" /proc/diskstats`
   if [ "$state" = "$newstate" ]; then
      if [ $count -lt 0 ]; then
         count=$interval
         if [ $up = 1 ]; then
            #echo -e "spin-down\t" `date`
            sync
            state=`grep "\s$disk\s" /proc/diskstats`
            scsi-stop /dev/$disk
            up=0
         fi
      fi
   else
      #echo -e "drive is up\t" `date`
      count=$interval
      state="$newstate"
      up=1
   fi
done

4.Method: Use sg_start to spindown usb disk

for OpenDebianSlug? 3.10 2.16 kernel:

  install sg3 scsi tools: apt-get install sg3-utils
  powerdown hdd: /usr/bin/sg_start 0 -pc=3 /dev/sda
  use shell or perl script for automatic powerdown

System modifications for HD spin-down OR

How to make your standalone USB disk really spindown

[by JNC]

OK, you could tell me : what is this update? I have read much in the MaxtorOneTouch-Howto about the procedure to move /dev and /var back to RAM, so, why another section ?

That's definitively true. Many thanks to those who contributed to write those pages. I just found 2 problems with what I read :

  • it was for Unslung version only (not Openslug) [Unslung version]
  • the process was incomplete (only for /var) and impossible to extend to /dev

As I don't like to complain without acting, here is my contribution from my experience. I hope it can be useful to anybody.

Preamble

The problem

Once everything is running fine, my disk (Maxtor One Touch) does not spin down, as the NSLU2 regularly accesses files from /dev and /var.

The solution

One solution is to move back /dev and /var to RAM.

Debianslug: The script works with debianslug so long as you uncomment the highlighted line (devpts needs to be remounted otherwise on login ssh can not start a shell giving a 'Server refused to allocate pty' error). The script only copies /dev and /var/log but you would do well to tweak /etc/syslog.conf and /etc/logrotate* to be as economical as possible.

The challenge

Creating a RAM resource, and attach /dev and /ram is easy (mount -t ramfs ramfs ... command). But, as the RAM memory is volatile, the challenge is to create a script that will copy all files from /dev and /var into the RAM resources you created, each time you boot the NSLU2. We must deal with two issues :

  • where is the correct location for my script?
  • what is the command to use to copy the unregular files from /dev ?

The procedure

  • cd /etc/init.d

(all init script should be located in this directory, regardless the run levels they are involved in. There should be a link to this script in the run-level-dedicated directory.)

  • Create the following mount_var_dev.sh script :
#!/bin/sh
# /etc/init.d/mount_var_dev.sh
# Script section to create ramdisk for /var and for /dev

# disable the oom-killer to use the full swap
/sbin/sysctl -w vm.overcommit_memory=1

# better only use /var/log then the full /var
/bin/echo "Creating ramfs for /var/log:"
/bin/mount -t ramfs ramfs /mnt -o maxsize=256
/bin/cp -rp /var/log/* /mnt/
/bin/mount -o bind /var/log /var/log.state
/bin/mount -o bind /mnt /var/log
/bin/umount /mnt

/bin/echo "Creating ramfs for /dev:"
/bin/mount -t ramfs ramfs /mnt -o maxsize=256
cd /dev
find . -print0 -mount | cpio -p -0 -d -m -u /mnt
# you can not use cp command for /dev
/bin/mount -o bind /dev /dev.state
/bin/mount -o bind /mnt /dev
/bin/umount /mnt

# Uncomment the following line when using debianslug
#mount devpts /dev/pts -t devpts

# Return and continue execution of system rc.
return 1
# [EOF]
  • chmod 0755 mount_var_dev.sh
  • cd /etc/rcS.d

(this directory contains all scripts for a generic 'Start' run-level, that is run before running level 3)

  • ln -s /etc/init.d/mount_var_dev.sh S37mount_var_dev.sh

(try to do that after activating swap!)

  • chmod 0755 S37mount_var_dev.sh

(all init scripts are supposed to be in /etc/init.d, and linked to the appropriate directory for the appropriate run-level).

  • edit /etc/syslog.conf and remove the /dev/xconsole entry (only used for X11 logging)
  • cd /etc
  • vi fstab

for all partition from the disk that must spin down, add ,noatime to the 4th column (there should be only default). (this will prevent to wake up the disk for cached read access, just to update the 'last access time' flag of the file)

Before

/dev/sda1       /       ext2    defaults        1  1
/dev/sda2       /home   ext2    defaults        1  2

After

/dev/sda1       /       ext2    defaults,noatime        1  1
/dev/sda2       /home   ext2    defaults,noatime        1  2
  • shutdown -r 0

(reboot)

It is done, you can check using the mount command that /dev and /var are now in RAM. Your disk will spindown with the timer you specified.

NOTE: This works fine on my Unslung6.8 slug (with the script in /opt/etc/init.d). Mount now returns:

[..]
/dev/sda1 on /share/flash/data type ext3 (rw,noatime)
/dev/sda2 on /share/flash/conf type ext3 (rw,sync,noatime)
/dev/sdb1 on /share/hdd/data/HDD_1_1_1 type ufsd (rw)
ramfs on /var/log type ramfs (rw)
ramfs on /dev type ramfs (rw)

Why can't I use sdparm to do spindown-magic?

I corresponded with the developer of sdparm (the SCSI version of hdparm) about using this tool to either set spin-down timers or stop/start disks, here's his explanation for why this can't be done currently.


However the major weakness is in the SCSI<->ATA protocol conversion code/silicon inside the external enclosure housing the IDE disk. If it is like the ones I have tested, it supports READ(10)/WRITE(10)/INQUIRY/ READ_CAPACITY SCSI commands only. The MODE_SENSE commands are dummied up by the USB mass storage driver (within linux kernel) so as to not upset the sd (scsi disk) driver.

Spinning down (or up) a disk requires the SCSI START_STOP_UNIT command to be supported. Even SCSI to ATA Translation (SAT) layer that linux does control (e.g. libata for SATA disks) has only recently added that command (a year after libata was released in the kernel). Convincing people that such commands are worthwhile is not an easy task!

So I encourage your persitence but fear the exercise will be futile. Hopefully in a year or so better SAT layers will surface.

an example of a working sdparm (NOT nslu2 btw) With a 2.6.11 Kernel (have not tried others) on a x86 (Via C3) it's possible to spin down a Samsung SV1640N? in an ICY Box "blue" using "sdparm-0.95"

 # sdparm --command=stop /dev/sdb
 /dev/sdb: SAMSUNG   SP1604N           TM10

And turn it on:

 # sdparm --command=start /dev/sdb
 /dev/sdb: SAMSUNG   SP1604N           TM10

hdparm or any disk acces can start it:

 # hdparm -t /dev/sdb
 /dev/sdb:
  Timing buffered disk reads:    2 MB in  5.76 seconds = 355.73 kB/sec

 # hdparm -t /dev/sdb
 /dev/sdb:
  Timing buffered disk reads:   72 MB in  3.06 seconds =  23.56 MB/sec

Wasn't actually tried on NSLU2 (other kernel, no enivronment etc.). But maybe it will work there too? At least with that case that disk and that USB driver it seems to be possible to spin down an USB Drive!

[Zhyla] This didn't work on my "Genesys" USB adapter on my FC3 box (2.6.9 kernel, sdparm-0.95 and 0.96beta).

Can you try running --command=stop and then --command=ready? It should indicate that it isn't ready (i.e. it's spun down).

[rz] Nice idea, but sorry: --command=ready always shows "ready" regardless if the disk is really spun down/sleeping or not.


[rz] Have tried several cases with Linux version 2.6.11 with a Samsung SP1604?(169GB) and an old Maxtor 53073U6(8GB)

[rz]Supporting(!) "stop" (45 Euro Raid Sonic ICY Box 3.5 Combo (USB+FW)):

 P:  Vendor=067b ProdID?=3507 Rev= 0.01
 S:  Product=ATAPI-6 Bridge Controller
 S:  Manufacturer=Prolific Technology Inc.
 Chip: not visible, assuming(!) Profilic PL3507?

[mag] Another enclosure supporting stop is PPA ME-780U2-2162, which also uses a Prolific chipset.

[rz]Not supporting "stop" (15 Euro Evertech):

 P:  Vendor=04b4 ProdID?=6830 Rev= 2.40
 S:  Product=Cypress AT2LP?
 Chip: CY7C68300B?-56PVXC

[rz]Not supporting "stop" (60 Euro Delock? Combo)

 P:  Vendor=0402 ProdID?=5621 Rev= 1.03
 S:  Product=USB 2.0 Storage Device
 Chip: ALI M5621 + Oxford FW

[rz]Not supporting "stop" via USB but "inside" (55Euro atechweb LAN Server HD9?-U2lA?)

 P:  Vendor=05e3 ProdID?=0702 Rev= 0.33
 S:  Product=USB TO IDE
 Chip: GL811E? (FTR: CPU: RDC R2882)

[rz]As the prolific chip set used by radsonic do spin down the disk (really) that can't be a problem with linux, at least not with linux 2.6.11.


[rz]What chip set is used in which Raidsonic case:

IB-550UE Prolific (PL3507?) - Agere (FW8028?) since 02/2005
IB-350/351/360UE Prolific (PL3507?) - Agere (FW8028?)
IB-350/351US Prolific (PL2507?) - Silicon Image (Sil36CT80?)
IB-350/351/360U Cypress (7C68300A)
IB-250/251U Cypress (7C68300A)
IB-355U Ali (M5621A1?)
IB-525U Ali (M5621A1?)
IB-550U Ali (M5621A1?)
IB-350StS without any

http://www.raidsonic.de/de/pages/service/faq.php (It's only in the german FAQ)


IB-351UE - Agere Chip

      Seagate ST3?? 7200.7 (does not accept the KEEP_OVER_RESET-flag: hdparm -K ...)
      sdparm 0.94
      Kernel 2.6.13 (on desktop, not slug) spins down with sdparm --command=stop /dev/sda
      Seagate has a tool called SeaTool?? (like IBM/Hitachi's Featuretool), but it does not
      have any features to set powermanagement or spin down timers.

Why does my disk not spin down?

Why does it spin up after only five minutes?

Which process is accessing the disk?

To answer this sort of question, see HowtoIdentifyWhichProcessesAccessDisk

to:

http://myblog.es/criscard <a href="http://myblog.es/criscard">christmas cards</a> christmas cards

December 14, 2006, at 09:25 PM by fcarolo --
Changed lines 1-471 from:

http://myblog.es/bthvan <a href="http://myblog.es/bthvan">bathroom vanities</a> bathroom vanities

to:

Contents

Motivation

Not everyone wants a 24/7 running harddisk. A noisy harddisk right beside is awful and the lifespan of a permanently running HD is shorter, too.

Quick Summary

For various technical reasons it is not generally possible to adjust the standby timer of an IDE disk connected through a USB adapter (including turnkey external USB drives). See the sdparm page and the section below on sdparm for the technical reasons.

1. Method: So one method available is to temporarily connect the drive via its IDE connector directly to a big Linux box and run hdparm to set the timer (the -S option is what you're looking for, PLEASE read the hdparm man page before even thinking about running it)[OS independent]. You need an enclosure with separate power and IDE connectors to do this.

Advantage: Can be used on every HD which supports standby regardless of the OS.

Disadvantage: Every time you turn off your HD or there is a power loss you have to repeat the procedure if your drive doesnt support he KEEP_OVER_RESET-flag.

A very similiar method is using a vendor-specific tool (like IBM Feature Tool) to setup the spin-down time before installing the drive into its enclosure.

2. Method: This is a sub-variant of the 1.Method. Simply buy a HD/enlcosure combo which supports down-spinning by itself (e.g. Maxtor OneTouch series, WD Essential Drives)[OS independent]. A simple but probably more expensive method (and i've heard Maxtor OneTouch HDs? are rather noisy, too ;).

3. Method: Another method is to use scsi-idle. However, this requires a kernel patch as the corresponding kernel changes are not yet included in the nslu2-linux binaries. See the scsi-idle section below [applies to Openslug, Unslung].

All methods most often require modifications concerning the syslog- and other daemons because of their behaviour of writing time-marks into their log-files (especially syslog), as this will cause your HD to spin up at certain intervalls.

As of now (June 2006) SDPARM will most certainly NOT WORK on non-combo(FW+USB) drives. Tell us if you found further working drives.

[mag: I own a usb-only enclosure that spins down fine with sdparm. I think it's more of a question of the controller it uses rather than combo vs. non-combo.]

For further details check below.

1. Method: How do I spin down my USB hard disks?

Any drive can have a spindown timeout, provided:

  • The disk can take 'hdparm -S120 /dev/hdx' and spindown after 10 minutes.
  • It is possible to have the drive using the power from the usb-ide adapter while plugged into the normal ide of your pc.

Prerequisites:

- Harddisk with separate IDE and power connectors.

eg. IcyBox? black [http://www.raidsonic.de/de/pages/products/external_cases.php?we_objectID=3206] [ST: this works fine for me].

- Another Linux machine to connect it to with hdparm installed.

1) Take your HD and install it the enclosure (especially the power connector to the drive).

2) Turn on your enclosure.

2) Disconnect the enclosure's IDE connector (if connected) and connect the other Linux machine's IDE connector to the HD.

3) Set the spindown-time 'hdparm -k1 -K1 -S120 /dev/hda' where -Sxx specifies the spindown-time. -k1-K1 set the keep over reset-flags if supported.

4) Disconnect the Linux machine's IDE connector

5) Connect the enclosures IDE connector to the HD !WITHOUT REMOVING THE POWER from the HD!

This way the drive is never reset, and will keep its spindown setting. Of course if hdparm -k1 -K1 -S120 actually makes your drives remember their settings this is irrelevant, but for anyone like me whose drives wont remember their settings this is a way to make them spindown.

For those with enclosures that wont let them do this, I use this. The usb-ide and power supply are completely separate, which make this easy.

[ST: Bought an enclosure with internal SATA interface and external SATA/USB interface IcyBox IB-360StUS-B and installed a Samsung 250GB SATA II (SP2504C?) into it. Connected it via SATA (MB to external slot-connector is included) to my big machine and ran hdparm. Voila, the disk spins down.]

Sub-method: You can download the Power Booster utility for 2.5" IBM/Hitachi TravelStar disks. The Power Booster utility will enable the auto spin down feature of the disk. For 3.5" IBM/Hitachi drives (and maybe others), you can download the Feature Tool. Otherwise temporarily install the IDE disk in your ordinary Linux box, read the disk technical documentation and use hdparm to adjust the settings by hand. The trick is to enable APM within the drive itself, so Linux doesn't have to care about it at all. You can't use hdparm to alter the APM settings from the NSLU2 as the USB->IDE adapters are emulated as SCSI host adapters in the Linux kernel which is incompatible with the necessary hdparm options.

[Request by ingeba]: To my knowledge this does not work. Can anyone verify that APM settings may cause NSLU2 connected drives in arbitrary enclosures to spin down? If so, please list drive and enclosure brand and here:

[slavikb] This worked for me (Hitachi 7K250, noname box, Feature Tool). I had to remount root with -noatime option. The drive goes into Low RPM mode after 10 minutes of inactivity.

Either way, you'll have to open your 2.5" USB enclosure and install the disk drive temporarily to a desktop computer using a 2.5" to 3.5" IDE adapter. After that, you can do the APM adjustment in Windows or Linux.

2.Method: Enclosures with integrated spin-down

For Maxtor OneTouch drives see the Maxtor OneTouch HOWTO.

I just bought a Seagate Baracuda 3.5" drive and installed it in a third party enclosure. Upon contacting their tech support in Europe they stated that:

  • Seagate does not support other power management than managed by the running OS
  • Seagate does not support drives to be installed in third party enclosures
  • Seagate disks do not have a function to retain the power management settings

So I guess my advice would be not to buy the Seagate disks.

By Miro Dietiker As i see, some disks of higher price (and quality?) power down out-of-the-box with a meaningful value configured. If you have a USB disk which does this, extend this list please.

  • 13.03.2006: WesternDigital? Essential - 320 GB USB 2.0 / 3.5" / 7200 rpm (All WD Essential drives seem to implement this feature)
  • 24.03.2003 Maxtor One Touch - 200 Go USB 2.0 / 3.5 " / 7200 rpm
  • 11.05.2006: Seagate 250GB USB 2.0 / 3.5" / 7200 RPM

Note:* 24.04.2006 I have a WesternDigital? Essential - 250 GB USB 2.0 / 3.5" / 7200 rpm and although it supports spindown by hardware and does so on my laptop, it wont do so on my slug. Even if completly umounted. + Openslug does not find this disk. EDIT: I now have spindown on this disk. Strangly it works with debian. I mounted my /var and /tmp on a usb-stick.

  • I do also have a Western Digital MyBook? Essential 500GB I bought with my NSLU2 in Nov 2006. And it does not spin down on the NSLU2. I also reverted to the original Linksys firmware but it still does not spin down. There is also another strange problem - from time to time the NSLU2 just does not boot up - only the ethernet light is on and the slug freezes - I have to unplug the power connector. Then it boots up normaly again - very strange. - Anguel Stankov

3. Method: How to use scsi-idle for spinning down USB disks.

Robert Demski provided a kernel patch as well as a package for the scsi-idle software to be used on the slug.

The build process is quite complicated as it requires setting up a cross-compile environment for the slug currently, until the kernel patch is included in the binary distributions of OpenSlug. The process is described in a blog post on fredericiana.com. Any comments appreciated.

How to use scsi-idle without kernel patch

By Ruud Senden

I've managed to automate spindown using scsi-idle without the kernel patch. I've created the perl script listed below based on a script I found at http://www.rootfs.net/jaws/index.php?gadget=Blog&action=SingleView&id=22:

#!/usr/bin/perl -w

$statfile = "/proc/diskstats";
die "$0: Cannot read $statfile\n" unless -r $statfile;

$| = 1;
($disk, $interval) = (@ARGV);
$disk =~ s,/dev/,,;
print "$0: disk: $disk, interval: $interval\n";

$halted_data = $last_seen = '';
while (1) {
  open(STATUS, $statfile);
  ($_) = grep(/^\s+\d+\s+\d+\s+$disk\s/o, <STATUS>);
  close STATUS;

  if ($last_seen eq $_ && $halted_data ne $_) {
    print "Spinning down: $disk\n";
    system "scsi-stop", "/dev/$disk";
    $halted_data = $_;
  }
  $last_seen = $_;
  sleep $interval;
}

Basically what this script does is take a device as the first argument, and an interval in seconds as the second argument. Every interval seconds it will look at /proc/diskstats for the given device, and if the status didn't change the disk will be spun down. The disk will automatically spin up again when accessed (on my system at least).

Installation instructions:

  1. Install perl
  2. Install the scsi-idle package, which can be downloaded from the Yahoo Files section
  3. Save the perl script listed above to your filesystem, for example named autospindown. Make sure the script is executable: chmod +rx autospindown
  4. Edit /etc/default/scsi-idle to list the timeouts for your drive(s), see the instructions in that file for more information.
  5. Edit /etc/init.d/scsi-idle, changing the DAEMON variable to point to the perl script you saved in step 3.
  6. /etc/init.d/scsi-idle start

I've tested this on my NSLU2 with OpenSlug 2.7 installed, I think a similar approach should work on Unslung as well. Any comments appreciated.

Note - the file "/proc/diskstats" does not exist on Unslung 5.5, so this technique won't work directly on Unslung boxes.

  • note 11th Sept 2006

Installing scsi-idle_2.4.23-r1_armeb.ipk onto unslung 6.8 fails as : ERROR: Cannot satisfy the following dependencies for scsi-idle:

         libgcc1 (>= 3.4.4) libc6 (>= 2.3.5+cvs20050627) **

Shell-only scsi-idle without kernel patch

By Chris

Using Ruud's idea, except implemented as a shell script so you don't need Perl (which is great, but takes a lot of space if you're running from flash only). This seems to work fine with the vanilla OpenSlug firmware, a ByteCC 2.5" external enclosure, and a Seagate 40GB 2.5" drive.

This version updates the status more often than the Perl version which prevents waiting almost a complete extra interval cycle under certain circumstances. Feel free to hack this script and make it better as I didn't spend much time on it.

Stripwax adds: The scsi-idle package and the perl script above follow the convention that the drive to idle is e.g. "dev/sda" whereas the below seems to want to expect just e.g. "sda". In my opinion you will need to change the line "disk=$1" below to something like "disk=${1#/dev/}" or similar

#!/bin/sh

disk=$1
interval=$2

state=`grep "\s$disk\s" /proc/diskstats`
count=$interval
up=1

while [ true ]; do
   sleep 10
   count=$(($count-10))
   newstate=`grep "\s$disk\s" /proc/diskstats`
   if [ "$state" = "$newstate" ]; then
      if [ $count -lt 0 ]; then
         count=$interval
         if [ $up = 1 ]; then
            #echo -e "spin-down\t" `date`
            sync
            state=`grep "\s$disk\s" /proc/diskstats`
            scsi-stop /dev/$disk
            up=0
         fi
      fi
   else
      #echo -e "drive is up\t" `date`
      count=$interval
      state="$newstate"
      up=1
   fi
done

4.Method: Use sg_start to spindown usb disk

for OpenDebianSlug? 3.10 2.16 kernel:

  install sg3 scsi tools: apt-get install sg3-utils
  powerdown hdd: /usr/bin/sg_start 0 -pc=3 /dev/sda
  use shell or perl script for automatic powerdown

System modifications for HD spin-down OR

How to make your standalone USB disk really spindown

[by JNC]

OK, you could tell me : what is this update? I have read much in the MaxtorOneTouch-Howto about the procedure to move /dev and /var back to RAM, so, why another section ?

That's definitively true. Many thanks to those who contributed to write those pages. I just found 2 problems with what I read :

  • it was for Unslung version only (not Openslug) [Unslung version]
  • the process was incomplete (only for /var) and impossible to extend to /dev

As I don't like to complain without acting, here is my contribution from my experience. I hope it can be useful to anybody.

Preamble

The problem

Once everything is running fine, my disk (Maxtor One Touch) does not spin down, as the NSLU2 regularly accesses files from /dev and /var.

The solution

One solution is to move back /dev and /var to RAM.

Debianslug: The script works with debianslug so long as you uncomment the highlighted line (devpts needs to be remounted otherwise on login ssh can not start a shell giving a 'Server refused to allocate pty' error). The script only copies /dev and /var/log but you would do well to tweak /etc/syslog.conf and /etc/logrotate* to be as economical as possible.

The challenge

Creating a RAM resource, and attach /dev and /ram is easy (mount -t ramfs ramfs ... command). But, as the RAM memory is volatile, the challenge is to create a script that will copy all files from /dev and /var into the RAM resources you created, each time you boot the NSLU2. We must deal with two issues :

  • where is the correct location for my script?
  • what is the command to use to copy the unregular files from /dev ?

The procedure

  • cd /etc/init.d

(all init script should be located in this directory, regardless the run levels they are involved in. There should be a link to this script in the run-level-dedicated directory.)

  • Create the following mount_var_dev.sh script :
#!/bin/sh
# /etc/init.d/mount_var_dev.sh
# Script section to create ramdisk for /var and for /dev

# disable the oom-killer to use the full swap
/sbin/sysctl -w vm.overcommit_memory=1

# better only use /var/log then the full /var
/bin/echo "Creating ramfs for /var/log:"
/bin/mount -t ramfs ramfs /mnt -o maxsize=256
/bin/cp -rp /var/log/* /mnt/
/bin/mount -o bind /var/log /var/log.state
/bin/mount -o bind /mnt /var/log
/bin/umount /mnt

/bin/echo "Creating ramfs for /dev:"
/bin/mount -t ramfs ramfs /mnt -o maxsize=256
cd /dev
find . -print0 -mount | cpio -p -0 -d -m -u /mnt
# you can not use cp command for /dev
/bin/mount -o bind /dev /dev.state
/bin/mount -o bind /mnt /dev
/bin/umount /mnt

# Uncomment the following line when using debianslug
#mount devpts /dev/pts -t devpts

# Return and continue execution of system rc.
return 1
# [EOF]
  • chmod 0755 mount_var_dev.sh
  • cd /etc/rcS.d

(this directory contains all scripts for a generic 'Start' run-level, that is run before running level 3)

  • ln -s /etc/init.d/mount_var_dev.sh S37mount_var_dev.sh

(try to do that after activating swap!)

  • chmod 0755 S37mount_var_dev.sh

(all init scripts are supposed to be in /etc/init.d, and linked to the appropriate directory for the appropriate run-level).

  • edit /etc/syslog.conf and remove the /dev/xconsole entry (only used for X11 logging)
  • cd /etc
  • vi fstab

for all partition from the disk that must spin down, add ,noatime to the 4th column (there should be only default). (this will prevent to wake up the disk for cached read access, just to update the 'last access time' flag of the file)

Before

/dev/sda1       /       ext2    defaults        1  1
/dev/sda2       /home   ext2    defaults        1  2

After

/dev/sda1       /       ext2    defaults,noatime        1  1
/dev/sda2       /home   ext2    defaults,noatime        1  2
  • shutdown -r 0

(reboot)

It is done, you can check using the mount command that /dev and /var are now in RAM. Your disk will spindown with the timer you specified.

NOTE: This works fine on my Unslung6.8 slug (with the script in /opt/etc/init.d). Mount now returns:

[..]
/dev/sda1 on /share/flash/data type ext3 (rw,noatime)
/dev/sda2 on /share/flash/conf type ext3 (rw,sync,noatime)
/dev/sdb1 on /share/hdd/data/HDD_1_1_1 type ufsd (rw)
ramfs on /var/log type ramfs (rw)
ramfs on /dev type ramfs (rw)

Why can't I use sdparm to do spindown-magic?

I corresponded with the developer of sdparm (the SCSI version of hdparm) about using this tool to either set spin-down timers or stop/start disks, here's his explanation for why this can't be done currently.


However the major weakness is in the SCSI<->ATA protocol conversion code/silicon inside the external enclosure housing the IDE disk. If it is like the ones I have tested, it supports READ(10)/WRITE(10)/INQUIRY/ READ_CAPACITY SCSI commands only. The MODE_SENSE commands are dummied up by the USB mass storage driver (within linux kernel) so as to not upset the sd (scsi disk) driver.

Spinning down (or up) a disk requires the SCSI START_STOP_UNIT command to be supported. Even SCSI to ATA Translation (SAT) layer that linux does control (e.g. libata for SATA disks) has only recently added that command (a year after libata was released in the kernel). Convincing people that such commands are worthwhile is not an easy task!

So I encourage your persitence but fear the exercise will be futile. Hopefully in a year or so better SAT layers will surface.

an example of a working sdparm (NOT nslu2 btw) With a 2.6.11 Kernel (have not tried others) on a x86 (Via C3) it's possible to spin down a Samsung SV1640N? in an ICY Box "blue" using "sdparm-0.95"

 # sdparm --command=stop /dev/sdb
 /dev/sdb: SAMSUNG   SP1604N           TM10

And turn it on:

 # sdparm --command=start /dev/sdb
 /dev/sdb: SAMSUNG   SP1604N           TM10

hdparm or any disk acces can start it:

 # hdparm -t /dev/sdb
 /dev/sdb:
  Timing buffered disk reads:    2 MB in  5.76 seconds = 355.73 kB/sec

 # hdparm -t /dev/sdb
 /dev/sdb:
  Timing buffered disk reads:   72 MB in  3.06 seconds =  23.56 MB/sec

Wasn't actually tried on NSLU2 (other kernel, no enivronment etc.). But maybe it will work there too? At least with that case that disk and that USB driver it seems to be possible to spin down an USB Drive!

[Zhyla] This didn't work on my "Genesys" USB adapter on my FC3 box (2.6.9 kernel, sdparm-0.95 and 0.96beta).

Can you try running --command=stop and then --command=ready? It should indicate that it isn't ready (i.e. it's spun down).

[rz] Nice idea, but sorry: --command=ready always shows "ready" regardless if the disk is really spun down/sleeping or not.


[rz] Have tried several cases with Linux version 2.6.11 with a Samsung SP1604?(169GB) and an old Maxtor 53073U6(8GB)

[rz]Supporting(!) "stop" (45 Euro Raid Sonic ICY Box 3.5 Combo (USB+FW)):

 P:  Vendor=067b ProdID?=3507 Rev= 0.01
 S:  Product=ATAPI-6 Bridge Controller
 S:  Manufacturer=Prolific Technology Inc.
 Chip: not visible, assuming(!) Profilic PL3507?

[mag] Another enclosure supporting stop is PPA ME-780U2-2162, which also uses a Prolific chipset.

[rz]Not supporting "stop" (15 Euro Evertech):

 P:  Vendor=04b4 ProdID?=6830 Rev= 2.40
 S:  Product=Cypress AT2LP?
 Chip: CY7C68300B?-56PVXC

[rz]Not supporting "stop" (60 Euro Delock? Combo)

 P:  Vendor=0402 ProdID?=5621 Rev= 1.03
 S:  Product=USB 2.0 Storage Device
 Chip: ALI M5621 + Oxford FW

[rz]Not supporting "stop" via USB but "inside" (55Euro atechweb LAN Server HD9?-U2lA?)

 P:  Vendor=05e3 ProdID?=0702 Rev= 0.33
 S:  Product=USB TO IDE
 Chip: GL811E? (FTR: CPU: RDC R2882)

[rz]As the prolific chip set used by radsonic do spin down the disk (really) that can't be a problem with linux, at least not with linux 2.6.11.


[rz]What chip set is used in which Raidsonic case:

IB-550UE Prolific (PL3507?) - Agere (FW8028?) since 02/2005
IB-350/351/360UE Prolific (PL3507?) - Agere (FW8028?)
IB-350/351US Prolific (PL2507?) - Silicon Image (Sil36CT80?)
IB-350/351/360U Cypress (7C68300A)
IB-250/251U Cypress (7C68300A)
IB-355U Ali (M5621A1?)
IB-525U Ali (M5621A1?)
IB-550U Ali (M5621A1?)
IB-350StS without any

http://www.raidsonic.de/de/pages/service/faq.php (It's only in the german FAQ)


IB-351UE - Agere Chip

      Seagate ST3?? 7200.7 (does not accept the KEEP_OVER_RESET-flag: hdparm -K ...)
      sdparm 0.94
      Kernel 2.6.13 (on desktop, not slug) spins down with sdparm --command=stop /dev/sda
      Seagate has a tool called SeaTool?? (like IBM/Hitachi's Featuretool), but it does not
      have any features to set powermanagement or spin down timers.

Why does my disk not spin down?

Why does it spin up after only five minutes?

Which process is accessing the disk?

To answer this sort of question, see HowtoIdentifyWhichProcessesAccessDisk

December 14, 2006, at 09:21 PM by bathroom vanities --
Changed lines 1-471 from:

Contents

Motivation

Not everyone wants a 24/7 running harddisk. A noisy harddisk right beside is awful and the lifespan of a permanently running HD is shorter, too.

Quick Summary

For various technical reasons it is not generally possible to adjust the standby timer of an IDE disk connected through a USB adapter (including turnkey external USB drives). See the sdparm page and the section below on sdparm for the technical reasons.

1. Method: So one method available is to temporarily connect the drive via its IDE connector directly to a big Linux box and run hdparm to set the timer (the -S option is what you're looking for, PLEASE read the hdparm man page before even thinking about running it)[OS independent]. You need an enclosure with separate power and IDE connectors to do this.

Advantage: Can be used on every HD which supports standby regardless of the OS.

Disadvantage: Every time you turn off your HD or there is a power loss you have to repeat the procedure if your drive doesnt support he KEEP_OVER_RESET-flag.

A very similiar method is using a vendor-specific tool (like IBM Feature Tool) to setup the spin-down time before installing the drive into its enclosure.

2. Method: This is a sub-variant of the 1.Method. Simply buy a HD/enlcosure combo which supports down-spinning by itself (e.g. Maxtor OneTouch series, WD Essential Drives)[OS independent]. A simple but probably more expensive method (and i've heard Maxtor OneTouch HDs? are rather noisy, too ;).

3. Method: Another method is to use scsi-idle. However, this requires a kernel patch as the corresponding kernel changes are not yet included in the nslu2-linux binaries. See the scsi-idle section below [applies to Openslug, Unslung].

All methods most often require modifications concerning the syslog- and other daemons because of their behaviour of writing time-marks into their log-files (especially syslog), as this will cause your HD to spin up at certain intervalls.

As of now (June 2006) SDPARM will most certainly NOT WORK on non-combo(FW+USB) drives. Tell us if you found further working drives.

[mag: I own a usb-only enclosure that spins down fine with sdparm. I think it's more of a question of the controller it uses rather than combo vs. non-combo.]

For further details check below.

1. Method: How do I spin down my USB hard disks?

Any drive can have a spindown timeout, provided:

  • The disk can take 'hdparm -S120 /dev/hdx' and spindown after 10 minutes.
  • It is possible to have the drive using the power from the usb-ide adapter while plugged into the normal ide of your pc.

Prerequisites:

- Harddisk with separate IDE and power connectors.

eg. IcyBox? black [http://www.raidsonic.de/de/pages/products/external_cases.php?we_objectID=3206] [ST: this works fine for me].

- Another Linux machine to connect it to with hdparm installed.

1) Take your HD and install it the enclosure (especially the power connector to the drive).

2) Turn on your enclosure.

2) Disconnect the enclosure's IDE connector (if connected) and connect the other Linux machine's IDE connector to the HD.

3) Set the spindown-time 'hdparm -k1 -K1 -S120 /dev/hda' where -Sxx specifies the spindown-time. -k1-K1 set the keep over reset-flags if supported.

4) Disconnect the Linux machine's IDE connector

5) Connect the enclosures IDE connector to the HD !WITHOUT REMOVING THE POWER from the HD!

This way the drive is never reset, and will keep its spindown setting. Of course if hdparm -k1 -K1 -S120 actually makes your drives remember their settings this is irrelevant, but for anyone like me whose drives wont remember their settings this is a way to make them spindown.

For those with enclosures that wont let them do this, I use this. The usb-ide and power supply are completely separate, which make this easy.

[ST: Bought an enclosure with internal SATA interface and external SATA/USB interface IcyBox IB-360StUS-B and installed a Samsung 250GB SATA II (SP2504C?) into it. Connected it via SATA (MB to external slot-connector is included) to my big machine and ran hdparm. Voila, the disk spins down.]

Sub-method: You can download the Power Booster utility for 2.5" IBM/Hitachi TravelStar disks. The Power Booster utility will enable the auto spin down feature of the disk. For 3.5" IBM/Hitachi drives (and maybe others), you can download the Feature Tool. Otherwise temporarily install the IDE disk in your ordinary Linux box, read the disk technical documentation and use hdparm to adjust the settings by hand. The trick is to enable APM within the drive itself, so Linux doesn't have to care about it at all. You can't use hdparm to alter the APM settings from the NSLU2 as the USB->IDE adapters are emulated as SCSI host adapters in the Linux kernel which is incompatible with the necessary hdparm options.

[Request by ingeba]: To my knowledge this does not work. Can anyone verify that APM settings may cause NSLU2 connected drives in arbitrary enclosures to spin down? If so, please list drive and enclosure brand and here:

[slavikb] This worked for me (Hitachi 7K250, noname box, Feature Tool). I had to remount root with -noatime option. The drive goes into Low RPM mode after 10 minutes of inactivity.

Either way, you'll have to open your 2.5" USB enclosure and install the disk drive temporarily to a desktop computer using a 2.5" to 3.5" IDE adapter. After that, you can do the APM adjustment in Windows or Linux.

2.Method: Enclosures with integrated spin-down

For Maxtor OneTouch drives see the Maxtor OneTouch HOWTO.

I just bought a Seagate Baracuda 3.5" drive and installed it in a third party enclosure. Upon contacting their tech support in Europe they stated that:

  • Seagate does not support other power management than managed by the running OS
  • Seagate does not support drives to be installed in third party enclosures
  • Seagate disks do not have a function to retain the power management settings

So I guess my advice would be not to buy the Seagate disks.

By Miro Dietiker As i see, some disks of higher price (and quality?) power down out-of-the-box with a meaningful value configured. If you have a USB disk which does this, extend this list please.

  • 13.03.2006: WesternDigital? Essential - 320 GB USB 2.0 / 3.5" / 7200 rpm (All WD Essential drives seem to implement this feature)
  • 24.03.2003 Maxtor One Touch - 200 Go USB 2.0 / 3.5 " / 7200 rpm
  • 11.05.2006: Seagate 250GB USB 2.0 / 3.5" / 7200 RPM

Note:* 24.04.2006 I have a WesternDigital? Essential - 250 GB USB 2.0 / 3.5" / 7200 rpm and although it supports spindown by hardware and does so on my laptop, it wont do so on my slug. Even if completly umounted. + Openslug does not find this disk. EDIT: I now have spindown on this disk. Strangly it works with debian. I mounted my /var and /tmp on a usb-stick.

  • I do also have a Western Digital MyBook? Essential 500GB I bought with my NSLU2 in Nov 2006. And it does not spin down on the NSLU2. I also reverted to the original Linksys firmware but it still does not spin down. There is also another strange problem - from time to time the NSLU2 just does not boot up - only the ethernet light is on and the slug freezes - I have to unplug the power connector. Then it boots up normaly again - very strange. - Anguel Stankov

3. Method: How to use scsi-idle for spinning down USB disks.

Robert Demski provided a kernel patch as well as a package for the scsi-idle software to be used on the slug.

The build process is quite complicated as it requires setting up a cross-compile environment for the slug currently, until the kernel patch is included in the binary distributions of OpenSlug. The process is described in a blog post on fredericiana.com. Any comments appreciated.

How to use scsi-idle without kernel patch

By Ruud Senden

I've managed to automate spindown using scsi-idle without the kernel patch. I've created the perl script listed below based on a script I found at http://www.rootfs.net/jaws/index.php?gadget=Blog&action=SingleView&id=22:

#!/usr/bin/perl -w

$statfile = "/proc/diskstats";
die "$0: Cannot read $statfile\n" unless -r $statfile;

$| = 1;
($disk, $interval) = (@ARGV);
$disk =~ s,/dev/,,;
print "$0: disk: $disk, interval: $interval\n";

$halted_data = $last_seen = '';
while (1) {
  open(STATUS, $statfile);
  ($_) = grep(/^\s+\d+\s+\d+\s+$disk\s/o, <STATUS>);
  close STATUS;

  if ($last_seen eq $_ && $halted_data ne $_) {
    print "Spinning down: $disk\n";
    system "scsi-stop", "/dev/$disk";
    $halted_data = $_;
  }
  $last_seen = $_;
  sleep $interval;
}

Basically what this script does is take a device as the first argument, and an interval in seconds as the second argument. Every interval seconds it will look at /proc/diskstats for the given device, and if the status didn't change the disk will be spun down. The disk will automatically spin up again when accessed (on my system at least).

Installation instructions:

  1. Install perl
  2. Install the scsi-idle package, which can be downloaded from the Yahoo Files section
  3. Save the perl script listed above to your filesystem, for example named autospindown. Make sure the script is executable: chmod +rx autospindown
  4. Edit /etc/default/scsi-idle to list the timeouts for your drive(s), see the instructions in that file for more information.
  5. Edit /etc/init.d/scsi-idle, changing the DAEMON variable to point to the perl script you saved in step 3.
  6. /etc/init.d/scsi-idle start

I've tested this on my NSLU2 with OpenSlug 2.7 installed, I think a similar approach should work on Unslung as well. Any comments appreciated.

Note - the file "/proc/diskstats" does not exist on Unslung 5.5, so this technique won't work directly on Unslung boxes.

  • note 11th Sept 2006

Installing scsi-idle_2.4.23-r1_armeb.ipk onto unslung 6.8 fails as : ERROR: Cannot satisfy the following dependencies for scsi-idle:

         libgcc1 (>= 3.4.4) libc6 (>= 2.3.5+cvs20050627) **

Shell-only scsi-idle without kernel patch

By Chris

Using Ruud's idea, except implemented as a shell script so you don't need Perl (which is great, but takes a lot of space if you're running from flash only). This seems to work fine with the vanilla OpenSlug firmware, a ByteCC 2.5" external enclosure, and a Seagate 40GB 2.5" drive.

This version updates the status more often than the Perl version which prevents waiting almost a complete extra interval cycle under certain circumstances. Feel free to hack this script and make it better as I didn't spend much time on it.

Stripwax adds: The scsi-idle package and the perl script above follow the convention that the drive to idle is e.g. "dev/sda" whereas the below seems to want to expect just e.g. "sda". In my opinion you will need to change the line "disk=$1" below to something like "disk=${1#/dev/}" or similar

#!/bin/sh

disk=$1
interval=$2

state=`grep "\s$disk\s" /proc/diskstats`
count=$interval
up=1

while [ true ]; do
   sleep 10
   count=$(($count-10))
   newstate=`grep "\s$disk\s" /proc/diskstats`
   if [ "$state" = "$newstate" ]; then
      if [ $count -lt 0 ]; then
         count=$interval
         if [ $up = 1 ]; then
            #echo -e "spin-down\t" `date`
            sync
            state=`grep "\s$disk\s" /proc/diskstats`
            scsi-stop /dev/$disk
            up=0
         fi
      fi
   else
      #echo -e "drive is up\t" `date`
      count=$interval
      state="$newstate"
      up=1
   fi
done

4.Method: Use sg_start to spindown usb disk

for OpenDebianSlug? 3.10 2.16 kernel:

  install sg3 scsi tools: apt-get install sg3-utils
  powerdown hdd: /usr/bin/sg_start 0 -pc=3 /dev/sda
  use shell or perl script for automatic powerdown

System modifications for HD spin-down OR

How to make your standalone USB disk really spindown

[by JNC]

OK, you could tell me : what is this update? I have read much in the MaxtorOneTouch-Howto about the procedure to move /dev and /var back to RAM, so, why another section ?

That's definitively true. Many thanks to those who contributed to write those pages. I just found 2 problems with what I read :

  • it was for Unslung version only (not Openslug) [Unslung version]
  • the process was incomplete (only for /var) and impossible to extend to /dev

As I don't like to complain without acting, here is my contribution from my experience. I hope it can be useful to anybody.

Preamble

The problem

Once everything is running fine, my disk (Maxtor One Touch) does not spin down, as the NSLU2 regularly accesses files from /dev and /var.

The solution

One solution is to move back /dev and /var to RAM.

Debianslug: The script works with debianslug so long as you uncomment the highlighted line (devpts needs to be remounted otherwise on login ssh can not start a shell giving a 'Server refused to allocate pty' error). The script only copies /dev and /var/log but you would do well to tweak /etc/syslog.conf and /etc/logrotate* to be as economical as possible.

The challenge

Creating a RAM resource, and attach /dev and /ram is easy (mount -t ramfs ramfs ... command). But, as the RAM memory is volatile, the challenge is to create a script that will copy all files from /dev and /var into the RAM resources you created, each time you boot the NSLU2. We must deal with two issues :

  • where is the correct location for my script?
  • what is the command to use to copy the unregular files from /dev ?

The procedure

  • cd /etc/init.d

(all init script should be located in this directory, regardless the run levels they are involved in. There should be a link to this script in the run-level-dedicated directory.)

  • Create the following mount_var_dev.sh script :
#!/bin/sh
# /etc/init.d/mount_var_dev.sh
# Script section to create ramdisk for /var and for /dev

# disable the oom-killer to use the full swap
/sbin/sysctl -w vm.overcommit_memory=1

# better only use /var/log then the full /var
/bin/echo "Creating ramfs for /var/log:"
/bin/mount -t ramfs ramfs /mnt -o maxsize=256
/bin/cp -rp /var/log/* /mnt/
/bin/mount -o bind /var/log /var/log.state
/bin/mount -o bind /mnt /var/log
/bin/umount /mnt

/bin/echo "Creating ramfs for /dev:"
/bin/mount -t ramfs ramfs /mnt -o maxsize=256
cd /dev
find . -print0 -mount | cpio -p -0 -d -m -u /mnt
# you can not use cp command for /dev
/bin/mount -o bind /dev /dev.state
/bin/mount -o bind /mnt /dev
/bin/umount /mnt

# Uncomment the following line when using debianslug
#mount devpts /dev/pts -t devpts

# Return and continue execution of system rc.
return 1
# [EOF]
  • chmod 0755 mount_var_dev.sh
  • cd /etc/rcS.d

(this directory contains all scripts for a generic 'Start' run-level, that is run before running level 3)

  • ln -s /etc/init.d/mount_var_dev.sh S37mount_var_dev.sh

(try to do that after activating swap!)

  • chmod 0755 S37mount_var_dev.sh

(all init scripts are supposed to be in /etc/init.d, and linked to the appropriate directory for the appropriate run-level).

  • edit /etc/syslog.conf and remove the /dev/xconsole entry (only used for X11 logging)
  • cd /etc
  • vi fstab

for all partition from the disk that must spin down, add ,noatime to the 4th column (there should be only default). (this will prevent to wake up the disk for cached read access, just to update the 'last access time' flag of the file)

Before

/dev/sda1       /       ext2    defaults        1  1
/dev/sda2       /home   ext2    defaults        1  2

After

/dev/sda1       /       ext2    defaults,noatime        1  1
/dev/sda2       /home   ext2    defaults,noatime        1  2
  • shutdown -r 0

(reboot)

It is done, you can check using the mount command that /dev and /var are now in RAM. Your disk will spindown with the timer you specified.

NOTE: This works fine on my Unslung6.8 slug (with the script in /opt/etc/init.d). Mount now returns:

[..]
/dev/sda1 on /share/flash/data type ext3 (rw,noatime)
/dev/sda2 on /share/flash/conf type ext3 (rw,sync,noatime)
/dev/sdb1 on /share/hdd/data/HDD_1_1_1 type ufsd (rw)
ramfs on /var/log type ramfs (rw)
ramfs on /dev type ramfs (rw)

Why can't I use sdparm to do spindown-magic?

I corresponded with the developer of sdparm (the SCSI version of hdparm) about using this tool to either set spin-down timers or stop/start disks, here's his explanation for why this can't be done currently.


However the major weakness is in the SCSI<->ATA protocol conversion code/silicon inside the external enclosure housing the IDE disk. If it is like the ones I have tested, it supports READ(10)/WRITE(10)/INQUIRY/ READ_CAPACITY SCSI commands only. The MODE_SENSE commands are dummied up by the USB mass storage driver (within linux kernel) so as to not upset the sd (scsi disk) driver.

Spinning down (or up) a disk requires the SCSI START_STOP_UNIT command to be supported. Even SCSI to ATA Translation (SAT) layer that linux does control (e.g. libata for SATA disks) has only recently added that command (a year after libata was released in the kernel). Convincing people that such commands are worthwhile is not an easy task!

So I encourage your persitence but fear the exercise will be futile. Hopefully in a year or so better SAT layers will surface.

an example of a working sdparm (NOT nslu2 btw) With a 2.6.11 Kernel (have not tried others) on a x86 (Via C3) it's possible to spin down a Samsung SV1640N? in an ICY Box "blue" using "sdparm-0.95"

 # sdparm --command=stop /dev/sdb
 /dev/sdb: SAMSUNG   SP1604N           TM10

And turn it on:

 # sdparm --command=start /dev/sdb
 /dev/sdb: SAMSUNG   SP1604N           TM10

hdparm or any disk acces can start it:

 # hdparm -t /dev/sdb
 /dev/sdb:
  Timing buffered disk reads:    2 MB in  5.76 seconds = 355.73 kB/sec

 # hdparm -t /dev/sdb
 /dev/sdb:
  Timing buffered disk reads:   72 MB in  3.06 seconds =  23.56 MB/sec

Wasn't actually tried on NSLU2 (other kernel, no enivronment etc.). But maybe it will work there too? At least with that case that disk and that USB driver it seems to be possible to spin down an USB Drive!

[Zhyla] This didn't work on my "Genesys" USB adapter on my FC3 box (2.6.9 kernel, sdparm-0.95 and 0.96beta).

Can you try running --command=stop and then --command=ready? It should indicate that it isn't ready (i.e. it's spun down).

[rz] Nice idea, but sorry: --command=ready always shows "ready" regardless if the disk is really spun down/sleeping or not.


[rz] Have tried several cases with Linux version 2.6.11 with a Samsung SP1604?(169GB) and an old Maxtor 53073U6(8GB)

[rz]Supporting(!) "stop" (45 Euro Raid Sonic ICY Box 3.5 Combo (USB+FW)):

 P:  Vendor=067b ProdID?=3507 Rev= 0.01
 S:  Product=ATAPI-6 Bridge Controller
 S:  Manufacturer=Prolific Technology Inc.
 Chip: not visible, assuming(!) Profilic PL3507?

[mag] Another enclosure supporting stop is PPA ME-780U2-2162, which also uses a Prolific chipset.

[rz]Not supporting "stop" (15 Euro Evertech):

 P:  Vendor=04b4 ProdID?=6830 Rev= 2.40
 S:  Product=Cypress AT2LP?
 Chip: CY7C68300B?-56PVXC

[rz]Not supporting "stop" (60 Euro Delock? Combo)

 P:  Vendor=0402 ProdID?=5621 Rev= 1.03
 S:  Product=USB 2.0 Storage Device
 Chip: ALI M5621 + Oxford FW

[rz]Not supporting "stop" via USB but "inside" (55Euro atechweb LAN Server HD9?-U2lA?)

 P:  Vendor=05e3 ProdID?=0702 Rev= 0.33
 S:  Product=USB TO IDE
 Chip: GL811E? (FTR: CPU: RDC R2882)

[rz]As the prolific chip set used by radsonic do spin down the disk (really) that can't be a problem with linux, at least not with linux 2.6.11.


[rz]What chip set is used in which Raidsonic case:

IB-550UE Prolific (PL3507?) - Agere (FW8028?) since 02/2005
IB-350/351/360UE Prolific (PL3507?) - Agere (FW8028?)
IB-350/351US Prolific (PL2507?) - Silicon Image (Sil36CT80?)
IB-350/351/360U Cypress (7C68300A)
IB-250/251U Cypress (7C68300A)
IB-355U Ali (M5621A1?)
IB-525U Ali (M5621A1?)
IB-550U Ali (M5621A1?)
IB-350StS without any

http://www.raidsonic.de/de/pages/service/faq.php (It's only in the german FAQ)


IB-351UE - Agere Chip

      Seagate ST3?? 7200.7 (does not accept the KEEP_OVER_RESET-flag: hdparm -K ...)
      sdparm 0.94
      Kernel 2.6.13 (on desktop, not slug) spins down with sdparm --command=stop /dev/sda
      Seagate has a tool called SeaTool?? (like IBM/Hitachi's Featuretool), but it does not
      have any features to set powermanagement or spin down timers.

Why does my disk not spin down?

Why does it spin up after only five minutes?

Which process is accessing the disk?

To answer this sort of question, see HowtoIdentifyWhichProcessesAccessDisk

to:

http://myblog.es/bthvan <a href="http://myblog.es/bthvan">bathroom vanities</a> bathroom vanities

December 12, 2006, at 08:41 AM by wholesale handbags -- unspam, how about limiting anonymous editing of this page?
Changed lines 1-471 from:

http://myblog.es/whobag <a href="http://myblog.es/whobag">wholesale handbags</a> wholesale handbags

to:

Contents

Motivation

Not everyone wants a 24/7 running harddisk. A noisy harddisk right beside is awful and the lifespan of a permanently running HD is shorter, too.

Quick Summary

For various technical reasons it is not generally possible to adjust the standby timer of an IDE disk connected through a USB adapter (including turnkey external USB drives). See the sdparm page and the section below on sdparm for the technical reasons.

1. Method: So one method available is to temporarily connect the drive via its IDE connector directly to a big Linux box and run hdparm to set the timer (the -S option is what you're looking for, PLEASE read the hdparm man page before even thinking about running it)[OS independent]. You need an enclosure with separate power and IDE connectors to do this.

Advantage: Can be used on every HD which supports standby regardless of the OS.

Disadvantage: Every time you turn off your HD or there is a power loss you have to repeat the procedure if your drive doesnt support he KEEP_OVER_RESET-flag.

A very similiar method is using a vendor-specific tool (like IBM Feature Tool) to setup the spin-down time before installing the drive into its enclosure.

2. Method: This is a sub-variant of the 1.Method. Simply buy a HD/enlcosure combo which supports down-spinning by itself (e.g. Maxtor OneTouch series, WD Essential Drives)[OS independent]. A simple but probably more expensive method (and i've heard Maxtor OneTouch HDs? are rather noisy, too ;).

3. Method: Another method is to use scsi-idle. However, this requires a kernel patch as the corresponding kernel changes are not yet included in the nslu2-linux binaries. See the scsi-idle section below [applies to Openslug, Unslung].

All methods most often require modifications concerning the syslog- and other daemons because of their behaviour of writing time-marks into their log-files (especially syslog), as this will cause your HD to spin up at certain intervalls.

As of now (June 2006) SDPARM will most certainly NOT WORK on non-combo(FW+USB) drives. Tell us if you found further working drives.

[mag: I own a usb-only enclosure that spins down fine with sdparm. I think it's more of a question of the controller it uses rather than combo vs. non-combo.]

For further details check below.

1. Method: How do I spin down my USB hard disks?

Any drive can have a spindown timeout, provided:

  • The disk can take 'hdparm -S120 /dev/hdx' and spindown after 10 minutes.
  • It is possible to have the drive using the power from the usb-ide adapter while plugged into the normal ide of your pc.

Prerequisites:

- Harddisk with separate IDE and power connectors.

eg. IcyBox? black [http://www.raidsonic.de/de/pages/products/external_cases.php?we_objectID=3206] [ST: this works fine for me].

- Another Linux machine to connect it to with hdparm installed.

1) Take your HD and install it the enclosure (especially the power connector to the drive).

2) Turn on your enclosure.

2) Disconnect the enclosure's IDE connector (if connected) and connect the other Linux machine's IDE connector to the HD.

3) Set the spindown-time 'hdparm -k1 -K1 -S120 /dev/hda' where -Sxx specifies the spindown-time. -k1-K1 set the keep over reset-flags if supported.

4) Disconnect the Linux machine's IDE connector

5) Connect the enclosures IDE connector to the HD !WITHOUT REMOVING THE POWER from the HD!

This way the drive is never reset, and will keep its spindown setting. Of course if hdparm -k1 -K1 -S120 actually makes your drives remember their settings this is irrelevant, but for anyone like me whose drives wont remember their settings this is a way to make them spindown.

For those with enclosures that wont let them do this, I use this. The usb-ide and power supply are completely separate, which make this easy.

[ST: Bought an enclosure with internal SATA interface and external SATA/USB interface IcyBox IB-360StUS-B and installed a Samsung 250GB SATA II (SP2504C?) into it. Connected it via SATA (MB to external slot-connector is included) to my big machine and ran hdparm. Voila, the disk spins down.]

Sub-method: You can download the Power Booster utility for 2.5" IBM/Hitachi TravelStar disks. The Power Booster utility will enable the auto spin down feature of the disk. For 3.5" IBM/Hitachi drives (and maybe others), you can download the Feature Tool. Otherwise temporarily install the IDE disk in your ordinary Linux box, read the disk technical documentation and use hdparm to adjust the settings by hand. The trick is to enable APM within the drive itself, so Linux doesn't have to care about it at all. You can't use hdparm to alter the APM settings from the NSLU2 as the USB->IDE adapters are emulated as SCSI host adapters in the Linux kernel which is incompatible with the necessary hdparm options.

[Request by ingeba]: To my knowledge this does not work. Can anyone verify that APM settings may cause NSLU2 connected drives in arbitrary enclosures to spin down? If so, please list drive and enclosure brand and here:

[slavikb] This worked for me (Hitachi 7K250, noname box, Feature Tool). I had to remount root with -noatime option. The drive goes into Low RPM mode after 10 minutes of inactivity.

Either way, you'll have to open your 2.5" USB enclosure and install the disk drive temporarily to a desktop computer using a 2.5" to 3.5" IDE adapter. After that, you can do the APM adjustment in Windows or Linux.

2.Method: Enclosures with integrated spin-down

For Maxtor OneTouch drives see the Maxtor OneTouch HOWTO.

I just bought a Seagate Baracuda 3.5" drive and installed it in a third party enclosure. Upon contacting their tech support in Europe they stated that:

  • Seagate does not support other power management than managed by the running OS
  • Seagate does not support drives to be installed in third party enclosures
  • Seagate disks do not have a function to retain the power management settings

So I guess my advice would be not to buy the Seagate disks.

By Miro Dietiker As i see, some disks of higher price (and quality?) power down out-of-the-box with a meaningful value configured. If you have a USB disk which does this, extend this list please.

  • 13.03.2006: WesternDigital? Essential - 320 GB USB 2.0 / 3.5" / 7200 rpm (All WD Essential drives seem to implement this feature)
  • 24.03.2003 Maxtor One Touch - 200 Go USB 2.0 / 3.5 " / 7200 rpm
  • 11.05.2006: Seagate 250GB USB 2.0 / 3.5" / 7200 RPM

Note:* 24.04.2006 I have a WesternDigital? Essential - 250 GB USB 2.0 / 3.5" / 7200 rpm and although it supports spindown by hardware and does so on my laptop, it wont do so on my slug. Even if completly umounted. + Openslug does not find this disk. EDIT: I now have spindown on this disk. Strangly it works with debian. I mounted my /var and /tmp on a usb-stick.

  • I do also have a Western Digital MyBook? Essential 500GB I bought with my NSLU2 in Nov 2006. And it does not spin down on the NSLU2. I also reverted to the original Linksys firmware but it still does not spin down. There is also another strange problem - from time to time the NSLU2 just does not boot up - only the ethernet light is on and the slug freezes - I have to unplug the power connector. Then it boots up normaly again - very strange. - Anguel Stankov

3. Method: How to use scsi-idle for spinning down USB disks.

Robert Demski provided a kernel patch as well as a package for the scsi-idle software to be used on the slug.

The build process is quite complicated as it requires setting up a cross-compile environment for the slug currently, until the kernel patch is included in the binary distributions of OpenSlug. The process is described in a blog post on fredericiana.com. Any comments appreciated.

How to use scsi-idle without kernel patch

By Ruud Senden

I've managed to automate spindown using scsi-idle without the kernel patch. I've created the perl script listed below based on a script I found at http://www.rootfs.net/jaws/index.php?gadget=Blog&action=SingleView&id=22:

#!/usr/bin/perl -w

$statfile = "/proc/diskstats";
die "$0: Cannot read $statfile\n" unless -r $statfile;

$| = 1;
($disk, $interval) = (@ARGV);
$disk =~ s,/dev/,,;
print "$0: disk: $disk, interval: $interval\n";

$halted_data = $last_seen = '';
while (1) {
  open(STATUS, $statfile);
  ($_) = grep(/^\s+\d+\s+\d+\s+$disk\s/o, <STATUS>);
  close STATUS;

  if ($last_seen eq $_ && $halted_data ne $_) {
    print "Spinning down: $disk\n";
    system "scsi-stop", "/dev/$disk";
    $halted_data = $_;
  }
  $last_seen = $_;
  sleep $interval;
}

Basically what this script does is take a device as the first argument, and an interval in seconds as the second argument. Every interval seconds it will look at /proc/diskstats for the given device, and if the status didn't change the disk will be spun down. The disk will automatically spin up again when accessed (on my system at least).

Installation instructions:

  1. Install perl
  2. Install the scsi-idle package, which can be downloaded from the Yahoo Files section
  3. Save the perl script listed above to your filesystem, for example named autospindown. Make sure the script is executable: chmod +rx autospindown
  4. Edit /etc/default/scsi-idle to list the timeouts for your drive(s), see the instructions in that file for more information.
  5. Edit /etc/init.d/scsi-idle, changing the DAEMON variable to point to the perl script you saved in step 3.
  6. /etc/init.d/scsi-idle start

I've tested this on my NSLU2 with OpenSlug 2.7 installed, I think a similar approach should work on Unslung as well. Any comments appreciated.

Note - the file "/proc/diskstats" does not exist on Unslung 5.5, so this technique won't work directly on Unslung boxes.

  • note 11th Sept 2006

Installing scsi-idle_2.4.23-r1_armeb.ipk onto unslung 6.8 fails as : ERROR: Cannot satisfy the following dependencies for scsi-idle:

         libgcc1 (>= 3.4.4) libc6 (>= 2.3.5+cvs20050627) **

Shell-only scsi-idle without kernel patch

By Chris

Using Ruud's idea, except implemented as a shell script so you don't need Perl (which is great, but takes a lot of space if you're running from flash only). This seems to work fine with the vanilla OpenSlug firmware, a ByteCC 2.5" external enclosure, and a Seagate 40GB 2.5" drive.

This version updates the status more often than the Perl version which prevents waiting almost a complete extra interval cycle under certain circumstances. Feel free to hack this script and make it better as I didn't spend much time on it.

Stripwax adds: The scsi-idle package and the perl script above follow the convention that the drive to idle is e.g. "dev/sda" whereas the below seems to want to expect just e.g. "sda". In my opinion you will need to change the line "disk=$1" below to something like "disk=${1#/dev/}" or similar

#!/bin/sh

disk=$1
interval=$2

state=`grep "\s$disk\s" /proc/diskstats`
count=$interval
up=1

while [ true ]; do
   sleep 10
   count=$(($count-10))
   newstate=`grep "\s$disk\s" /proc/diskstats`
   if [ "$state" = "$newstate" ]; then
      if [ $count -lt 0 ]; then
         count=$interval
         if [ $up = 1 ]; then
            #echo -e "spin-down\t" `date`
            sync
            state=`grep "\s$disk\s" /proc/diskstats`
            scsi-stop /dev/$disk
            up=0
         fi
      fi
   else
      #echo -e "drive is up\t" `date`
      count=$interval
      state="$newstate"
      up=1
   fi
done

4.Method: Use sg_start to spindown usb disk

for OpenDebianSlug? 3.10 2.16 kernel:

  install sg3 scsi tools: apt-get install sg3-utils
  powerdown hdd: /usr/bin/sg_start 0 -pc=3 /dev/sda
  use shell or perl script for automatic powerdown

System modifications for HD spin-down OR

How to make your standalone USB disk really spindown

[by JNC]

OK, you could tell me : what is this update? I have read much in the MaxtorOneTouch-Howto about the procedure to move /dev and /var back to RAM, so, why another section ?

That's definitively true. Many thanks to those who contributed to write those pages. I just found 2 problems with what I read :

  • it was for Unslung version only (not Openslug) [Unslung version]
  • the process was incomplete (only for /var) and impossible to extend to /dev

As I don't like to complain without acting, here is my contribution from my experience. I hope it can be useful to anybody.

Preamble

The problem

Once everything is running fine, my disk (Maxtor One Touch) does not spin down, as the NSLU2 regularly accesses files from /dev and /var.

The solution

One solution is to move back /dev and /var to RAM.

Debianslug: The script works with debianslug so long as you uncomment the highlighted line (devpts needs to be remounted otherwise on login ssh can not start a shell giving a 'Server refused to allocate pty' error). The script only copies /dev and /var/log but you would do well to tweak /etc/syslog.conf and /etc/logrotate* to be as economical as possible.

The challenge

Creating a RAM resource, and attach /dev and /ram is easy (mount -t ramfs ramfs ... command). But, as the RAM memory is volatile, the challenge is to create a script that will copy all files from /dev and /var into the RAM resources you created, each time you boot the NSLU2. We must deal with two issues :

  • where is the correct location for my script?
  • what is the command to use to copy the unregular files from /dev ?

The procedure

  • cd /etc/init.d

(all init script should be located in this directory, regardless the run levels they are involved in. There should be a link to this script in the run-level-dedicated directory.)

  • Create the following mount_var_dev.sh script :
#!/bin/sh
# /etc/init.d/mount_var_dev.sh
# Script section to create ramdisk for /var and for /dev

# disable the oom-killer to use the full swap
/sbin/sysctl -w vm.overcommit_memory=1

# better only use /var/log then the full /var
/bin/echo "Creating ramfs for /var/log:"
/bin/mount -t ramfs ramfs /mnt -o maxsize=256
/bin/cp -rp /var/log/* /mnt/
/bin/mount -o bind /var/log /var/log.state
/bin/mount -o bind /mnt /var/log
/bin/umount /mnt

/bin/echo "Creating ramfs for /dev:"
/bin/mount -t ramfs ramfs /mnt -o maxsize=256
cd /dev
find . -print0 -mount | cpio -p -0 -d -m -u /mnt
# you can not use cp command for /dev
/bin/mount -o bind /dev /dev.state
/bin/mount -o bind /mnt /dev
/bin/umount /mnt

# Uncomment the following line when using debianslug
#mount devpts /dev/pts -t devpts

# Return and continue execution of system rc.
return 1
# [EOF]
  • chmod 0755 mount_var_dev.sh
  • cd /etc/rcS.d

(this directory contains all scripts for a generic 'Start' run-level, that is run before running level 3)

  • ln -s /etc/init.d/mount_var_dev.sh S37mount_var_dev.sh

(try to do that after activating swap!)

  • chmod 0755 S37mount_var_dev.sh

(all init scripts are supposed to be in /etc/init.d, and linked to the appropriate directory for the appropriate run-level).

  • edit /etc/syslog.conf and remove the /dev/xconsole entry (only used for X11 logging)
  • cd /etc
  • vi fstab

for all partition from the disk that must spin down, add ,noatime to the 4th column (there should be only default). (this will prevent to wake up the disk for cached read access, just to update the 'last access time' flag of the file)

Before

/dev/sda1       /       ext2    defaults        1  1
/dev/sda2       /home   ext2    defaults        1  2

After

/dev/sda1       /       ext2    defaults,noatime        1  1
/dev/sda2       /home   ext2    defaults,noatime        1  2
  • shutdown -r 0

(reboot)

It is done, you can check using the mount command that /dev and /var are now in RAM. Your disk will spindown with the timer you specified.

NOTE: This works fine on my Unslung6.8 slug (with the script in /opt/etc/init.d). Mount now returns:

[..]
/dev/sda1 on /share/flash/data type ext3 (rw,noatime)
/dev/sda2 on /share/flash/conf type ext3 (rw,sync,noatime)
/dev/sdb1 on /share/hdd/data/HDD_1_1_1 type ufsd (rw)
ramfs on /var/log type ramfs (rw)
ramfs on /dev type ramfs (rw)

Why can't I use sdparm to do spindown-magic?

I corresponded with the developer of sdparm (the SCSI version of hdparm) about using this tool to either set spin-down timers or stop/start disks, here's his explanation for why this can't be done currently.


However the major weakness is in the SCSI<->ATA protocol conversion code/silicon inside the external enclosure housing the IDE disk. If it is like the ones I have tested, it supports READ(10)/WRITE(10)/INQUIRY/ READ_CAPACITY SCSI commands only. The MODE_SENSE commands are dummied up by the USB mass storage driver (within linux kernel) so as to not upset the sd (scsi disk) driver.

Spinning down (or up) a disk requires the SCSI START_STOP_UNIT command to be supported. Even SCSI to ATA Translation (SAT) layer that linux does control (e.g. libata for SATA disks) has only recently added that command (a year after libata was released in the kernel). Convincing people that such commands are worthwhile is not an easy task!

So I encourage your persitence but fear the exercise will be futile. Hopefully in a year or so better SAT layers will surface.

an example of a working sdparm (NOT nslu2 btw) With a 2.6.11 Kernel (have not tried others) on a x86 (Via C3) it's possible to spin down a Samsung SV1640N? in an ICY Box "blue" using "sdparm-0.95"

 # sdparm --command=stop /dev/sdb
 /dev/sdb: SAMSUNG   SP1604N           TM10

And turn it on:

 # sdparm --command=start /dev/sdb
 /dev/sdb: SAMSUNG   SP1604N           TM10

hdparm or any disk acces can start it:

 # hdparm -t /dev/sdb
 /dev/sdb:
  Timing buffered disk reads:    2 MB in  5.76 seconds = 355.73 kB/sec

 # hdparm -t /dev/sdb
 /dev/sdb:
  Timing buffered disk reads:   72 MB in  3.06 seconds =  23.56 MB/sec

Wasn't actually tried on NSLU2 (other kernel, no enivronment etc.). But maybe it will work there too? At least with that case that disk and that USB driver it seems to be possible to spin down an USB Drive!

[Zhyla] This didn't work on my "Genesys" USB adapter on my FC3 box (2.6.9 kernel, sdparm-0.95 and 0.96beta).

Can you try running --command=stop and then --command=ready? It should indicate that it isn't ready (i.e. it's spun down).

[rz] Nice idea, but sorry: --command=ready always shows "ready" regardless if the disk is really spun down/sleeping or not.


[rz] Have tried several cases with Linux version 2.6.11 with a Samsung SP1604?(169GB) and an old Maxtor 53073U6(8GB)

[rz]Supporting(!) "stop" (45 Euro Raid Sonic ICY Box 3.5 Combo (USB+FW)):

 P:  Vendor=067b ProdID?=3507 Rev= 0.01
 S:  Product=ATAPI-6 Bridge Controller
 S:  Manufacturer=Prolific Technology Inc.
 Chip: not visible, assuming(!) Profilic PL3507?

[mag] Another enclosure supporting stop is PPA ME-780U2-2162, which also uses a Prolific chipset.

[rz]Not supporting "stop" (15 Euro Evertech):

 P:  Vendor=04b4 ProdID?=6830 Rev= 2.40
 S:  Product=Cypress AT2LP?
 Chip: CY7C68300B?-56PVXC

[rz]Not supporting "stop" (60 Euro Delock? Combo)

 P:  Vendor=0402 ProdID?=5621 Rev= 1.03
 S:  Product=USB 2.0 Storage Device
 Chip: ALI M5621 + Oxford FW

[rz]Not supporting "stop" via USB but "inside" (55Euro atechweb LAN Server HD9?-U2lA?)

 P:  Vendor=05e3 ProdID?=0702 Rev= 0.33
 S:  Product=USB TO IDE
 Chip: GL811E? (FTR: CPU: RDC R2882)

[rz]As the prolific chip set used by radsonic do spin down the disk (really) that can't be a problem with linux, at least not with linux 2.6.11.


[rz]What chip set is used in which Raidsonic case:

IB-550UE Prolific (PL3507?) - Agere (FW8028?) since 02/2005
IB-350/351/360UE Prolific (PL3507?) - Agere (FW8028?)
IB-350/351US Prolific (PL2507?) - Silicon Image (Sil36CT80?)
IB-350/351/360U Cypress (7C68300A)
IB-250/251U Cypress (7C68300A)
IB-355U Ali (M5621A1?)
IB-525U Ali (M5621A1?)
IB-550U Ali (M5621A1?)
IB-350StS without any

http://www.raidsonic.de/de/pages/service/faq.php (It's only in the german FAQ)


IB-351UE - Agere Chip

      Seagate ST3?? 7200.7 (does not accept the KEEP_OVER_RESET-flag: hdparm -K ...)
      sdparm 0.94
      Kernel 2.6.13 (on desktop, not slug) spins down with sdparm --command=stop /dev/sda
      Seagate has a tool called SeaTool?? (like IBM/Hitachi's Featuretool), but it does not
      have any features to set powermanagement or spin down timers.

Why does my disk not spin down?

Why does it spin up after only five minutes?

Which process is accessing the disk?

To answer this sort of question, see HowtoIdentifyWhichProcessesAccessDisk

December 12, 2006, at 12:28 AM by wholesale handbags --
Changed lines 1-471 from:

Contents

Motivation

Not everyone wants a 24/7 running harddisk. A noisy harddisk right beside is awful and the lifespan of a permanently running HD is shorter, too.

Quick Summary

For various technical reasons it is not generally possible to adjust the standby timer of an IDE disk connected through a USB adapter (including turnkey external USB drives). See the sdparm page and the section below on sdparm for the technical reasons.

1. Method: So one method available is to temporarily connect the drive via its IDE connector directly to a big Linux box and run hdparm to set the timer (the -S option is what you're looking for, PLEASE read the hdparm man page before even thinking about running it)[OS independent]. You need an enclosure with separate power and IDE connectors to do this.

Advantage: Can be used on every HD which supports standby regardless of the OS.

Disadvantage: Every time you turn off your HD or there is a power loss you have to repeat the procedure if your drive doesnt support he KEEP_OVER_RESET-flag.

A very similiar method is using a vendor-specific tool (like IBM Feature Tool) to setup the spin-down time before installing the drive into its enclosure.

2. Method: This is a sub-variant of the 1.Method. Simply buy a HD/enlcosure combo which supports down-spinning by itself (e.g. Maxtor OneTouch series, WD Essential Drives)[OS independent]. A simple but probably more expensive method (and i've heard Maxtor OneTouch HDs? are rather noisy, too ;).

3. Method: Another method is to use scsi-idle. However, this requires a kernel patch as the corresponding kernel changes are not yet included in the nslu2-linux binaries. See the scsi-idle section below [applies to Openslug, Unslung].

All methods most often require modifications concerning the syslog- and other daemons because of their behaviour of writing time-marks into their log-files (especially syslog), as this will cause your HD to spin up at certain intervalls.

As of now (June 2006) SDPARM will most certainly NOT WORK on non-combo(FW+USB) drives. Tell us if you found further working drives.

[mag: I own a usb-only enclosure that spins down fine with sdparm. I think it's more of a question of the controller it uses rather than combo vs. non-combo.]

For further details check below.

1. Method: How do I spin down my USB hard disks?

Any drive can have a spindown timeout, provided:

  • The disk can take 'hdparm -S120 /dev/hdx' and spindown after 10 minutes.
  • It is possible to have the drive using the power from the usb-ide adapter while plugged into the normal ide of your pc.

Prerequisites:

- Harddisk with separate IDE and power connectors.

eg. IcyBox? black [http://www.raidsonic.de/de/pages/products/external_cases.php?we_objectID=3206] [ST: this works fine for me].

- Another Linux machine to connect it to with hdparm installed.

1) Take your HD and install it the enclosure (especially the power connector to the drive).

2) Turn on your enclosure.

2) Disconnect the enclosure's IDE connector (if connected) and connect the other Linux machine's IDE connector to the HD.

3) Set the spindown-time 'hdparm -k1 -K1 -S120 /dev/hda' where -Sxx specifies the spindown-time. -k1-K1 set the keep over reset-flags if supported.

4) Disconnect the Linux machine's IDE connector

5) Connect the enclosures IDE connector to the HD !WITHOUT REMOVING THE POWER from the HD!

This way the drive is never reset, and will keep its spindown setting. Of course if hdparm -k1 -K1 -S120 actually makes your drives remember their settings this is irrelevant, but for anyone like me whose drives wont remember their settings this is a way to make them spindown.

For those with enclosures that wont let them do this, I use this. The usb-ide and power supply are completely separate, which make this easy.

[ST: Bought an enclosure with internal SATA interface and external SATA/USB interface IcyBox IB-360StUS-B and installed a Samsung 250GB SATA II (SP2504C?) into it. Connected it via SATA (MB to external slot-connector is included) to my big machine and ran hdparm. Voila, the disk spins down.]

Sub-method: You can download the Power Booster utility for 2.5" IBM/Hitachi TravelStar disks. The Power Booster utility will enable the auto spin down feature of the disk. For 3.5" IBM/Hitachi drives (and maybe others), you can download the Feature Tool. Otherwise temporarily install the IDE disk in your ordinary Linux box, read the disk technical documentation and use hdparm to adjust the settings by hand. The trick is to enable APM within the drive itself, so Linux doesn't have to care about it at all. You can't use hdparm to alter the APM settings from the NSLU2 as the USB->IDE adapters are emulated as SCSI host adapters in the Linux kernel which is incompatible with the necessary hdparm options.

[Request by ingeba]: To my knowledge this does not work. Can anyone verify that APM settings may cause NSLU2 connected drives in arbitrary enclosures to spin down? If so, please list drive and enclosure brand and here:

[slavikb] This worked for me (Hitachi 7K250, noname box, Feature Tool). I had to remount root with -noatime option. The drive goes into Low RPM mode after 10 minutes of inactivity.

Either way, you'll have to open your 2.5" USB enclosure and install the disk drive temporarily to a desktop computer using a 2.5" to 3.5" IDE adapter. After that, you can do the APM adjustment in Windows or Linux.

2.Method: Enclosures with integrated spin-down

For Maxtor OneTouch drives see the Maxtor OneTouch HOWTO.

I just bought a Seagate Baracuda 3.5" drive and installed it in a third party enclosure. Upon contacting their tech support in Europe they stated that:

  • Seagate does not support other power management than managed by the running OS
  • Seagate does not support drives to be installed in third party enclosures
  • Seagate disks do not have a function to retain the power management settings

So I guess my advice would be not to buy the Seagate disks.

By Miro Dietiker As i see, some disks of higher price (and quality?) power down out-of-the-box with a meaningful value configured. If you have a USB disk which does this, extend this list please.

  • 13.03.2006: WesternDigital? Essential - 320 GB USB 2.0 / 3.5" / 7200 rpm (All WD Essential drives seem to implement this feature)
  • 24.03.2003 Maxtor One Touch - 200 Go USB 2.0 / 3.5 " / 7200 rpm
  • 11.05.2006: Seagate 250GB USB 2.0 / 3.5" / 7200 RPM

Note:* 24.04.2006 I have a WesternDigital? Essential - 250 GB USB 2.0 / 3.5" / 7200 rpm and although it supports spindown by hardware and does so on my laptop, it wont do so on my slug. Even if completly umounted. + Openslug does not find this disk. EDIT: I now have spindown on this disk. Strangly it works with debian. I mounted my /var and /tmp on a usb-stick.

  • I do also have a Western Digital MyBook? Essential 500GB I bought with my NSLU2 in Nov 2006. And it does not spin down on the NSLU2. I also reverted to the original Linksys firmware but it still does not spin down. There is also another strange problem - from time to time the NSLU2 just does not boot up - only the ethernet light is on and the slug freezes - I have to unplug the power connector. Then it boots up normaly again - very strange. - Anguel Stankov

3. Method: How to use scsi-idle for spinning down USB disks.

Robert Demski provided a kernel patch as well as a package for the scsi-idle software to be used on the slug.

The build process is quite complicated as it requires setting up a cross-compile environment for the slug currently, until the kernel patch is included in the binary distributions of OpenSlug. The process is described in a blog post on fredericiana.com. Any comments appreciated.

How to use scsi-idle without kernel patch

By Ruud Senden

I've managed to automate spindown using scsi-idle without the kernel patch. I've created the perl script listed below based on a script I found at http://www.rootfs.net/jaws/index.php?gadget=Blog&action=SingleView&id=22:

#!/usr/bin/perl -w

$statfile = "/proc/diskstats";
die "$0: Cannot read $statfile\n" unless -r $statfile;

$| = 1;
($disk, $interval) = (@ARGV);
$disk =~ s,/dev/,,;
print "$0: disk: $disk, interval: $interval\n";

$halted_data = $last_seen = '';
while (1) {
  open(STATUS, $statfile);
  ($_) = grep(/^\s+\d+\s+\d+\s+$disk\s/o, <STATUS>);
  close STATUS;

  if ($last_seen eq $_ && $halted_data ne $_) {
    print "Spinning down: $disk\n";
    system "scsi-stop", "/dev/$disk";
    $halted_data = $_;
  }
  $last_seen = $_;
  sleep $interval;
}

Basically what this script does is take a device as the first argument, and an interval in seconds as the second argument. Every interval seconds it will look at /proc/diskstats for the given device, and if the status didn't change the disk will be spun down. The disk will automatically spin up again when accessed (on my system at least).

Installation instructions:

  1. Install perl
  2. Install the scsi-idle package, which can be downloaded from the Yahoo Files section
  3. Save the perl script listed above to your filesystem, for example named autospindown. Make sure the script is executable: chmod +rx autospindown
  4. Edit /etc/default/scsi-idle to list the timeouts for your drive(s), see the instructions in that file for more information.
  5. Edit /etc/init.d/scsi-idle, changing the DAEMON variable to point to the perl script you saved in step 3.
  6. /etc/init.d/scsi-idle start

I've tested this on my NSLU2 with OpenSlug 2.7 installed, I think a similar approach should work on Unslung as well. Any comments appreciated.

Note - the file "/proc/diskstats" does not exist on Unslung 5.5, so this technique won't work directly on Unslung boxes.

  • note 11th Sept 2006

Installing scsi-idle_2.4.23-r1_armeb.ipk onto unslung 6.8 fails as : ERROR: Cannot satisfy the following dependencies for scsi-idle:

         libgcc1 (>= 3.4.4) libc6 (>= 2.3.5+cvs20050627) **

Shell-only scsi-idle without kernel patch

By Chris

Using Ruud's idea, except implemented as a shell script so you don't need Perl (which is great, but takes a lot of space if you're running from flash only). This seems to work fine with the vanilla OpenSlug firmware, a ByteCC 2.5" external enclosure, and a Seagate 40GB 2.5" drive.

This version updates the status more often than the Perl version which prevents waiting almost a complete extra interval cycle under certain circumstances. Feel free to hack this script and make it better as I didn't spend much time on it.

Stripwax adds: The scsi-idle package and the perl script above follow the convention that the drive to idle is e.g. "dev/sda" whereas the below seems to want to expect just e.g. "sda". In my opinion you will need to change the line "disk=$1" below to something like "disk=${1#/dev/}" or similar

#!/bin/sh

disk=$1
interval=$2

state=`grep "\s$disk\s" /proc/diskstats`
count=$interval
up=1

while [ true ]; do
   sleep 10
   count=$(($count-10))
   newstate=`grep "\s$disk\s" /proc/diskstats`
   if [ "$state" = "$newstate" ]; then
      if [ $count -lt 0 ]; then
         count=$interval
         if [ $up = 1 ]; then
            #echo -e "spin-down\t" `date`
            sync
            state=`grep "\s$disk\s" /proc/diskstats`
            scsi-stop /dev/$disk
            up=0
         fi
      fi
   else
      #echo -e "drive is up\t" `date`
      count=$interval
      state="$newstate"
      up=1
   fi
done

4.Method: Use sg_start to spindown usb disk

for OpenDebianSlug? 3.10 2.16 kernel:

  install sg3 scsi tools: apt-get install sg3-utils
  powerdown hdd: /usr/bin/sg_start 0 -pc=3 /dev/sda
  use shell or perl script for automatic powerdown

System modifications for HD spin-down OR

How to make your standalone USB disk really spindown

[by JNC]

OK, you could tell me : what is this update? I have read much in the MaxtorOneTouch-Howto about the procedure to move /dev and /var back to RAM, so, why another section ?

That's definitively true. Many thanks to those who contributed to write those pages. I just found 2 problems with what I read :

  • it was for Unslung version only (not Openslug) [Unslung version]
  • the process was incomplete (only for /var) and impossible to extend to /dev

As I don't like to complain without acting, here is my contribution from my experience. I hope it can be useful to anybody.

Preamble

The problem

Once everything is running fine, my disk (Maxtor One Touch) does not spin down, as the NSLU2 regularly accesses files from /dev and /var.

The solution

One solution is to move back /dev and /var to RAM.

Debianslug: The script works with debianslug so long as you uncomment the highlighted line (devpts needs to be remounted otherwise on login ssh can not start a shell giving a 'Server refused to allocate pty' error). The script only copies /dev and /var/log but you would do well to tweak /etc/syslog.conf and /etc/logrotate* to be as economical as possible.

The challenge

Creating a RAM resource, and attach /dev and /ram is easy (mount -t ramfs ramfs ... command). But, as the RAM memory is volatile, the challenge is to create a script that will copy all files from /dev and /var into the RAM resources you created, each time you boot the NSLU2. We must deal with two issues :

  • where is the correct location for my script?
  • what is the command to use to copy the unregular files from /dev ?

The procedure

  • cd /etc/init.d

(all init script should be located in this directory, regardless the run levels they are involved in. There should be a link to this script in the run-level-dedicated directory.)

  • Create the following mount_var_dev.sh script :
#!/bin/sh
# /etc/init.d/mount_var_dev.sh
# Script section to create ramdisk for /var and for /dev

# disable the oom-killer to use the full swap
/sbin/sysctl -w vm.overcommit_memory=1

# better only use /var/log then the full /var
/bin/echo "Creating ramfs for /var/log:"
/bin/mount -t ramfs ramfs /mnt -o maxsize=256
/bin/cp -rp /var/log/* /mnt/
/bin/mount -o bind /var/log /var/log.state
/bin/mount -o bind /mnt /var/log
/bin/umount /mnt

/bin/echo "Creating ramfs for /dev:"
/bin/mount -t ramfs ramfs /mnt -o maxsize=256
cd /dev
find . -print0 -mount | cpio -p -0 -d -m -u /mnt
# you can not use cp command for /dev
/bin/mount -o bind /dev /dev.state
/bin/mount -o bind /mnt /dev
/bin/umount /mnt

# Uncomment the following line when using debianslug
#mount devpts /dev/pts -t devpts

# Return and continue execution of system rc.
return 1
# [EOF]
  • chmod 0755 mount_var_dev.sh
  • cd /etc/rcS.d

(this directory contains all scripts for a generic 'Start' run-level, that is run before running level 3)

  • ln -s /etc/init.d/mount_var_dev.sh S37mount_var_dev.sh

(try to do that after activating swap!)

  • chmod 0755 S37mount_var_dev.sh

(all init scripts are supposed to be in /etc/init.d, and linked to the appropriate directory for the appropriate run-level).

  • edit /etc/syslog.conf and remove the /dev/xconsole entry (only used for X11 logging)
  • cd /etc
  • vi fstab

for all partition from the disk that must spin down, add ,noatime to the 4th column (there should be only default). (this will prevent to wake up the disk for cached read access, just to update the 'last access time' flag of the file)

Before

/dev/sda1       /       ext2    defaults        1  1
/dev/sda2       /home   ext2    defaults        1  2

After

/dev/sda1       /       ext2    defaults,noatime        1  1
/dev/sda2       /home   ext2    defaults,noatime        1  2
  • shutdown -r 0

(reboot)

It is done, you can check using the mount command that /dev and /var are now in RAM. Your disk will spindown with the timer you specified.

NOTE: This works fine on my Unslung6.8 slug (with the script in /opt/etc/init.d). Mount now returns:

[..]
/dev/sda1 on /share/flash/data type ext3 (rw,noatime)
/dev/sda2 on /share/flash/conf type ext3 (rw,sync,noatime)
/dev/sdb1 on /share/hdd/data/HDD_1_1_1 type ufsd (rw)
ramfs on /var/log type ramfs (rw)
ramfs on /dev type ramfs (rw)

Why can't I use sdparm to do spindown-magic?

I corresponded with the developer of sdparm (the SCSI version of hdparm) about using this tool to either set spin-down timers or stop/start disks, here's his explanation for why this can't be done currently.


However the major weakness is in the SCSI<->ATA protocol conversion code/silicon inside the external enclosure housing the IDE disk. If it is like the ones I have tested, it supports READ(10)/WRITE(10)/INQUIRY/ READ_CAPACITY SCSI commands only. The MODE_SENSE commands are dummied up by the USB mass storage driver (within linux kernel) so as to not upset the sd (scsi disk) driver.

Spinning down (or up) a disk requires the SCSI START_STOP_UNIT command to be supported. Even SCSI to ATA Translation (SAT) layer that linux does control (e.g. libata for SATA disks) has only recently added that command (a year after libata was released in the kernel). Convincing people that such commands are worthwhile is not an easy task!

So I encourage your persitence but fear the exercise will be futile. Hopefully in a year or so better SAT layers will surface.

an example of a working sdparm (NOT nslu2 btw) With a 2.6.11 Kernel (have not tried others) on a x86 (Via C3) it's possible to spin down a Samsung SV1640N? in an ICY Box "blue" using "sdparm-0.95"

 # sdparm --command=stop /dev/sdb
 /dev/sdb: SAMSUNG   SP1604N           TM10

And turn it on:

 # sdparm --command=start /dev/sdb
 /dev/sdb: SAMSUNG   SP1604N           TM10

hdparm or any disk acces can start it:

 # hdparm -t /dev/sdb
 /dev/sdb:
  Timing buffered disk reads:    2 MB in  5.76 seconds = 355.73 kB/sec

 # hdparm -t /dev/sdb
 /dev/sdb:
  Timing buffered disk reads:   72 MB in  3.06 seconds =  23.56 MB/sec

Wasn't actually tried on NSLU2 (other kernel, no enivronment etc.). But maybe it will work there too? At least with that case that disk and that USB driver it seems to be possible to spin down an USB Drive!

[Zhyla] This didn't work on my "Genesys" USB adapter on my FC3 box (2.6.9 kernel, sdparm-0.95 and 0.96beta).

Can you try running --command=stop and then --command=ready? It should indicate that it isn't ready (i.e. it's spun down).

[rz] Nice idea, but sorry: --command=ready always shows "ready" regardless if the disk is really spun down/sleeping or not.


[rz] Have tried several cases with Linux version 2.6.11 with a Samsung SP1604?(169GB) and an old Maxtor 53073U6(8GB)

[rz]Supporting(!) "stop" (45 Euro Raid Sonic ICY Box 3.5 Combo (USB+FW)):

 P:  Vendor=067b ProdID?=3507 Rev= 0.01
 S:  Product=ATAPI-6 Bridge Controller
 S:  Manufacturer=Prolific Technology Inc.
 Chip: not visible, assuming(!) Profilic PL3507?

[mag] Another enclosure supporting stop is PPA ME-780U2-2162, which also uses a Prolific chipset.

[rz]Not supporting "stop" (15 Euro Evertech):

 P:  Vendor=04b4 ProdID?=6830 Rev= 2.40
 S:  Product=Cypress AT2LP?
 Chip: CY7C68300B?-56PVXC

[rz]Not supporting "stop" (60 Euro Delock? Combo)

 P:  Vendor=0402 ProdID?=5621 Rev= 1.03
 S:  Product=USB 2.0 Storage Device
 Chip: ALI M5621 + Oxford FW

[rz]Not supporting "stop" via USB but "inside" (55Euro atechweb LAN Server HD9?-U2lA?)

 P:  Vendor=05e3 ProdID?=0702 Rev= 0.33
 S:  Product=USB TO IDE
 Chip: GL811E? (FTR: CPU: RDC R2882)

[rz]As the prolific chip set used by radsonic do spin down the disk (really) that can't be a problem with linux, at least not with linux 2.6.11.


[rz]What chip set is used in which Raidsonic case:

IB-550UE Prolific (PL3507?) - Agere (FW8028?) since 02/2005
IB-350/351/360UE Prolific (PL3507?) - Agere (FW8028?)
IB-350/351US Prolific (PL2507?) - Silicon Image (Sil36CT80?)
IB-350/351/360U Cypress (7C68300A)
IB-250/251U Cypress (7C68300A)
IB-355U Ali (M5621A1?)
IB-525U Ali (M5621A1?)
IB-550U Ali (M5621A1?)
IB-350StS without any

http://www.raidsonic.de/de/pages/service/faq.php (It's only in the german FAQ)


IB-351UE - Agere Chip

      Seagate ST3?? 7200.7 (does not accept the KEEP_OVER_RESET-flag: hdparm -K ...)
      sdparm 0.94
      Kernel 2.6.13 (on desktop, not slug) spins down with sdparm --command=stop /dev/sda
      Seagate has a tool called SeaTool?? (like IBM/Hitachi's Featuretool), but it does not
      have any features to set powermanagement or spin down timers.

Why does my disk not spin down?

Why does it spin up after only five minutes?

Which process is accessing the disk?

To answer this sort of question, see HowtoIdentifyWhichProcessesAccessDisk

to:

http://myblog.es/whobag <a href="http://myblog.es/whobag">wholesale handbags</a> wholesale handbags

December 10, 2006, at 03:50 PM by argh -- corretcion
Changed lines 107-108 from:

I have a WesternDigital? Essential - 250 GB USB 2.0 / 3.5" / 7200 rpm and although it supports spindown by hardware and does so on my laptop, it wont do so on my slug. Even if completly umounted. + Openslug does not find this disk.

to:

I have a WesternDigital? Essential - 250 GB USB 2.0 / 3.5" / 7200 rpm and although it supports spindown by hardware and does so on my laptop, it wont do so on my slug. Even if completly umounted. + Openslug does not find this disk. EDIT: I now have spindown on this disk. Strangly it works with debian. I mounted my /var and /tmp on a usb-stick.

December 09, 2006, at 04:44 PM by Xavier -- Restored
Changed lines 1-470 from:

http://2site.com/fqtbdy <a href="http://2site.com/fqtbdy">free ringtones</a> free ringtones

to:

Contents

Motivation

Not everyone wants a 24/7 running harddisk. A noisy harddisk right beside is awful and the lifespan of a permanently running HD is shorter, too.

Quick Summary

For various technical reasons it is not generally possible to adjust the standby timer of an IDE disk connected through a USB adapter (including turnkey external USB drives). See the sdparm page and the section below on sdparm for the technical reasons.

1. Method: So one method available is to temporarily connect the drive via its IDE connector directly to a big Linux box and run hdparm to set the timer (the -S option is what you're looking for, PLEASE read the hdparm man page before even thinking about running it)[OS independent]. You need an enclosure with separate power and IDE connectors to do this.

Advantage: Can be used on every HD which supports standby regardless of the OS.

Disadvantage: Every time you turn off your HD or there is a power loss you have to repeat the procedure if your drive doesnt support he KEEP_OVER_RESET-flag.

A very similiar method is using a vendor-specific tool (like IBM Feature Tool) to setup the spin-down time before installing the drive into its enclosure.

2. Method: This is a sub-variant of the 1.Method. Simply buy a HD/enlcosure combo which supports down-spinning by itself (e.g. Maxtor OneTouch series, WD Essential Drives)[OS independent]. A simple but probably more expensive method (and i've heard Maxtor OneTouch HDs? are rather noisy, too ;).

3. Method: Another method is to use scsi-idle. However, this requires a kernel patch as the corresponding kernel changes are not yet included in the nslu2-linux binaries. See the scsi-idle section below [applies to Openslug, Unslung].

All methods most often require modifications concerning the syslog- and other daemons because of their behaviour of writing time-marks into their log-files (especially syslog), as this will cause your HD to spin up at certain intervalls.

As of now (June 2006) SDPARM will most certainly NOT WORK on non-combo(FW+USB) drives. Tell us if you found further working drives.

[mag: I own a usb-only enclosure that spins down fine with sdparm. I think it's more of a question of the controller it uses rather than combo vs. non-combo.]

For further details check below.

1. Method: How do I spin down my USB hard disks?

Any drive can have a spindown timeout, provided:

  • The disk can take 'hdparm -S120 /dev/hdx' and spindown after 10 minutes.
  • It is possible to have the drive using the power from the usb-ide adapter while plugged into the normal ide of your pc.

Prerequisites:

- Harddisk with separate IDE and power connectors.

eg. IcyBox? black [http://www.raidsonic.de/de/pages/products/external_cases.php?we_objectID=3206] [ST: this works fine for me].

- Another Linux machine to connect it to with hdparm installed.

1) Take your HD and install it the enclosure (especially the power connector to the drive).

2) Turn on your enclosure.

2) Disconnect the enclosure's IDE connector (if connected) and connect the other Linux machine's IDE connector to the HD.

3) Set the spindown-time 'hdparm -k1 -K1 -S120 /dev/hda' where -Sxx specifies the spindown-time. -k1-K1 set the keep over reset-flags if supported.

4) Disconnect the Linux machine's IDE connector

5) Connect the enclosures IDE connector to the HD !WITHOUT REMOVING THE POWER from the HD!

This way the drive is never reset, and will keep its spindown setting. Of course if hdparm -k1 -K1 -S120 actually makes your drives remember their settings this is irrelevant, but for anyone like me whose drives wont remember their settings this is a way to make them spindown.

For those with enclosures that wont let them do this, I use this. The usb-ide and power supply are completely separate, which make this easy.

[ST: Bought an enclosure with internal SATA interface and external SATA/USB interface IcyBox IB-360StUS-B and installed a Samsung 250GB SATA II (SP2504C?) into it. Connected it via SATA (MB to external slot-connector is included) to my big machine and ran hdparm. Voila, the disk spins down.]

Sub-method: You can download the Power Booster utility for 2.5" IBM/Hitachi TravelStar disks. The Power Booster utility will enable the auto spin down feature of the disk. For 3.5" IBM/Hitachi drives (and maybe others), you can download the Feature Tool. Otherwise temporarily install the IDE disk in your ordinary Linux box, read the disk technical documentation and use hdparm to adjust the settings by hand. The trick is to enable APM within the drive itself, so Linux doesn't have to care about it at all. You can't use hdparm to alter the APM settings from the NSLU2 as the USB->IDE adapters are emulated as SCSI host adapters in the Linux kernel which is incompatible with the necessary hdparm options.

[Request by ingeba]: To my knowledge this does not work. Can anyone verify that APM settings may cause NSLU2 connected drives in arbitrary enclosures to spin down? If so, please list drive and enclosure brand and here:

[slavikb] This worked for me (Hitachi 7K250, noname box, Feature Tool). I had to remount root with -noatime option. The drive goes into Low RPM mode after 10 minutes of inactivity.

Either way, you'll have to open your 2.5" USB enclosure and install the disk drive temporarily to a desktop computer using a 2.5" to 3.5" IDE adapter. After that, you can do the APM adjustment in Windows or Linux.

2.Method: Enclosures with integrated spin-down

For Maxtor OneTouch drives see the Maxtor OneTouch HOWTO.

I just bought a Seagate Baracuda 3.5" drive and installed it in a third party enclosure. Upon contacting their tech support in Europe they stated that:

  • Seagate does not support other power management than managed by the running OS
  • Seagate does not support drives to be installed in third party enclosures
  • Seagate disks do not have a function to retain the power management settings

So I guess my advice would be not to buy the Seagate disks.

By Miro Dietiker As i see, some disks of higher price (and quality?) power down out-of-the-box with a meaningful value configured. If you have a USB disk which does this, extend this list please.

  • 13.03.2006: WesternDigital? Essential - 320 GB USB 2.0 / 3.5" / 7200 rpm (All WD Essential drives seem to implement this feature)
  • 24.03.2003 Maxtor One Touch - 200 Go USB 2.0 / 3.5 " / 7200 rpm
  • 11.05.2006: Seagate 250GB USB 2.0 / 3.5" / 7200 RPM

Note:* 24.04.2006 I have a WesternDigital? Essential - 250 GB USB 2.0 / 3.5" / 7200 rpm and although it supports spindown by hardware and does so on my laptop, it wont do so on my slug. Even if completly umounted. + Openslug does not find this disk.

  • I do also have a Western Digital MyBook? Essential 500GB I bought with my NSLU2 in Nov 2006. And it does not spin down on the NSLU2. I also reverted to the original Linksys firmware but it still does not spin down. There is also another strange problem - from time to time the NSLU2 just does not boot up - only the ethernet light is on and the slug freezes - I have to unplug the power connector. Then it boots up normaly again - very strange. - Anguel Stankov

3. Method: How to use scsi-idle for spinning down USB disks.

Robert Demski provided a kernel patch as well as a package for the scsi-idle software to be used on the slug.

The build process is quite complicated as it requires setting up a cross-compile environment for the slug currently, until the kernel patch is included in the binary distributions of OpenSlug. The process is described in a blog post on fredericiana.com. Any comments appreciated.

How to use scsi-idle without kernel patch

By Ruud Senden

I've managed to automate spindown using scsi-idle without the kernel patch. I've created the perl script listed below based on a script I found at http://www.rootfs.net/jaws/index.php?gadget=Blog&action=SingleView&id=22:

#!/usr/bin/perl -w

$statfile = "/proc/diskstats";
die "$0: Cannot read $statfile\n" unless -r $statfile;

$| = 1;
($disk, $interval) = (@ARGV);
$disk =~ s,/dev/,,;
print "$0: disk: $disk, interval: $interval\n";

$halted_data = $last_seen = '';
while (1) {
  open(STATUS, $statfile);
  ($_) = grep(/^\s+\d+\s+\d+\s+$disk\s/o, <STATUS>);
  close STATUS;

  if ($last_seen eq $_ && $halted_data ne $_) {
    print "Spinning down: $disk\n";
    system "scsi-stop", "/dev/$disk";
    $halted_data = $_;
  }
  $last_seen = $_;
  sleep $interval;
}

Basically what this script does is take a device as the first argument, and an interval in seconds as the second argument. Every interval seconds it will look at /proc/diskstats for the given device, and if the status didn't change the disk will be spun down. The disk will automatically spin up again when accessed (on my system at least).

Installation instructions:

  1. Install perl
  2. Install the scsi-idle package, which can be downloaded from the Yahoo Files section
  3. Save the perl script listed above to your filesystem, for example named autospindown. Make sure the script is executable: chmod +rx autospindown
  4. Edit /etc/default/scsi-idle to list the timeouts for your drive(s), see the instructions in that file for more information.
  5. Edit /etc/init.d/scsi-idle, changing the DAEMON variable to point to the perl script you saved in step 3.
  6. /etc/init.d/scsi-idle start

I've tested this on my NSLU2 with OpenSlug 2.7 installed, I think a similar approach should work on Unslung as well. Any comments appreciated.

Note - the file "/proc/diskstats" does not exist on Unslung 5.5, so this technique won't work directly on Unslung boxes.

  • note 11th Sept 2006

Installing scsi-idle_2.4.23-r1_armeb.ipk onto unslung 6.8 fails as : ERROR: Cannot satisfy the following dependencies for scsi-idle:

         libgcc1 (>= 3.4.4) libc6 (>= 2.3.5+cvs20050627) **

Shell-only scsi-idle without kernel patch

By Chris

Using Ruud's idea, except implemented as a shell script so you don't need Perl (which is great, but takes a lot of space if you're running from flash only). This seems to work fine with the vanilla OpenSlug firmware, a ByteCC 2.5" external enclosure, and a Seagate 40GB 2.5" drive.

This version updates the status more often than the Perl version which prevents waiting almost a complete extra interval cycle under certain circumstances. Feel free to hack this script and make it better as I didn't spend much time on it.

Stripwax adds: The scsi-idle package and the perl script above follow the convention that the drive to idle is e.g. "dev/sda" whereas the below seems to want to expect just e.g. "sda". In my opinion you will need to change the line "disk=$1" below to something like "disk=${1#/dev/}" or similar

#!/bin/sh

disk=$1
interval=$2

state=`grep "\s$disk\s" /proc/diskstats`
count=$interval
up=1

while [ true ]; do
   sleep 10
   count=$(($count-10))
   newstate=`grep "\s$disk\s" /proc/diskstats`
   if [ "$state" = "$newstate" ]; then
      if [ $count -lt 0 ]; then
         count=$interval
         if [ $up = 1 ]; then
            #echo -e "spin-down\t" `date`
            sync
            state=`grep "\s$disk\s" /proc/diskstats`
            scsi-stop /dev/$disk
            up=0
         fi
      fi
   else
      #echo -e "drive is up\t" `date`
      count=$interval
      state="$newstate"
      up=1
   fi
done

4.Method: Use sg_start to spindown usb disk

for OpenDebianSlug