Ubuntu QA:
BlogBrainstormPackage status
Log in
Ubuntu QA
The Ubuntu community has contributed 16587 ideas, 102320 comments, 2136221 votes
Idea sandbox Idea sandbox
Popular ideas Popular ideas
Ideas in development Ideas in development
Implemented ideas Implemented ideas
Idea #72: Unmount resolution

bug This idea was marked as being in development the 25 June 08.
Written by Vivien the 28 Feb 08 at 16:35. Category: System. Related project: Nothing/Others. Status: In development
Rationale
When someone wants to unmount a volume and the mount point is used, he gets a message telling him that the volume can't be unmounted because an application uses it. The user has no idea which application is actually using it and can't remove the device.

I propose that the popup tells him which application(s) is(are) using the device and propose to terminate them (that list should be kept up to date when the app. dies).
Tags: (none)


Developer comments
Upstream bug (GNOME #528559) has a patch in discussion. Volunteering to work on it.

4881
votes
inprogress
Selected solution (#1): Auto-generated solution of idea #72
Written by Vivien the 28 Feb 08 at 16:35.
Ubuntu Brainstorm was updated in January 2009. Since the idea #72 was submitted before this update, its rationale and solution are not separated. Please vote accordingly, and if you have the necessary rights, please separate the rationale from the solution. Thanks!
35
votes
inprogress
Selected solution (#2): Unmount timer
Written by Aphoxema the 23 Sep 08 at 15:26.
Since mounting and unmounting a filesystem over and over again is less hazardous than removing an unmounted filesystem, wouldn't it be as simple as having USB devices unmount automatically after so many minutes without use?

Unmounting any USB drives after, say, 5 minutes without use (by default that is, the option to change it should be available somewhere) would make accidental unplugging less of a risk. It would protect the user, it wouldn't make it all that difficult to mount the filesystem again when it was needed, and it's just damn easy to implement.

Attachments


Duplicates


Comments
will_in_wi wrote on the 28 Feb 08 at 16:52
A starting point for this is the fuser -m command.

ManiacHgh wrote on the 28 Feb 08 at 18:55
"lsof | grep" also does the job.

citronbleu-v wrote on the 28 Feb 08 at 20:48
Good idea

rvalles wrote on the 28 Feb 08 at 23:57
Interestingly enough, some people at the kernel are working on something which could be useful to us.

http://lwn.net/Articles/241889/
http://lwn.net/Articles/262377/
http://lwn.net/Articles/262528/

With this, relatively sane forced unmount would be possible.

pynej wrote on the 29 Feb 08 at 00:44
Though it would be nifty to see a list of programs using the device I am trying to unmount... I see this as a useless feature. I mean, what is it going to be for am average user, a file open in word, Etc.

If it's not obvious to them from their running programs then whats the point. And if its something like /usr/bin/smdb, then what is telling them going to accomplish.

Furthermore this works the same way now as removing devices in use in Windows and OS X. I just don't see the point to change it to give the user information that wont be useful.

Limulus wrote on the 29 Feb 08 at 01:49
Is this the same as Ubuntu Bug #81239?
https://bugs.launchpad.net/ubuntu/+source/gnome-volume-manager/+bug/81239
Excerpt:

---
Sometimes however for reasons unknown to me, something prevents me from unmounting it (right-clicking the icon for the disk on the desktop and selecting "Unmount Volume"). I don't know what and am not sure how to find out what because the error message is not very helpful:

Cannot unmount volume
an application is preventing the volume from being unmounted.

What would be nice is if it would identify the app(s) and ask if I want them closed and the drive unmounted.
---

Thomas_Hinkle wrote on the 29 Feb 08 at 02:06
Just a note to say that I think not fixing this because Windows is also broken would be really stupid :)

This is the kind of usability enhancement than I think would fit in really well with what I think of as the best in ubuntu. And it really is aggravating when you can't figure out what is causing the problem.

ucantblamem wrote on the 29 Feb 08 at 02:31
I agree with Thomas - Windows is BAD benchmark. I really like this idea and I've thought for a long time that someone should do something about it.

linuxoser wrote on the 29 Feb 08 at 03:51
I do like Vivien's idea, since ubuntu is the linux for humanbeing, it should do something easier for the users, a popup is a good idea.

sdgr406 wrote on the 29 Feb 08 at 04:19
I support this idea. It is very timely in my case as I just experienced this problem. I have had a USB flash drive connected to my computer for the past two days as Nautilus gives the error mentioned above.

I know enough in Linux to have used the lsof command against /media/disk to see which application is preventing the volume from being unmounted. I have determined there is a single file descriptor and that the file has been opened in read mode. I have determined that the application preventing the volume from being unmounted is Nautilus itself. And none of this helps me.

The file is a simple text file. I don't have the file open, I have not accessed the file in Nautilus and I can see no reason why the file has been opened by Nautilus. I just want it unmounted.

Sure I understand that the file was opened in read mode and I can just go ahead and remove the drive. Or I can logout of my session and log back in again, therefore starting a new instance of Nautilus. I could probably even kill Nautilus and have the Gnome Session Manager start a new instance, redrawing my desktop in the process.

However, none of this is user friendly. I should simply be able to select the Unmount option from the menu, be presented with the name of the application(s) accessing the file and be given an option to force the unmount process. Done.

Thanks again for the suggestion and thanks for taking the time to read my post. I hope this idea is given consideration by the Ubuntu development team.

Vadim P. wrote on the 29 Feb 08 at 05:20
Excellent idea. Often I'm left guessing for which applications to shut down.

meshugga wrote on the 29 Feb 08 at 05:33
There is also the lack of an "unmount" option if one right-clicks on the volume in the file manager in the file view. why is that? why does it make a difference on which icon i click if it has the same name?

also, it would be great if the same right-click-unmount behaviour could be applied to the "places" tab. i always end up looking for the "right" icon to unmount.

Maulwurfsauge wrote on the 29 Feb 08 at 08:32
Good idea. You could even offer the user to terminate the application in that message.

changlinn wrote on the 29 Feb 08 at 08:41
I agree with pynej this would more than likely be confusing for the end user maybe simply add a close all programs bubble, and have a button that says if this doesn't work click here that simply -fl's the unmount.

zigzed wrote on the 29 Feb 08 at 08:53
I thought it's not very difficult to implement and more user friendly.

Great Idea!

sourcejedi wrote on the 29 Feb 08 at 09:39
I think K-ubuntu already does this, using lsof.

nathan_s wrote on the 29 Feb 08 at 10:10
@changlinn


I'm all for simplicity, but consider this: what if the user has unsaved changed in OOo for files on the drive? Silently killing *some unknown application[s]* sounds dangerous to me.

johno wrote on the 29 Feb 08 at 11:47
There's been an ongoing bug that means you can't unmount some usb volumes without root privileges. This may be the cause of some of these problems.

mthaddon wrote on the 29 Feb 08 at 16:49
By the way, "Unmounting a Volume" has confused two non-Linux users I know. They ended up just disconnecting an external drive first rather than risking doing something that they didn't understand. Perhaps "Eject" or "Unplug" would be a better description.

J.B.Nicholson-Owens wrote on the 29 Feb 08 at 19:21
Relatedly, I'd like to see GNU/Linux distributions hold on to the cache for a device after a device is improperly unmounted (someone simply yanked out a USB drive, for instance) so that the OS can prompt the user allowing them the chance to put the device back on the computer and let the OS flush the cache (possibly rewriting blocks that didn't get written properly because the device was improperly unmounted) and then properly unmount the device.

rawsausage wrote on the 29 Feb 08 at 21:29
People just yank out the usb drive in any case without taking a look at the screen at all. The popup is always too late. What JB above suggests is a novel and more pervasive approach to the same problem.

akiratheoni wrote on the 29 Feb 08 at 21:35
What JB suggests is perfect... I love that idea. Same with mthaddon. I noticed that Dapper had the option to 'Eject' a volume but Gutsy just 'unmounts' it, which I think would be slightly confusing. But I think this is something that should definitely be added.

samuellb wrote on the 1 Mar 08 at 00:00
I think that the cases where the error occurs should be reduced. For example, applications should chdir('/') so that they don't lock the directory they were started from. Or when this is not desirable, the revokeat/frevoke system calls could be used.

gecko_gp wrote on the 1 Mar 08 at 00:00
maybe instead (or also) of showing a list of aplications, it can show an option: "force quit" -> that close the aplications using the device.

christopher_lees wrote on the 1 Mar 08 at 11:44
Not force-quit, but definitely list the programs that are still using the disk, and offer for one to select to quit. It's easy enough for an experienced user to find out already, but I think this would be a valuable usability addition to Gnome upstream.

Cappy wrote on the 1 Mar 08 at 15:11
I also really like J.B.'s suggestion. If there was such an interface it should include in the prompt what changes will be made.

For instance,
"Not finished saving the following file(s):
Report.odt (4kb unsaved)
Slideshow.odp (100kb unsaved)
Filesystem (FAT32) unsaved

Data Loss Will Occur Unless The Device Is Plugged Back In"

elbuntu wrote on the 3 Mar 08 at 00:43
The mount and unmount commands where designed at a time when you had to turn off the power to add or remove disks.

Now with all the hotpluggable and removable media such as dvd:s and usb disks it's just not acceptable that you can't get your cd out or can't remove your USB stick without fiddling with commands like lsof or fuser as root.
I have even experienced situations when neither fuser nor lsof (which usually is more reliable) could find any open files on the disk i wanted to remove, so i had to reboot the system to free the (mysterious) disk references.

I think the kernel should have a new signal (SIGEJECT) to send to all the processes that have open files, then wait a few seconds for them to save their data before terminating the processes that still has open files and then unmounting and perhaps ejecting the media.

Lots of applications had to become SIGEJECT aware but the ones that weren't would simply terminate without saving.

Also i think programs like konqueror and nautilus should be coded so they always release the files they open as soon the user closes a wiev of a file or folder. Now you often have to restart them to close all the used files.

Xfactor wrote on the 3 Mar 08 at 14:52
SUPERB IDEA. GOOD. LOVE IT

zayed wrote on the 6 Mar 08 at 11:00
I like this idea.

Gilanel wrote on the 17 Mar 08 at 12:03
You've got my vote

furat wrote on the 18 Mar 08 at 02:52
I think it will be nice if the user have the option to see the process using the file system or just force the umount
i.e choose between fuser -m /filesystem or fuser -mk /filesystem

Warbo wrote on the 8 May 08 at 14:41
I think this could be done by the creation of a standard, probably DeviceKit ( http://lists.freedesktop.org/archives/hal/2008-May/011560.html) based. It would give devices a "used by" property, which other applications can call.

For example, Nautilus, Rhythmbox and OpenOffice can all tell DeviceKit that they are using files on a USB drive, then when the user requests to unmount it Nautilus can change directory away (to Home or Computer or something), OpenOffice can ask the user whether they wish to save their document and Rhythmbox can silently remove the no-longer-accessible files from the playlist.

The big problem with this idea is that it relies on applications adopting the standard, but whilst many niche programs may never get this support, the most-used, default, actively maintained and popular programs will, eg. standard GNOME, KDE, OpenOffice, AbiWord, Inkscape, GIMP, Gnumeric, Amarok, Exaile, etc. and these are the programs most likely to cause problems when removing a drive (ie. the number of programs which don't have such support AND which are widely used AND are in the hands of users who don't know about closing files before removing drives AND are used with files on removable drives AND cannot attract the interest of a developer to add the feature would be quite small)

Auzy wrote on the 10 Jun 08 at 14:51
Nand and co.. Looks like we just lost another idea here:
http://brainstorm.ubuntu.com/idea/1515/

NOT the same thing at all.. And its obvious

Taxman wrote on the 16 Jul 08 at 01:57
Here's the link to the bug where it is being worked on. Comments and code welcome there I'm sure.
http://bugzilla.gnome.org/show_bug.cgi?id=528559

pandaking wrote on the 23 Aug 08 at 13:51
This will be similar to the tool "Unlocker" for Windows?
If so great because I used it all the time, and I am needing it now in Linux!

Sicart wrote on the 27 Oct 08 at 05:42
Same as pandaking: the Unlocker tool has done a lot to salvage what little sanity Microsoft left me. You can see it here: http://ccollomb.free.fr/unlocker

booyabazooka wrote on the 11 Dec 08 at 21:47
Not being able to force an eject is a big problem.

This situation has happened to me several times: The power goes out. I my external hard drive on an emergency battery backup which will last maybe 4-8 minutes. This drive WILL be shut off, regardless of how hard the OS protests that "an application" would like for it to stay mounted.

It's just a terrible "I'm sorry, I can't do that, Dave" situation when I request an unmount and ubuntu says No. I'm about to reboot my machine just so I can unplug my drive... this is ridiculous.

ben2talk wrote on the 7 Jun 09 at 10:07
I just discovered that killall nautilus will do it. I then restart it by launching 'Home Folder' keyboard shortcut.
I'm thinking about just having a script that will kill nautilus, wait 3 seconds, and then open my home folder.

I'm finding Nautilus rather more buggy under jaunty than it was previously.

ben2talk wrote on the 7 Jun 09 at 12:39
It's very quiet - Sicart wrote on the 27 Oct 08 at 05:42 Report as spam / offensive

Same as pandaking: the Unlocker tool has done a lot to salvage what little sanity Microsoft left me. You can see it here: http://ccollomb.free.fr/unlocker

Did everyone promptly leave and upgrade to XP?

BryanFRitt wrote on the 11 Jun 09 at 03:55

http://ubuntuforums.org/showthread.php?t=1177702
When shutting down I (always) get this message
"
mount: / busy
mount: / busy
"
yes it is there twice in a row.

It would be nice if mount/umount would display to the command line what is preventing a proper mount/umount.
If mount/umount said what was preventing a proper mount/umount, it would be alot easier to figure out what's going on during shutdown.
This could be added on as a mount/umount argument, or mount/umount could just default to work this way.

p.s. feel free to respond to the ubuntu thread.

sucotronic wrote on the 21 Oct 09 at 18:28
It seems that the gnome bug is forgotten:
https://bugzilla.gnome.org/show_bug.cgi?id=528559
Modified: 2008-11-17 04:21 UTC

From the point of usability this feature is VERY important. If a new user try Ubuntu and when he was to unmount his usb key receives a not legible message, I think he won't talk very good of ubuntu.
The Ubuntu team could help gnome developers implementing this feature and sending them for approval.


Post your comment