Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have an NFS server with a directory which contains a dozen other local filesystems. I'd like to mount the top-level directory on the server, and have the Linux client automatically mount the right filesystems inside that directory, so that the client sees the same directory structure that exists on the server.

I believe what I was asking about was a "recursive mount" type of thing where multiple filesystems could be mounted in a nested fashion on a client. Perhaps this is only an NFSv4 feature. The "nohide" option seems to trick the client into thinking all filesystems are a single mount-point, which is not what I was looking for, but perhaps it's good enough.

share|improve this question
1  
huh? not quite sure what you mean. could you provide more information, maybe draw a diagram? –  sybreon Sep 9 '11 at 0:37
1  
Does it not work to add the top level directory to /etc/exports? –  Matt Sep 9 '11 at 1:26
add comment

2 Answers 2

You may want to look into the nohide NFS export option to recursively mount filesystem hierarchies. This is assuming the NFS exports are from a Linux system (versus a filer or NAS) and that you're interested in mounting its mounts to your client.

Also see: http://www.digspace.org/linux/7-linux-nfs-nohide

share|improve this answer
add comment

Additionally to using the nohide option in the /etc/exports file on the NFS server as has been suggested in the previous answer is using the package autofson the clients which might be interesting to those not knowing that package yet.

Doing this is simple:

  1. Install the package autofs on each client using a package manager
  2. Afterwards edit the client configuration file /etc/auto.master and remove the comment sign (#) from the line containing /net/;
  3. Save the configuration file and
  4. Restart the autofs service on the client.

    On older Linux distributions this is done using:

    # /etc/init.d/autofs restart
    

    and or more recent distributions this is done using:

    # service autofs restart
    
  5. After that you could change directory (cd /net/NFS_SERVER_HOSTNAME/) and should see all your sub directories (local filesystems) as long as they are listed in the /etc/exports file on the NFS server. So the entries in /etc/exports control which of the local filesystems should be available for mounting on the clients.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.