External Seagate hard-disk in Ubuntu

Lately I noticed some weird behaviour when I attached my Seagate Freeagent external hard disk to my SheevaPlug server. The sheeva plug runs Ubuntu 9.04, and after a certain amount of time (about once a day I’d assume) the Seagate would be re-mounted as a read only file system. Even though I had originally mounted it as writeable, the kernel would encounter errors and crap out.

The kern.log file shows it all:

[…]

Apr 12 18:48:34 debian kernel: Buffer I/O error on device sdb1, logical block 17793026

Apr 12 18:48:34 debian kernel: lost page write due to I/O error on sdb1

Apr 12 19:01:56 debian kernel: ext3_abort called.

Apr 12 19:01:56 debian kernel: EXT3-fs error (device sdb1): ext3_journal_start_sb: Detected aborted journal

Apr 12 19:01:56 debian kernel: Remounting filesystem read-only

Apr 13 06:26:37 debian kernel: sd 1:0:0:0: [sdb] Device not ready: <6>: Sense Key : 0x2 [current]

Apr 13 06:26:37 debian kernel: : ASC=0x4 ASCQ=0x2

[…]

Some research on the forums showed I was not the only one with Seagate woes. However, my problems seemed to be resolved by this very helpful forum post:

http://ubuntuforums.org/showthread.php?t=494673

the below is quoted from the link I pasted above for your convenience:

[QOUTE]

Example (type in Terminal):

sudo gedit /etc/udev/rules.d/85-usb-hd-fix.rules

and enter

BUS==”scsi”, SYSFS{vendor}==”WD”, RUN+=”/usr/bin/usbhdfix %k”

and save the file.

Note: The vendor “WD” have to be replaced with the correct one, in my case “Seagate”. Check the second reference link to find the correct one on your system.

Then create the shell script to be run when harddrive is detected:

Still in Terminal, type:

sudo gedit /usr/bin/usbhdfix


and enter

#!/bin/bash

echo 1024 > /sys/block/$1/device/max_sectors

echo 1 > /sys/block/$1/device/scsi_disk:*/allow_restart

and save the file.

Make the script executable:

Still in Terminal, enter

sudo chmod 0755 /usr/bin/usbhdfix

[UNQUOTE]

It’s been 3 days and counting since I used that fix, and no problems yet!🙂