[SOLVED]How to mount using gvfs/udisks

All Gurus once were Newbies
Forum rules
There are no such things as "stupid" questions. However if you think your question is a bit stupid, then this is the right place for you to post it. Please stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions prefer the other forums within the support section.
Before you post please read this

[SOLVED]How to mount using gvfs/udisks

Postby thkang on Thu Jul 25, 2013 9:47 pm

on most file managers (thunar, caja, nautilus), usually on the left pane, there are 'devices' group and 'network' group.
double-clicking an entry in any group will make that entry to be mounted.

'devices' group contains usb drives or partitions that aren't automatically mounted on boot.
they are mounted to /run/media/..
'network' group contains samba shares.
they are mounted to /run/user/USERNAME/gvfs/..

here's the question : What is the full command used by file managers to mount those drives/shares? I want to mount them as they are mounted by those file managers.
I know how to mount them with `mount` command but it requires root privilege unless I add 'user' option to an entry in /etc/fstab. And I can't add 'user' to all thumbdrives and samba shares on network.
Last edited by thkang on Fri Jul 26, 2013 7:26 am, edited 1 time in total.
IBM-Lenovo X201 Tablet + Samsung SSD 830 + Linux Mint 15 MATE
thkang
Level 1
Level 1
 
Posts: 16
Joined: Sun Aug 26, 2012 11:57 am

Linux Mint is funded by ads and donations.
 

Re: How do i mount as file manager does, in command-line?

Postby CaptainMark on Fri Jul 26, 2013 2:28 am

I believe the automounting on the system is handled by udisks instead of the mount command so check out "man udisks" in a terminal for some help with that, alternatively for better automatic control you should be looking at "man fstab" which is the boot mounting configuration. There are plenty of guides online for that so do a quick google and see how you get on

Quick Tip: Add the "noauto" option to a fstab line so it can be mounted by root at any time
Regards
Mark
CaptainMark
Level 2
Level 2
 
Posts: 80
Joined: Mon Nov 28, 2011 8:19 am

Re: How do i mount as file manager does, in command-line?

Postby altair4 on Fri Jul 26, 2013 6:51 am

To mount a samba share:
Code: Select all
gvfs-mount smb://server-name/share-name

To stick with the gvfs method, to mount a partition:
Code: Select all
gvfs-mount -d /dev/sdxy

But most folks mount partitions with udisks:
Code: Select all
udisks --mount /dev/sdxy
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.
altair4
Level 15
Level 15
 
Posts: 5523
Joined: Tue Feb 03, 2009 10:27 am

Re: How do i mount as file manager does, in command-line?

Postby thkang on Fri Jul 26, 2013 7:25 am

I did some searching on this myself. Thanks anyway for your comprehensive answers.

to mount partitions into /media/USERNAME (not /media), use udisksctl.

udisksctl mount -b /dev/sda1
udisksctl unmount -b /dev/sda1

Code: Select all
$ udisksctl mount -b /dev/sda1
Mounted /dev/sda1 at /media/thkang/xxx
$ udisksctl unmount -b /dev/sda1
Unmounted /dev/sda1.
IBM-Lenovo X201 Tablet + Samsung SSD 830 + Linux Mint 15 MATE
thkang
Level 1
Level 1
 
Posts: 16
Joined: Sun Aug 26, 2012 11:57 am


Return to Newbie Questions

Who is online

Users browsing this forum: No registered users and 23 guests