Comment 82 for bug 125702

Revision history for this message
wodny (z-launchpad-wodny-org) wrote :

Ubuntu 10.04.2 LTS (Lucid)
Linux 2.6.35-25-generic

I've also observed this problem. And just like others - I thought it was a hardware problem at first.

I've experimented with a couple of configurations and it seems that the current one decreased the number of filesystem errors.

So the theory is that USB flash drives like to do some block juggling even after signalling they have finished and they lose power halfway to data really being flushed.

Ext3 doesn't really help here. Both Ext2 and Ext3 can be marked clean but have errors. Errors may appear in data not in metadata. Then even fsck won't see them. For example MD5 would.

The problem seems to be computer and USB flash drive dependant.

I've decided to try the configuration with a separate "casper-rw" Ext2
partition on the USB flash drive as casper initrd scripts allow it. It is used instead of a loop-mounted "casper-rw" file on FAT.

"Showmounts" boot option enabled.

I remount filesystems to "ro" before shutdown in the order below:
- /cdrom,
- / (prepend noxino, rw->ro),
- /cow.
I do sync, some sleep.
At the end I send raw SCSI sync command (sg3-utils) - not every USB flash drive understands this.
I've also disabled the eject command (as Debian does for USB drives).

I attach scripts I've used.

I think that a kernel/hardware guru is needed here.