Location of network mounted directories in local filesystem

Do network mounted shares have a mount point location in the local filesystem?

For example, after mounting a samba share in a file browser (Caja) Network location, the address bar will show something like smb://[server]/[share].

How can I access that share from the terminal? I looked in places like /mnt/ and /run/media/[username]/ but couldn’t find it.

2 Likes
/run/user/${UID}/gvfs
2 Likes

Thanks, that’s it!

Now, when I try to mount a disk image on that samba share with mount [PATH] /mnt/image -o loop, it complains with mount: /mnt/image: failed to setup loop device for [...]. However, if I copy the image file to the local filesystem, it mounts fine. Any idea why?

1 Like

Hmm… maybe that is the issue, but I have the same error if I try the mount command as my user, without root or sudo. Is this expected?

That’s kernel space.

Instead, you should utilize user space tools:

gio mount sftp://vglaptop.local/
gio open /run/user/${UID}/gvfs/sftp:host=vglaptop.local${HOME}/Public/Fedora-Everything-netinst-x86_64-32/Fedora-Everything-netinst-x86_64-32-1.6.iso

Actually, it’s much easier to perform with a file manager like Nautilus.
Just make sure the MIME-types are configured properly.

Yes, it is easy with a file manager including Caja, which does this automatically in the background. But I am trying to mount a disk image that is stored on a network share to a local mount point to examine, via CLI.

I thought gio mount might be relevant, but it did not work. If the location is already mounted in a file manager:
gio mount /run/user/1000/gvfs/smb-share:server=[IP]\,share=[share]/[PATH]/[image.img] /mnt/image

gio: file:///mnt/image: volume doesn’t implement mount
gio: smb://[IP]/[share]/[PATH]/[image.img]: Location is already mounted

And if I first unmount the share from the file manager:

gio: file://[IP]/[share]/[PATH]/[image.img]: volume doesn’t implement mount
gio: file:///mnt/image: volume doesn’t implement mount

/mnt/image has 774 permissions.

gio open works for ISO images:

> xdg-mime query filetype ~/Public/Fedora-Everything-netinst-x86_64-32/Fedora-Everything-netinst-x86_64-32-1.6.iso
application/x-cd-image

> xdg-mime query default application/x-cd-image
gnome-disk-image-mounter.desktop

> grep -e ^Exec= /usr/share/applications/gnome-disk-image-mounter.desktop
Exec=gnome-disk-image-mounter %U

So, you can call it like this:

gnome-disk-image-mounter /run/user/${UID}/gvfs/...

error

In this case it’s not ISO images, but dd images of partitions.

Most likely the file systems on these partitions require drivers running in kernel space.

ext4 filesystem as identified by file.

Anyway, this has turned into a different problem that might need it’s own thread. Thanks for solving the original question so quickly.

1 Like