NSLU2-Linux
view · edit · print · history

The Problem

In late march I bought a Seagate FreeAgent Desktop 320gb External Hard Drive, this one comes on a slick enclosure that no one would throw away because of uglyness. Everything worked fine, until I left it unattended for a while. What happened then, is that I received a lot of erros, most of them regarding to I/O. Ive posted to the mailing list on April 15th, http://www.mail-archive.com/debian-arm@lists.debian.org/msg06448.html.

After a while, Ive discovered the real problem, the drive has an auto spindown in 15 minutes that cannot be configured. As you leave it unattended it spins down. When you try to reade or write something to the disk, you receive a I/O error, because the filesystem timeouts before the drive starts. When you got i/o errors, the partition is remounted read-only, it can be very bad if you are on you root partition.

The Solution

This solution also works for Maxtor OneTouch4? drives.

This was solved with a little search on Google, according to this message http://www.mail-archive.com/linux-usb-devel@lists.sourceforge.net/msg52993.html you just need to configure a kernel parameter to allow the drive to be restarted. The message talks about the following command:

 echo 1 >/sys/block/sda/device/allow_restart

It turns out that in my system (and probably yours) is in a different place, wich is:

 echo 1 >/sys/class/scsi_disk/0:0:0:0/allow_restart

In my case the drive is connected to port 1 on nslu2 and is the root partition. This parameter must be set after every reboot (or drive reconnect); this init script works for me (note that locating the file to write to using the wildcard won't work with /bin/sh, which is why bash is used):

 #!/bin/bash
 echo 1 > /sys/block/sda/device/scsi_disk*/allow_restart

Note: the allow_restart parameter is apparently only supported for all hard drives in kernel versions at least 2.6.21. The latest SlugOS kernel (from binary install) is 2.6.16 and as such cannot easily be used with this hard drive at this time.

[ehymel] Note: this fix works for me using kernel version 2.6.18 (uname -r gives 2.6.18-5-ixp4xx).

[llloret] Works for me too with kernel 2.6.18-6-ixp4xx, with a Freeagent 500 Mb.

[chrism] Works for me using Debian Etch 4.0. Thanks!

udev Method

Add a rule to the end of /etc/udev/rules.d/local.rules

# Seagate FreeAgent allow_restart fix (i/o errors)
SUBSYSTEMS=="scsi",DRIVERS=="sd",ATTRS{vendor}=="Seagate*",ATTRS{model}=="FreeAgent*",
RUN+="/bin/sh -c 'echo 1 > /sys/class/scsi_disk/%k/allow_restart'"

[Tom] If you are using a Maxtor OneTouch, substitute "Seagate*" and "FreeAgent?*" above with "Maxtor*" and "OneTouch*"

[chaw] The above udev rule works very well in a Debian Etch 4.0 setup.

[Steve] The 2 lines above starting with SUBSYSTEMS should all be on 1 line. Put a hard return on it so it would print.

Related Information

   * http://www.mail-archive.com/debian-arm@lists.debian.org/msg06448.html
   * http://www.mail-archive.com/linux-usb-devel@lists.sourceforge.net/msg52952.html
   * http://www.mail-archive.com/linux-usb-devel@lists.sourceforge.net/msg52993.html

Other Solution

   * http://alienghic.livejournal.com/382903.html

To resume the above URL use:

 /usr/bin/sdparm --clear STANDBY -6 /dev/sd[YOUR_DEVICE] 

(eg: /usr/bin/sdparm --clear STANDBY -6 /dev/sda)

You can put this command in your /etc/init.d/rc.local if needed.

If sdparm is not installed on your Debian, as root, do:

 apt-get update
 apt-get install sdparm

If the drive is already spun down you will get an error

 change_mode_page: failed setting page: Power condition

when issuing the above command. You will need to run

 /usr/bin/sdparm --command=start /dev/sd[YOUR_DEVICE]

after which the command can be run.

Fixed in linux kernel 2.6.24-rc4?

It seems that a fix for this annoying behaviour is entering the linux kernel 2.6.24-rc4, correct me if I'm wrong: http://tree.celinuxforum.org/gitstat/commit-detail.php?commit=f09e495df27d80ae77005ddb2e93df18ec24d04a


Seagate Utility for Windows

Here is a link to a utility by Seagate that, among other things, will allow you to adjust the spindown time of FreeAgent drives. Windows only.

http://www.seagate.com/ww/v/index.jsp?locale=en-US&name=freeagent-downloads&vgnextoid=3723b5b59b7d5110VgnVCM100000f5ee0a0aRCRD


See also http://os-drive.com/en/node/27


FWIW, this page doesn't print because of the long URLs? and SUBSYSTEMS lines. There's also a position: absolute in the CSS that is bad news - it limits all printing to a single page, just flowing off the bottom. HTH, Dave

Printing works using the print feature in the top right corner of the page. Scroll all the way to the right.

Page last modified on November 22, 2008, at 03:43 PM