How to mount from command line like the Nautilus does?
What you are looking for is gio mount
(it recently replaced gvfs-mount
, which replaced gnome-mount
).
There is a man page here or you can just type gio help mount
for the details
The basic usage is:
gio mount --list --detail
to get a list of mounted and mountable volumes
gio mount [-u] <volume>
to [un]mount it, e.g. gio mount smb://server/share
or gio mount WINDOWS
.
Sadly, there seems to be a bug that results in a "Error mounting location: volume doesn't implement mount" message trying to mount by volume name, but gvfs-mount -d /dev/<devicename>
might work.
In modern distributions, HAL is no longer used. The pmount
still exists, but it is deprecated. Use:
udisks --mount /dev/sdXN
Answer Update:
The udisksctl
command is being used as an alternative to the udisks
command. This can be used the same way, -b
is just to be appended to define the block device.
udisksctl mount -b /dev/sdXN