Tuesday, March 27, 2007

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

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.

0 Comments: