Re: open files/ forcing dismount
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.
>
> $ 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?
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?
ps aux | grep -i gproxyvol
>
> Of course a reboot would work, but that' just not the GNU way! :)
>
> Craziness ending suggestions REALLY appreciated,
> Zenaan
>
>
Kind regards
Reply to: