Bug 199128

Summary: USB drive icon disappears before write cache flushed
Product: [Fedora] Fedora Reporter: Robin <robin.laing>
Component: usbviewAssignee: David Zeuthen <davidz>
Status: CLOSED WONTFIX QA Contact: David Lawrence <dkl>
Severity: high Docs Contact:
Priority: medium    
Version: 4CC: mclasen
Target Milestone: ---   
Target Release: ---   
Hardware: i686   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2007-01-22 17:47:05 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Robin 2006-07-17 13:14:47 UTC
Description of problem:
Usb drive icon will disapear before the system has finished writing to the
drive.  As a user, I feel that it is now safe to remove the drive.  Doing so
before the write is finished leads to corrupted data or destroyed file system.

Version-Release number of selected component (if applicable):

usbview-1.0-13
2.6.17-1.2141_FC4

How reproducible:
Every time I tried to different results.

Steps to Reproduce:
1.  Stick in USB stick and wait for icon.
2.  Copy or write a large amount of data to the USB drive.  Drag/Drop or cp.
3.  Unmount drive by right clicking on the desktop icon.
4.  Wait for the icon to disappear from the desktop.
5.  Pull the drive out.

Actual results:
The first time this happened, the FAT was trashed on a VFAT formatted drive.  To
the point that Linux couldn't mount the drive again.  I had to run dosfsck to
fix it.

I then had to copy the data back to the drive and I was monitoring
/var/log/messages and nothing showed up for the drive until I removed the drive.  

df -h showed normal date for the drive while mounted but when I unmounted the
drive and the icon was gone, I still had a listing in df -h for /dev/sda but was
not showing the data for /dev/sda but the first partition listed above it, /dev/hda2

Expected results:
The drive icon to remain on the desktop until all files are written, cache's
flushed and system has finished with the drive.

Additional info:

First mount 
Jul 11 14:13:46 eagle1 kernel: SCSI device sda: 2048001 512-byte hdwr sectors
(1049 MB)
Jul 11 14:13:46 eagle1 kernel: sda: Write Protect is off
Jul 11 14:13:46 eagle1 kernel: sda: assuming drive cache: write through
Jul 11 14:13:46 eagle1 kernel: SCSI device sda: 2048001 512-byte hdwr sectors
(1049 MB)
Jul 11 14:13:46 eagle1 kernel: sda: Write Protect is off
Jul 11 14:13:46 eagle1 kernel: sda: assuming drive cache: write through
Jul 11 14:13:46 eagle1 kernel:  sda:
Jul 11 14:13:46 eagle1 kernel: sd 7:0:0:0: Attached scsi removable disk sda
Jul 11 14:13:47 eagle1 fstab-sync[28531]: added mount point /media/usbdisk for
/dev/sda
Jul 11 14:13:47 eagle1 kernel: SELinux: initialized (dev sda, type vfat), uses
genfs_contexts


After writing the data, I remounted the drive to check.

Jul 11 14:26:21 eagle1 kernel: end_request: I/O error, dev sda, sector 146696
Jul 11 14:26:22 eagle1 kernel: end_request: I/O error, dev sda, sector 146936
Jul 11 14:13:46 eagle1 kernel:  sda:
Jul 11 14:13:46 eagle1 kernel: sd 7:0:0:0: Attached scsi removable disk sda
Jul 11 14:13:47 eagle1 fstab-sync[28531]: added mount point /media/usbdisk for
/dev/sda
Jul 11 14:13:47 eagle1 kernel: SELinux: initialized (dev sda, type vfat), uses
genfs_contexts
Jul 11 14:26:21 eagle1 kernel: end_request: I/O error, dev sda, sector 146696
Jul 11 14:26:22 eagle1 kernel: end_request: I/O error, dev sda, sector 146936
Jul 11 14:26:22 eagle1 kernel: Buffer I/O error on device sda, logical block 581560
Jul 11 14:26:22 eagle1 kernel: lost page write due to I/O error on sda
Jul 11 14:26:22 eagle1 kernel: Buffer I/O error on device sda, logical block 581561
Jul 11 14:26:22 eagle1 kernel: lost page write due to I/O error on sda
Jul 11 14:26:22 eagle1 kernel: Buffer I/O error on device sda, logical block 581:

Which continues.

After fixing the drive with dosfsck, I had tried again.  And again.

If there is no indicator lights on your usb stick, then there is nothing other
than the desktop to indicate that drive is still active.

On three attempts, I lost data on all three occasions.

I found that if I waited for "df" to quit displaying the drive, then the write
was finished.

A bug has been submitted for FC5.

194296


I have done this on two different systems and two different sticks.  On one
stick with a light, the light was still flashing when the icon disappeared.

Comment 1 Christian Iseli 2007-01-22 10:28:58 UTC
This report targets the FC3 or FC4 products, which have now been EOL'd.

Could you please check that it still applies to a current Fedora release, and
either update the target product or close it ?

Thanks.

Comment 2 Robin 2007-01-22 17:47:05 UTC
Just updated to FC6 on one machine and this is fixed.

I agree that FC4 is at end of life so this is a won't fix.