Mounting NFS File Systems Via Nautilus On CentOS 6

Home » CentOS » Mounting NFS File Systems Via Nautilus On CentOS 6
CentOS 5 Comments

Hi,

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
/net/server/directory
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?idS6292, 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.

Thanks,

– Toralf

5 thoughts on - Mounting NFS File Systems Via Nautilus On CentOS 6

  • You probably didn’t read my post properly.

    Part of what I’m saying is that autofs is set up out-of-the box to mount the filesystem. However, to access the area, I have to type in the full path all the time, which is rather tedios. I’d like to bookmark the location, but the problem is that Nautilus apparently keeps accessing all bookmarked folders to check status or something, which in practice means autofs will try to keep the filesystem mounted at all times –
    which I don’t want.

    – Toralf

  • Looks like Nautilus is periodically ‘stat’-ing the bookmark location.

    How about making a softlink to the target dir in your home directory, then bookmarking the link in nautilus. Hopefully Nautilus will stat the link and not the target then.

    K

  • Sorry about that, I clearly missed quite a lot of your post.

    I think a symlink is your only option, if you can’t cope with autofs mounting it when you don’t want it (or failing to mount it). Depending on your reasons for not liking it trying to mount, you may find BROWSE_MODE with autofs satisfies Nautilus when the mount is unavailable.

    jh

  • Yep.

    I’m wondering if this should be reported as a bug. I really think it ought to leave the bookmarks alone until you actually try to access them.

    I’ve been away for some days, so I haven’t been able to test this until now…

    Anyhow, I like the idea, but it looks like it doesn’t actually work. I
    guess Nautlius will also “follow” links when it does whatever it is it wants to do with the bookmarks, so that bookmarking a link has the same effect as bookmarking the target location :-(

    Another observation is that bookmarks for remote locations in URL form
    (smb://…, ftp://… etc.) will not be accessed in the same manner, so I’m thinking that the problem would be solved if I could trick the system into thinking the autofs mount point is one of those. (It *is* a remote location, of course, but not in the same way…) I have no idea how this might be done, however.

    – Toralf

LEAVE A COMMENT