Bug 194296

Summary: USB drive icon shows as unmounted before write cache flushed
Product: [Fedora] Fedora Reporter: Vic Ricker <vic>
Component: gnome-mountAssignee: David Zeuthen <davidz>
Status: CLOSED WONTFIX QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 8CC: alexl, chame.leon, davidz, mclasen, triage
Target Milestone: ---   
Target Release: ---   
Hardware: i686   
OS: Linux   
Whiteboard: bzcl34nup
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2009-01-09 06:57:16 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 Vic Ricker 2006-06-06 22:30:32 UTC
When unmounting a USB drive, the drive's icon shows the drive as being
unmounted, giving you the impression that it's safe to remove even though it
isn't.  Usually, after unplugging the drive, an error is displayed, saying that
it was unable to unmount the drive.  The drive becomes corrupt with a lot of
lost space.

How reproducible:
always

Steps to Reproduce:
1. Plug in USB drive.
2. Open USB drive icon.
3. Drag/drop many large files to the drive.
4. Wait for copy to finish
5. Right click drive's icon and choose to unmount it
6. After the icon changes indicating that the drive has been unmounted unplug it.

Actual results:
Drive is corrupt and has a lot of lost space.

Expected results:
I would expect all writes to have been committed and the drive completely
unmounted before the icon changes to the unmounted state.  Either that or some
other indication to that effect would be nice.

Comment 1 Robin 2006-07-13 16:06:44 UTC
I want to add to this.

I just ran into the same problem yesterday with FC4.

I repeated the problem three times.

It is even harder to know that the drive is still being written to if there are
no indicators lights on the drive.

What I found.

1.  The syncing of the data isn't done as soon as you copy it.  Not that much of
an issue.

2.  When the drive is mounted, "df -h" shows proper mount and usage status.

3.  When the drive is unmounted by clicking on the desktop, there is no
indication in the logs of this occuring and the icon waits a bit then disappears.

4. But "df -h" now shows the wrong drive structure for the drive, yet it is
still being written to.  For my 1 gig drive, it showed the same details as my
19Gig partition (/dev/hda2) but under /dev/sda

My situation was an empty 1Gig USB stick with no indicator lights.
Using terminal to copy ~600M of files "cp -r  ~/data_to_stick/* /media/usbdisk "
Right click drive icon and unmount the drive.
Wait for icon to disapear and then remove drive.
Remount drive and find corrupted files and/or file system.

After the first time, I couldn't remount the drive because the fat was wrecked.
 dosfsck /dev/sda saved the drive.  Later repeated with only file corruption.

Need a pop-up or message to not remove the drive or to say that the drive is
safe to remove as in Windows.  If I hadn't backed up all the files on this drive
just before doing this, I would have been very, very upset.  Or if this had been
a move instead of a copy, it could have ended worse.

I think that this should be a high priority as it does cause data corruption and
loss.  I cannot change the priority.

Comment 2 Alexander Larsson 2006-08-22 12:51:23 UTC
This seems to be a hal issue. It sets the volume to unmounted before the kernel
is finished with the unmount it seems.

Comment 3 David Zeuthen 2006-08-22 16:17:02 UTC
It's definitely not a HAL issue - that's just how the kernel works. You can
easily detach a file system while there unwritten blocks in the block cache. The
problem for the user remains though.

I think the way to solve this is to make gnome-mount call sync(1) after
unmounting and put up a dialog if this doesn't return within 0.5 seconds. I'd be
happy to take patches, I'm pretty busy and probably won't get around to doing
this for some weeks.

Comment 4 Robin 2006-08-22 17:47:59 UTC
As long as the user is informed that the drive is "not safe" to remove, the
issue is resolved.  In Windows, there is a pop-up that states the drive is safe
to remove.  In Gnome, we look for the icon to disapear.

In making Linux/Fedora more user friendly, especially for those with less
experience, a message stating that users should wait until the drive is actually
finished all transactions.  If this is called by sync, then don't remove the
drive icon until sync is finished or provide a pop-up that the drive is "done
syncing and can be safely removed."  AKA, windows again.


Comment 5 David Zeuthen 2006-08-22 20:33:05 UTC
Yes, what is requested in comment 4 is exactly what comment 3 describes.

Comment 6 Alexander Larsson 2006-08-23 13:12:40 UTC
I did see the mountpoint listed in the output of "mount" while the writing was
happening.


Comment 7 Robin 2006-08-23 20:02:54 UTC
As I stated, the drive does show up with "df" but the data is wrong.  (comment
1) Somewhere the system gets confused.  Maybe this is where the communications
between the desktop and the kernel is getting confused.  Maybe this is where the
desktop thinks the drive is unmounted.

Where does the "df" information come from and why would it change when I want to
unmount my stick?


Comment 8 Alexander Larsson 2006-09-04 16:45:04 UTC
*** Bug 192528 has been marked as a duplicate of this bug. ***

