[CentOS] Mounting NFS file systems via Nautilus on CentOS 6

Sat Jul 11 10:16:03 UTC 2015
Toralf Lund <toralf.lund at pgs.com>


I'm trying to set up my "work" laptop, which has CentOS 6.6, for easy 
NFS access to a "NAS" disk at home. I can't set for a normal "permanent" 
mount, since most of the time, the filesystem will not be available. I 
know several different ways to mount temporarily from the command line, 
but I was hoping I could set up the system so I could mount by clicking 
in the file browser (Nautilus.) I can't seem to find a way to do this, 
though. I've tried two different approaches:

 1. Add an entry of the form
    server:/directory       /directory                  nfs rw,users,noauto
    to /etc/fstab.
 2. Add a location of the form
    to Bookmarks - as the filesystem is mounted automatically when
    entering this location, provided that autofs is enabled with the
    default configuration.

Unfortunately, neither of these methods work out quite right. Setting up 
fstab as outlined in 1. means that I can mount the filesystem as a 
regular user by issuing "mount /directory", but I can't find a direct 
way to issue this command from the GUI: I actually thought a relevant 
entry would show up just like that under Places and/or computer:///, but 
apparently not. This could be related to what's described in 
https://bugzilla.gnome.org/show_bug.cgi?id=536292, although it mentions 
that the problem is fixed in GNOME 2.28, and I thought the CentOS 6 had 
a newer version than that.

Method 2. does cause the filesystem to be mounted, but the problem is 
that it happens too often. The idea was of course that the mount would 
occur when selecting the bookmark, but it looks like Nautilus will 
actually try to access the location before that, so that the filesystem 
pretty much stays mounted at all times. If the disk is available, that 
is, I haven't tested yet what happens when it isn't, but others with 
different Linux variants report that Nautlius will lock up completely 
because it can't get data for the location.

So, does anyone have any idea how to best set up the system do to what I 
want (see above)? I guess I might create special "mount" and "unmount" 
launchers, but I'd prefer a solution that's more integrated with the 
normal file browser operation.


- Toralf