How can I easily turn a network mount in Nautilus into an fstab entry?

So I have navigated to the network share via Nautilus, but now I want to make it a permanent mount that is maintained between reboots. How can I easily add this share to the /etc/fstab file?

By easy I mean right clicking on the share I want to link in and choosing something like "Map Network Drive"! I don't know the details of the machine that holds this share and that is why I have been using Nautilus to browse the network for it. Right clicking on the share in Nautilus and viewing properties does not seem to give me enough information for an fstab entry.

Please can you tell me how to achieve this?


Solution 1:

It sounds like what you actually want is the ability to quickly access a particular network mount? If so, simply right-click on the network mount and select "Add Bookmark", you'll then be able to access that mount from the bookmark link on subsequent boots.

That is a much safer option that modifying your systems /etc/fstab file: if /etc/fstab gets corrupted, you may end up with a system that won't boot. And even if you do update /etc/fstab correctly for the mount in question, you will potentially impact boot performance by specifying a network (non-local) mount there.

If you really, really want to update /etc/fstab, there is a command-line tool that will show mount details for nautilus mounts:

gvfs-mount -l

Or for more details:

gvfs-mount -li

Solution 2:

You can browse all Nautilus mounts via the command line. No need to create an fstab entry. Run mount to view all filesystem mount locations (including Nautilus ones).

In the case of network Samba mounts I found that Nautilus puts them all under a common gvfs mount point. Run mount | grep gvfs. For me the location was /run/user/leif/gvfs/ and inside were my Samba mounts.