6

Ubuntu 16.04. I want to know in what point of the file system tree does Nautilus file manager mounts the ftp/smb connections. I thought it could be on the same directory where external storage devices get mounted, namely /media/my_user/disk or /run/media/my_user/disk, but it is not there.

I tried to look it up on Nautilus documentation but I couldn't find anything.

I ran df -h to look up for the mount point and this is what I got:

Filesystem      Size  Used Avail Use% Mounted on
udev            3.9G     0  3.9G   0% /dev
tmpfs           785M  9.5M  775M   2% /run
/dev/sda5        64G   50G   11G  83% /
tmpfs           3.9G  114M  3.8G   3% /dev/shm
tmpfs           5.0M  4.0K  5.0M   1% /run/lock
tmpfs           3.9G     0  3.9G   0% /sys/fs/cgroup
/dev/sda2        96M   29M   68M  30% /boot/efi
tmpfs           785M   80K  785M   1% /run/user/1000

So I'm guessing it is not getting mounted as a 'normal' disk.

If my knowledge about linux systems isn't mistaken, everything that I can see in my file system is mounted on the same tree. Is it somehow different when it comes to a connection to a server made by the default file manager?

3

As @grawity mentiones in his comment, the root for the child folders mounting is in:

/run/user/$UID/gvfs

You can find out the exact location by saving an HTML file such as an empty index.html and trying to open if from nautilus (or nemo). In the browser you'll see:

file:///run/user/$UID/gvfs/ftp:host=<host>,user=<user>/index.html

with filled out parts for your UID and FTP details. From there you can navigate to the parent of FTP folder and there specifically you can distinguish multiple FTP connections (and perhaps even SMB, though I don't have anything to test) in this pattern:

/run/user/$UID/gvfs/ftp:host=<host>,user=<user>

# escape before using in terminal
cd /run/user/$UID/gvfs/ftp\:host\=<host>\,user\=<user>

And with it I could run e.g.:

grep -r pattern .

though it is extremely slow due to FTP limitation and if you even have the speed capped you can go get a coffee or lunch even. In case you have some compressing option available for the files on your server via some FTP web client (running on that server), compress the files first and pull them locally.

1
  • Well done! @freddieRV It should be accepted as answer. – loved.by.Jesus Aug 22 '19 at 12:59
0

It is actually the last tmpfs in the list you provided. If you navigate to "/run/user/1000/" you will be in the smb folder. Or, at least smb connections mount in the /run/user/ folder. After I connected to my smb share, I ran df -h and found that mine mounted under /run/user/999/.

Now you can do symbolic links to make the /run/user/ sub-folder go to the /media/ location, but that would look like /media/1000, in this case.

I'm not one for writing a script to make changes to the system just for convenience either; so if you need a smb/ftp share accessible at all times, then I would write an entry to fstab and mount to an easily accessible location.

4
  • I doubt it. I think /run/user/1000/ is per-user tmpfs (ramdisk) mounted by systemd for user whose UID is 1000 (it's the OP in this case). When you install Ubuntu, the first regular user gets UID 1000. – Kamil Maciorowski Oct 5 '17 at 8:52
  • I see. OP needs to connect to share and check the location under /run/user/. When I ran my live boot, and connected to a share using nautilus, that is where it mounted. – tfrue Oct 5 '17 at 14:47
  • Thanks for the feedback guys. Indeed my UID is 1000. But the server connection is not mounted under /run/user/1000. I ran df before and after connection and both times the device is there, and both times there is nothing in it. – freddieRV Oct 5 '17 at 15:50
  • 2
    It's close enough – the location is /run/user/1000/gvfs, which is a FUSE mount that exposes all virtual Gvfs mounts inside. – user1686 Mar 23 '19 at 9:41
0

So I'm guessing it is not getting mounted as a 'normal' disk.

I think you're right. Nautilus probably "speaks" FTP or SMB protocol like ftp and smbclient command line tools do.

I cannot install nautilus at the moment and experiment with it but I found Connecting to a Samba Share document for CentOS. They use nautilus and I can see it supports addresses like smb:/// or smb://workgroup. I don't think you can mount these, it's just nautilus "talking" to servers and interpreting their responses (if any).

This seems to be perfectly reasonable approach. As a regular user you cannot mount freely, still you can initiate connections. It's easier to "speak" a protocol than to mount. Notice in the linked document there's also a separate section named "Mounting the Share" where they mount as root.

You mentioned external storage devices being mounted in /media/. The situation is different with them because as a regular user you neither can freely mount nor access block devices (e.g. /dev/sdc). "Speaking" protocol in this case would mean accessing the device directly and interpreting its content (filesystem) but regular users can't read nor write /dev/sdX. Some kind of helper is required. I believe in Ubuntu udisks2 and related tools do the job.

I don't know if you can easily mount network shares with these tools. This question seems the right one but there are no answers yet (2017-10-05).

1
  • Thanks for the feedback. I think you're right too. I guess it is not being mounted at all, as it happens with other programs like Filezilla, you can access the file system of the server you're connected to, but you cannot see it outside of Filezilla. In the link you provided, the section about mounting the share doesn't have much to do with Nautilus itself. That makes sense since if you mount a smb or ftp (if possible) connection, of course you'll be able to see it on your file manager. – freddieRV Oct 5 '17 at 16:20

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.