The autofs daemon can be used to mount remote file systems automatically. To do this, add the following entry in the your /etc/auto.master file:
Now the /nfsmounts directory acts as a root for all the NFS mounts on the client if the auto.nfs file is completed appropriately. The name auto.nfs is chosen for sake of convenience—you can choose any name. In the selected file (create it if it does not exist), add entries for all the NFS mounts as in the following example:
localdata -fstype=nfs server1:/data
nfs4mount -fstype=nfs4 server2:/
Activate the settings with rcautofs start. For this example, /nfsmounts/localdata, the /data directory of server1, is then mounted with NFS and /nfsmounts/nfs4mount from server2 is mounted with NFSv4.