NFS mount issue

Darryl Moore darryl at moores.ca
Mon Jun 15 13:48:49 UTC 2009


Hey all. Any pros on NFS out there?

I'm trying to put together a setup for laptops such that when the laptop
is connected to the network the network mounted NFS /home directory will
appear, but when the laptop is away from the network, the local /home
directory will appear.

I tried having two seperate home directories specified in the
authentication system. I.E. /home/user in the network LDAP server, but
/local_home/user in the laptop passwd file. Somehow I was unable to get
this to work. The LDAP server always yield to the local system even when
/etc/nsswitch.conf specified "passwd: ldap files" instead of "passwd:
files ldap".

What I am considering now is having multiple mounts on top on the local
/home directory. I.E. make fstab look like this

/local_home   /home   bind bind 0 0 # move local home directory to where
we expect to see it
server:/export/home  /home nfs auto 0 0 # our network home directory


This should move the local home tree to /home where we want to see it
when there is no network. It will also move server:/export/home to the
same place when the network is present. This way (hopefully)  preference
is given to the server home directory, but the local home directory will
still be accessible.

This requires the directories to be mounted in the right order. I do not
know if there are nasty side effects to having the two mounts on the
same directory or not, but it seems to work in my initial testing.
Anybody done anything like this????






More information about the ubuntu-ca mailing list