Comment 9 David Zeuthen 2006-09-13 16:14:44 UTC
I've fixed this and the necessary changes will appear in (yet unreleased, will
release both in a few days) HAL 0.5.8.1 and gnome-mount 0.5. Here's a screenshot
that shows how it looks

 http://people.freedesktop.org/~david/gm-nag3.png

This notification will appear if it takes more than 750ms to Unmount the volume
and it will be displayed for at least two seconds (to avoid flashes) but will be
removed as soon as it's safe to unplug the device etc.

We should push gnome-mount 0.5 and HAL 0.5.8.1 as FC6 updates just after FC6 is
out. 


Comment 10 Vic Ricker 2006-09-13 17:09:24 UTC
Looks great! Bravo!


Comment 11 John (J5) Palmieri 2006-09-13 17:22:33 UTC
Ah, the nag is a bit worrysome.  I would shorten it and just switch the
notification to "Drive is now safe to remove" when it is unmounted.  I would
also remove the word unmount though it apears in the UI anyway.  Personnaly I
would just say "Writting data to removable storage", "Please do not remove the
drive" or something to that effect.

Comment 12 David Zeuthen 2006-09-13 20:31:32 UTC
Comment 11 sounds sane. So I did that

 http://people.freedesktop.org/~david/gm-nag4.png
 http://people.freedesktop.org/~david/gm-nag5.png

Specifically the last notification goes away after the default timeout.

Is the wording OK now? Just asking as English is my 2nd language etc. etc.

Comment 13 David Zeuthen 2006-09-13 20:35:21 UTC
Changed "put away" to "removed" already!

Comment 14 John (J5) Palmieri 2006-09-13 20:48:15 UTC
The first message is still a bit wordy but it is good for now until we can get
some designers on it.

Comment 15 Robin 2006-09-15 20:09:09 UTC
I like this idea and it looks good.  It would be nice if the "safe to remove"
message comes up at all times.  A green icon or text for safe to remove.

The "Do not remove message" could use a red icon or message to indicate not safe
to remove.

I hope it gets back ported to earlier versions of FC.

Text suggestion.

"USB device is syncing, please do not remove."

Comment 16 Bug Zapper 2008-04-04 03:03:34 UTC
Fedora apologizes that these issues have not been resolved yet. We're
sorry it's taken so long for your bug to be properly triaged and acted
on. We appreciate the time you took to report this issue and want to
make sure no important bugs slip through the cracks.

If you're currently running a version of Fedora Core between 1 and 6,
please note that Fedora no longer maintains these releases. We strongly
encourage you to upgrade to a current Fedora release. In order to
refocus our efforts as a project we are flagging all of the open bugs
for releases which are no longer maintained and closing them.
http://fedoraproject.org/wiki/LifeCycle/EOL

If this bug is still open against Fedora Core 1 through 6, thirty days
from now, it will be closed 'WONTFIX'. If you can reporduce this bug in
the latest Fedora version, please change to the respective version. If
you are unable to do this, please add a comment to this bug requesting
the change.

Thanks for your help, and we apologize again that we haven't handled
these issues to this point.

The process we are following is outlined here:
http://fedoraproject.org/wiki/BugZappers/F9CleanUp

We will be following the process here:
http://fedoraproject.org/wiki/BugZappers/HouseKeeping to ensure this
doesn't happen again.

And if you'd like to join the bug triage team to help make things
better, check out http://fedoraproject.org/wiki/BugZappers

Comment 17 Robin 2008-04-18 20:15:12 UTC
This may have been fixed as I noticed on F7 that there is now a message that it
is safe to remove the USB stick under Gnome.  In KDE, there is no message, the
icon just disappears (my configuration). 

I have just tested this in F8 with KDE and I cannot unmount the drive while data
is being written to it.

Again the icon just disappears when the device is ready to be unmounted.




Comment 18 John Poelstra 2008-05-06 01:54:32 UTC
changing to Fedora 8 based on comment #17

Comment 19 Bug Zapper 2008-11-26 06:58:41 UTC
This message is a reminder that Fedora 8 is nearing its end of life.
Approximately 30 (thirty) days from now Fedora will stop maintaining
and issuing updates for Fedora 8.  It is Fedora's policy to close all
bug reports from releases that are no longer maintained.  At that time
this bug will be closed as WONTFIX if it remains open with a Fedora 
'version' of '8'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version prior to Fedora 8's end of life.

Bug Reporter: Thank you for reporting this issue and we are sorry that 
we may not be able to fix it before Fedora 8 is end of life.  If you 
would still like to see this bug fixed and are able to reproduce it 
against a later version of Fedora please change the 'version' of this 
bug to the applicable version.  If you are unable to change the version, 
please add a comment here and someone will do it for you.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events.  Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

The process we are following is described here: 
http://fedoraproject.org/wiki/BugZappers/HouseKeeping

Comment 20 Bug Zapper 2009-01-09 06:57:16 UTC
Fedora 8 changed to end-of-life (EOL) status on 2009-01-07. Fedora 8 is 
no longer maintained, which means that it will not receive any further 
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of 
Fedora please feel free to reopen this bug against that version.

Thank you for reporting this bug and we are sorry it could not be fixed.