SeaGate Drives Still Not Playing Ball with AutoPower Saving Mode

 

It was quite some time ago that there were reports of Seagate hard drives not playing ball with Linux. So long ago in fact that I had completely forgotten about it (you'd think it would be fixed by now!) until I bought a new external hard drive.


It's a nice piece of kit, sleek looking with a small form factor and 500GB of space spread across it's platters. Not bad at all for 50 quid, first I formatted it as ext2 (let's not get into the FS wars!) with mkfs. Then I moved some of my files onto it.

I came back a little later, and whenever I tried to gain access to the root of the disc I received an I/O error. Checking dmesg showed the following;

usb 2-3: reset high speed USB device using ehci_hcd and address 5
EXT2-fs error (device sdc1): ext2_readdir: bad page in #2
usb 1-3: USB disconnect, address 112
sd 43:0:0:0: Device not ready.
end_request: I/O error, dev sdc, sector 4423
EXT2-fs error (device sdc1): ext2_readdir: bad page in #2

Even this didn't remind me of the previously reported issues. So my troubleshooting went straight down the wrong path, it's not the only USB harddrive plugged into that root hub, and USB only has so much bandwidth. So I tried plugging it into a port run from another root hub. The logic being that a disconnect happened before any filesystem errors.

No luck.

So then I decided to check the filesystem itself (on account of the bad page) with e2fsck

kryten ben # e2fsck /dev/sdc1

e2fsck 1.38 (30-Jun-2005)
/dev/sdc1 contains a file system with errors, check forced.
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
/dev/sdc1: 20/61063168 files (10.0% non-contiguous), 19724511/122096008 blocks

Clearly there were errors, so I thought this may have resolved the issue. A little later on, I once again received the Input/Output error. Nuts!

It was at this point I remembered previous hassles involving Seagate drives, ever since the FreeAgent range was first released, the drives have had an automatic powersaving mode. After a few minutes of inactvity the discs spin down, which would be fine. The problem is that the USB connection is also closed (hence the disconnect in my dmesg log), neither Linux or Mac are able to deal with this. Seagate have kindly programmed their Windows drivers to be able to reconnect without issues, but left Linux and Mac users out in the cold.

The connection can be restored by either unplugging the USB cable and reconnecting it. Or from doing a simple

umount /path/to/mountpoint
mount /path/to/mountpoint

The problem being that this is
a) a hassle
b) causing fileystem errors

The old issue of it reconnecting via USB1 does not seem to have surfaced as yet. There is a utility (SeaTools) offered  by SeaGate to switch off the auto spindown, but it's Windows only.  Hdparm has an argument which used to be able to disable the spindown, however it doesn't seem to work anymore;

kryten ben ~# hdparm -Z /dev/sdc

/dev/sdc:
disabling Seagate auto powersaving mode
HDIO_DRIVE_CMD(seagatepwrsave) failed: Invalid exchange


In fact hdparm seems unable to retrieve any information from the disk. Seagate have either changed the calls, or have decided to completely ignore them.

hdparm -I /dev/sdc

/dev/sdc:
HDIO_DRIVE_CMD(identify) failed: Invalid exchange

This unfortunately has left me with a difficult situation, there's now no way to fix the issue. That leaves me with workarounds, which are at best messy and at worst can cause other issues. The drive spins down if there is inactivity, so the simplest workaround is to make sure the drive is accessed at regular intervals. The problem is we don't know the interval before autopower saving kicks in. Normally we'd find it with the following

hdparm -C /dev/sdc

but in this case, all we get back is;

/dev/sdc:
drive state is:  unknown

So it's a case of trial and error. It used to be a 15 minute interval, so we'll try accessing the disk once every 10 minutes. So I created a file to access

echo "" > /mnt/exthd2/.wakeup

Next I needed a script to access the file

#!/bin/bash
#
# Simple Script to keep my Seagate drive awake
# Thanks a bunch Seagate!!!!!

touch -m /mnt/exthd2/.wakeup
exit

I added this to my crontab to run every 5 minutes (what can I say, I'm paranoid!).

So far it seems to be working!

I can't believe that in the 2 years since this first hit the news, there's been no real improvement. Seagate evidently haven't adapted their system (I presume leaving the USB connection open would be enough to resolve the issue) and the Linux Kernel appears not to have a resolution either.

Personally, I feel the problem lies more with SeaGate than anyone, USB external harddrives are a pretty commonplace item, and the way they work is also pretty standard. SeaGate appear to have disregarded this to quite an extent and so end up frustrating their customers. If I had remembered the issue when I was buying the drive, I wouldn't have bothered. Returning it is too much hassle, so I'll have to make do with the workaround until a suitable fix can be found.

 
 Share