Seagate FreeAgent Idle Under Linux
About a week ago I bought a Seagate FreeAgent 320Gb external USB drive for my Linux box thinking that I could dump my mp3 files to it as well as backup my documents, pictures, et al to it as well. For the price, it was a great buy and I’ve been pretty happy with the performance. However, I noticed that occasionally Amarok would no longer see the music library and would error out all my songs. This was…annoying. Normally I could fix it by just browsing to the drive and magically everything would work fine.
Strangely, it seemed that the drive was offlining itself, automatically, after an extended period of non-use. Apparently, I’m not alone with this issue either. I have to give Diane props for finding the fix but i’m going to repost it here to clear things up a bit.
I’m running Ubuntu, Gutsy Gibbons (7.10) to be precise. This should work equally well for other versions of Ubuntu as well (and other distributions but your method of getting the needed application will vary). First, we need to grab the sdparm package from the repositories. Open up a terminal window and type:
chris@hooby:~$ sudo apt-get install sdparm
You’ll then see some scrolling output as it grabs and installs the sdparm utility which basically allows you to output and modify the parameters for scsi (USB hard drives, SATA drives, and dvd/cd burners are seen as SCSI) devices.
Next, you’ll need to find out what the true path to your device is. If you don’t know it (should be something like /dev/sdX where x is a letter a-x) you can disconnect the drive and reconnect it. Then, run
cat /var/log/dmesg
Which should output something similar to this towards the bottom
[ 14.172000] scsi 5:0:0:0: Direct-Access Seagate FreeAgentDesktop 100D PQ: 0 ANSI: 4
[ 14.196000] sd 5:0:0:0: [sdb] 625142448 512-byte hardware sectors (320073 MB)
[ 14.200000] sd 5:0:0:0: [sdb] Write Protect is off
Now, we want to check the current status of the drive so run the following
sudo sdparm -a /dev/sdb (substitute your sdX for my sdb)
which will output the following
/dev/sdb: Seagate FreeAgentDesktop 100D
Power condition mode page:
IDLE 0 [cha: n, def: 0, sav: 0]
STANDBY 1 [cha: y, def: 1, sav: 1]
ICT 0 [cha: n, def: 0, sav: 0]
SCT 9000 [cha: y, def:9000, sav:9000]
The “STANDBY” flag is what we’re concerned with. We need to clear that. Now the following command can only be run when the drive is actually spun up but if you did disconnect and reconnect the device it’ll be up and accessible so run
sudo sdparm –clear STANDBY -6 /dev/sdb
There won’t really be much showing that the command succeeded. However, if we run sdparm -a /dev/sdb again we’ll see the following showing that it worked
chris@hooby:~$ sudo sdparm -a /dev/sdb
/dev/sdb: Seagate FreeAgentDesktop 100D
Power condition mode page:
IDLE 0 [cha: n, def: 0, sav: 0]
STANDBY 0 [cha: n, def: 1, sav: 0]
ICT 0 [cha: n, def: 0, sav: 0]
SCT 0 [cha: n, def:9000, sav: 0]
As you can see, the standby flag is now gone. Your drive should no longer go into a sleep mode causing havoc with Linux.
December 7th, 2007 at 1:13 pm
This command will need to be run every boot as the change the command makes is NOT permanent, so put this command in your rc.local script
December 7th, 2007 at 10:07 pm
DeepDayze: Doesnt seem to have to be rerun. My drive isn’t sleeping after multiple reboots no matter how long I let it sit. Right now the drive isn’t letting me pull information from it through sdparm though it is working fine and not sleeping
December 8th, 2007 at 10:28 am
I fixed the problem another way.
You type in terminal
“sudo apt-get install pmount”
and then i type in the terminal every time the disk sleeps:
“pmount /dev/sdb1″
March 28th, 2008 at 4:29 pm
I have confirmed that this is also the required fix to get Seagate FreeAgent drives to work as an auxiliary external hard drive with a Moxi DVR.
Without this fix, when the drive goes to sleep, the Moxi will respond with a “Do you want to keep/delete this episode?” prompt — twice — when you try to play shows on the EHD, and if there is no space on the built-in hard drive, shows will not be recorded, with the (unhelpful) reason logged as “Failed (No Signal)”.
Thanks for this fix.
March 28th, 2008 at 4:44 pm
[...] Answer for how to keep these drives from going to sleep was found at the blog My Slice of Reality. [...]
April 19th, 2008 at 9:29 am
[...] Ebenso mit meiner externen Festplatte Seagate Free Agent. Etwas geschockt hatte mich zunächst der Beitrag von The Inquirer, der über linuxfeindliche Festplatten berichtet. Der Fedora Blog bezog sich auf den Bericht von Pro Linux, wonach das Energiemanagement der USB-Festplatten unter Linux einen Einsatz auschließen. Auch hierfür fand ich wirksame Abhilfe. [...]