Rate this page del.icio.us  Digg slashdot StumbleUpon

How do I mount an NFSv4 filesystem in two locations on a single client?

by

Contributed by Andrew Ryan

Release Found: Red Hat Enterprise Linux 5

It is not possible to directly mount an NFSv4 filesystem in two locations on the same client. Instead, the same functionality can be achieved by using a bind mount to mount the first mount point at a second location. In order to achieve this:

  1. Create a mount point:
    [root@host]# mkdir /mnt/nfs4
    
  2. Mount the server unto the mount point:
    [root@host]# mount -t nfs4 server:/ /mnt/nfs4
    
  3. The NFSv4 filesystem is now mounted at /mnt/nfs4. If it is necessary to mount this filesystem at another location, a bind mount must be used:
    [root@host]# mkdir /mnt/other_location
    [root@host]# mount --bind /mnt/nfs4 /mnt/other_location
    

    The NFSv4 filesystem is now mounted (via a bind mount) at /mnt/other_location.

Red Hat’s customer service and support teams receive technical support questions from users all over the world. Red Hat technicians add the questions and answers to Red Hat Knowledgebase on a daily basis. Access to Red Hat Knowledgebase is free. Every month, Red Hat Magazine offers a preview into the Red Hat Knowledgebase by highlighting some of the most recent entries.

3 responses to “How do I mount an NFSv4 filesystem in two locations on a single client?”

  1. Bob Chiodini says:

    Could you accomplish the same thing with a link from the original mount point to the “other” mount point?

  2. Joe Smith says:

    Using a –bind mount work when you’re doing things like chroot; symlinks do not.

  3. Society says:

    Could you accomplish the same thing with a link from the original mount point to the “other” mount point?