Just posting this for the benefit of anyone who might have the same problem, the only partly relevant thread I could find here was
this
I recently got given a 160G Seagate FreeAgent Go usb external harddrive. I reformatted it to ext3, but was getting heaps of weird errors, and the file system kept getting corrupted forcing me to run e2fsck almost every time I unmounted it. Syslog looked like this
Code:
Jun 28 15:33:12 hex kernel: sd 3:0:0:0: [sdb] Assuming drive cache: write through
Jun 28 15:43:04 hex kernel: end_request: I/O error, dev sdb, sector 12503
Jun 28 15:43:04 hex kernel: Buffer I/O error on device sdb1, logical block 1555
Jun 28 15:43:04 hex kernel: lost page write due to I/O error on sdb1
Jun 28 15:43:04 hex kernel: end_request: I/O error, dev sdb, sector 12503
Jun 28 15:43:04 hex kernel: Buffer I/O error on device sdb1, logical block 1555
Jun 28 15:43:04 hex kernel: lost page write due to I/O error on sdb1
Jun 28 15:43:04 hex kernel: end_request: I/O error, dev sdb, sector 12503
Jun 28 15:43:04 hex kernel: Buffer I/O error on device sdb1, logical block 1555
Jun 28 15:43:04 hex kernel: lost page write due to I/O error on sdb1
Jun 28 16:13:08 hex kernel: JBD: Clearing recovery information on journal
Turns out, it's the drive going into standby mode and spinning down, and linux not restarting it before trying to write data. Basically the solution is to set the 'allow_restart' flag in /sys/class/scsi_disk/*/allow_restart.
There are ways to do this
here and
here. I think the second page has the better idea with a udev rule. I added this to /etc/udev/rules.d/99-local.rules:
Code:
# Seagate FreeAgent allow_restart fix for i/o errors
# from http://www.nslu2-linux.org/wiki/FAQ/DealWithAutoSpinDownOnSeagateFreeAgent
SUBSYSTEMS=="scsi",DRIVERS=="sd",ATTRS{vendor}=="Seagate*",ATTRS{model}=="FreeAgent*",RUN+="/bin/sh -c 'echo 1 > /sys/class/scsi_disk/%k/allow_restart'"
I haven't had any more problems so far.