unmounting block devices is confusing
Submitted by Martin Pitt
Assigned to gvf..@..e.bugs
Link to original bug (#683038)
Description
I've just struggled a bit with trying to unmount an USB stick partition with gvfs-mount. --help leaves it a bit unclear whether -d just specifies a device, or also specifies "mount this":
-d, --device=DEVICE Mount volume with device file -u, --unmount Unmount
so my first approach was
$ gvfs-mount --unmount --device /dev/sdb1 Error mounting /dev/sdb1: Device /dev/sdb1 is already mounted at `/media/martin/4805-C45B'
So apparently that tried to mount, not unmount. This felt like a bug at first, if this is intended, "--device" is a confusing name IMHO.
When trying without -d, it does not look much better:
$ gvfs-mount -u /dev/sdb1 Error finding enclosing mount: Containing mount does not exist
Which does not tell me much either.
What does work is to grab the URI from gvfs-mount -li, and using that:
$ gvfs-mount -u file:///media/martin/4805-C45B
This is at least an usability bug, but if it's meant to work like this there is no way to unmount by device file. I'd like to improve this.
What would you prefer? Making "-u -d /dev/..." work and update the description of -d? Or making "-u /dev/..." do what I mean? Or at least improve the help text to point out that "-d" is an operation, not just a device specification, and unmount works with URIs?
Version: git master