Linux – Where does Nautilus file manager mounts ftp/smb connections

ftplinuxnautilusUbuntu

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?

Best Answer

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.

Related Question