Comment 9 for bug 28622

Revision history for this message
Martin Rehn (minpost) wrote :

This also affects removable media such as USB drives and USB sticks. Since these are brittle devices, with crappy FAT file systems, that often get yanked without unmounting, the problem is fairly common. For example, when this happens:

[ 1364.080987] FAT: Filesystem panic (dev sdb1)
[ 1364.080990] fat_get_cluster: invalid cluster chain (i_pos 32499)

The filesystem is at this point still shown as "rw" by mount, and nowhere in the UI is there even an indication that the file system is now read only. Many programs (e.g. OpenOffice) will give very non-informative error messages when they try to write to the file system. Others (e.g. mount) give a proper error message, though.

Three things should be done:

(1) Pop up a notification informing the user of the problem.

(2a) Show the file system as read-only in the UI. Maybe remount it as read-only (such that this is reflected by the output of mount) to accomplish this. Hopefully this would also help some apps to give better error messages.
(2b) Even better would be if the drive icon could also get an emblem indicating that there is a problem.

(3) Offer to remedy the error. "fsck -a /dev/sdb1" followed by an "rw" remount would work in many cases. For a small broken FAT file system such as a USB stick another reasonable option, in many cases, would be to copy the files off the file system, format it and then copy the files back.