Linux and Seagate FreeAgent Drives

Posted by Christian Ashby on March 24, 2010

If you’ve bought a Seagate FreeAgent drive with a view to running it on Linux, be aware that it won’t necessarily work out-of-the-box.

The issue is that after about 1min of use the drive spins down and closes the USB connection, causing mounts to fail and the device to be unusable.

It turns out that the drives include some cunning/annoying (delete as applicable) power saving logic which only correctly works in Windows. The solution is to run the following command as root as soon as the drive is plugged in.

sdparm -clear STANDBY -6 /dev/sdX

If you use your drive regularly then you can make this command run whenever the drive is used, by editing the file /etc/udev/rules.d (you can create the file if it doesn’t exist) and adding the following line:

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

 

Linux: Getting SMART status from 3ware cards

Posted by Christian Ashby on March 9, 2010

3ware RAID cards are a very robust hardware RAID solution which work under Linux.

If you use these cards though, the ’3dm2′ web interface and command line interface only give limited information about the health of the drive.

Fortunately the standard tool smartctl can access the drives as if they were directly connected to the system like this:

smartctl -d 3ware,X --all /dev/twa0

Where X is the index (0…n) of the drive you want to check.