Re: open files/ forcing dismount
On 2/25/14, Scott Ferguson <scott.ferguson.debian.user@gmail.com> wrote:
> On 25/02/14 14:21, Zenaan Harkness wrote:
>> One long term "non-easy" issue that keeps coming up a few times a
>> year, is attempting to dismount an external drive/usb stick and this
>> failing due to a file being opened.
>>
>> lsof is a good start, and sometimes advised in the error message with
>> some other command.
>>
>> However, what ends up the case is gvfs has it's greedy fingers stuck
>> right up the drive and refuses to let go!
>>
>> There _ought_ be a simple force dismount option. There ought be one
>> command (I know, let's say "umount") that achieves this, optionally
>> with a --quiet option so it doesn't stop to ask the user in case some
>> file is actually open for editing.
>>
>> Does such a thing exist?
>>
>> But more importantly, how do I cause gvfs to "detach", e.g.:
>> $ sudo umount -vd /media/tmp # same result with -i option
>> umount: /media/tmp: device is busy.
>> (In some cases useful info about processes that use
>> the device is found by lsof(8) or fuser(1))
>
> I don't run GNOME, but I imagined gvfs didn't use mount.
I run XFCE, and I have the "Mount Plugin" applet, to assist
unmounting, but it seems to have the same problem.
>> $ lsof /media/tmp/
>> COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
>> gvfsd-met 10600 justa mem REG 254,5 32768 49238
>> /media/tmp/352/.local/share/gvfs-metadata/uuid-e4dffbb8-6a22-4ae5-99a7-11d3734976c3-b71ca6c5.log
>> gvfsd-met 10600 justa mem REG 254,5 696 49235
>> /media/tmp/352/.local/share/gvfs-metadata/uuid-e4dffbb8-6a22-4ae5-99a7-11d3734976c3
>> gvfsd-met 10600 justa 9r REG 254,5 696 49235
>> /media/tmp/352/.local/share/gvfs-metadata/uuid-e4dffbb8-6a22-4ae5-99a7-11d3734976c3
>> gvfsd-met 10600 justa 10u REG 254,5 32768 49238
>> /media/tmp/352/.local/share/gvfs-metadata/uuid-e4dffbb8-6a22-4ae5-99a7-11d3734976c3-b71ca6c5.log
>>
>> $ gvfs-mount -l # extract follows:
>> Volume(3): 1.1 GB Volume
>> Type: GProxyVolume (GProxyVolumeMonitorUDisks2)
>> Mount(0): 1.1 GB Volume -> file:///media/tmp
>> Type: GProxyMount (GProxyVolumeMonitorUDisks2)
>>
>> $ gvfs-mount -ui /media/tmp/
>> Error unmounting mount: One or more programs are preventing the
>> unmount operation.
>>
>> WTFiretruck?
>
> :)
>
>
>
> Is that the process that shows how much space is available in the GNOME
> file manager widget?
No idea. I use the cmd line not a 'file manager'.
$ ps aux|grep 10600
justa 10600 0.0 0.0 132636 3704 ? Sl Feb24 0:00
/usr/lib/gvfs/gvfsd-metadata
$ man gvfs-metadata
No manual entry for gvfs-metadata
> You don't have your file manager attempting to display the contents of a
> drive you simultaneously want to unmount (and therefore not display, or
> it's free space) - do you?
I'm pretty sure not: besides the panel and plugins (I know, dirty,
dirty screen), I run sensors viewer, firefox and some xterms. It's
about as simple as it gets ('cept those dirty xfce4 panels!)
> ps aux | grep -i gproxyvol
Nope. Blank as it greps.
Reply to: