In nautilus, a disk can be mounted by mouse click, the results are

  • format(NTFS) is recognized correctly
  • read/write are permitted by non-root user

You can also umount a disk without root permission in nautilus.

How to simulate these mount/umount operations in nautilus with shell commands?


Nautilus uses gvfs to mount those locations. From the command line:

gvfs-mount smb://server/share mountpoint

Thanks to jordan for pointing out that nautilus uses gvfs

  gvfs-mount [OPTION...] [LOCATION...]

Mount the locations.

Help Options:
  -h, --help                      Show help options

Application Options:
  -m, --mountable                 Mount as mountable
  -d, --device=DEVICE             Mount volume with device file
  -u, --unmount                   Unmount
  -e, --eject                     Eject
  -s, --unmount-scheme=SCHEME     Unmount all mounts with the given scheme
  -f, --force                     Ignore outstanding file operations when unmounting or ejecting
  -a, --anonymous                 Use an anonymous user when authenticating
  -l, --list                      List
  -o, --monitor                   Monitor events
  -i, --detail                    Show extra information
  --version                       Show program version

Find mounted devices and their mount points:

gvfs-mount -l -i

Look for:

unix-device: '/dev/sdc1'
Mount(0): USBNAME -> file:///run/media/username/USBNAME

Unmount the device:

gvfs-mount -u -i /run/media/username/USBNAME

Mount the device:

gvfs-mount -d /dev/sdc1
  • 1
    What about mounting? – Boris Jul 20 '19 at 3:52
  • To mount a device: gvfs-mount -d /dev/sdc1 – The Demz Jul 20 '19 at 9:54

You can use pmount, an application that allows normal users to mount removable devices:

pmount /dev/sda2 mydevice

I belive Nautilus uses udisks for things like removable media:

udisks --mount /dev/sdc1

Use man udisks for several other commands.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.