AutoFS
7:45 PM
The automount/autofs comonly used to
implement the roaming home directory in Linux/Unix environment with NIS.
but there are other uses also it can be used to mount any directory
dynamically when and where required
Autofs uses the automount daemon to manage the mount points by only mounting them dynamically when they are accessed. Autofs reads the master map configuration file "/etc/auto.master" to determine which mount points are defined and then starts an automount process with the appropriate parameters for each mount point.
The /etc/auto.misc file define mount points /misc directory; this relationship would be defined in the /etc/auto.master file.
The auto.master file has three fields.
- First field defines a directory where the mount point should be created.
- Second field is the location of the map file(/etc/auto.misc),
- And the third field is optional. The third field can contain information such as a timeout value.
For example, to mount the directory /project from the remote machine abc.xyz.com at the mount point /misc/myproject_nfs on local machine:
The first field in /etc/auto.misc is the name of the /misc
subdirectory. This directory is created dynamically by automount. It
should not actually exist on the client machine. The second field
contains mount options such as rw for read and write access. The third
field is the location of the NFS export including the hostname and
directory.
Now start/restart the autofs service:
/sbin/service autofs restart
Do a listing:
ls -l /misc/myproject_nfs
Mount points configured with autofs will appear only when they are accessed.
Autofs uses the automount daemon to manage the mount points by only mounting them dynamically when they are accessed. Autofs reads the master map configuration file "/etc/auto.master" to determine which mount points are defined and then starts an automount process with the appropriate parameters for each mount point.
The /etc/auto.misc file define mount points /misc directory; this relationship would be defined in the /etc/auto.master file.
The auto.master file has three fields.
- First field defines a directory where the mount point should be created.
- Second field is the location of the map file(/etc/auto.misc),
- And the third field is optional. The third field can contain information such as a timeout value.
For example, to mount the directory /project from the remote machine abc.xyz.com at the mount point /misc/myproject_nfs on local machine:
Add the following line to auto.master:
/misc /etc/auto.misc --timeout 60
Add the following line to /etc/auto.misc:
myproject_nfs -rw,soft,intr,rsize=8192,wsize=8192 abc.xyz.com:/project
/misc /etc/auto.misc --timeout 60
Add the following line to /etc/auto.misc:
myproject_nfs -rw,soft,intr,rsize=8192,wsize=8192 abc.xyz.com:/project
Now start/restart the autofs service:
/sbin/service autofs restart
Do a listing:
ls -l /misc/myproject_nfs
Mount points configured with autofs will appear only when they are accessed.
0 comments