Você está na página 1de 4

~~~~~~~~~~~~~~~~ ~~ Configuring Auto FS ~~~~~~~~~~~~~~~~ ~~ Limitations of NFS ================== -Maintain a fstab file on all the clients.

-If server is unavailable which has reference in fstab the client hangs temporar ily until the mount request timeout. -Only root can mount the NFS file system ,if normal user want access to filesyst em the user must ask admin to mount / unmount the filesystem for them. Advantage of AutoFS =================== -AutoFS automatically mounts the filesystem on an as-needed bassis (without root assistance ).Filesystem managed by AutoFS can be removed from fstab. -The AutoFS configration files,known as AutoFS "MAPS" can be managed via NIS.Ins tead of managing fstab files on hundreds of individual hosts can easily manage by central NIS erver that stores the AutoFS maps. -Automatically unmounts file systems that are no longer being accessed. -May be configured to provide load balancing across multiple NFS servers. AutoFS Commands & Daemons (Commands -Automount ,daemon -automountd & autofs_p roc ========================= -The first step reqired to configure the AutoFS is to create the AutoFS map file s. -Anytime you modify the MAP files ,you must execute the command reads AutoFS maps ,then adds and remove AutoFS /etc/mnttab file.Note that automount does not actually simply responsible for ensuring that the AutoFS entries match the AutoFS maps. "automount" command.This entries in the mount any filesystem,it in the mnttab

-When a Processes attempts to access the AutoFS filesystem recorded in mount tab le,AutoFS contacts the automountd daemon. -When the AutoFS notifies the automountd daemon that an NFS filesystem is requir ed,automountd sends an NFS mount request to the appropriate NFS server. -Once the automountd mounts the needed file system ,the requesting process can a ccess the filesystem as it would any other filesystem -Autofs_proc kernel daemon monitors all the NFS filesystem mounted by AutoFS.if a file system is idle for for 5 mins autofs_proc notifies autmountd to umount the idle filesystem.The allowed idle time is configurable. Starting and Stopping AutoFS ============================ Enabling AutoFS => /etc/rc.config.d/nfsconf NFS_CLIENT=1 AUTOMOUNT=1 AUTOFS=1 AUTOMOUNT_OPTIONS="" -By default AutoFS automatically unmount the filesystem

that have been idle for 300 seconds,this cab be increased via "-t 600" AUTOMOUNTD_OPTIONS="" -Putting "-v -T" Enable verbose logging of all AutoFS mo unt and unmount requests in /var/adm/automount.log Starting AutoFS #/sbin/init.d/nfs.client start <or can be started manualy by issuing two comman ds.> #/usr/lib/netsvc/fs/autofs/automountd #/usr/sbin/automount -The first command start the automound daemon that generates mount request to th e NFS serve. -The second command copies the AutoFS map information to /etc/mnttab so automoun d knows which file system it is responsible for mounting. Stopping AutoFS =============== #/sbin/init.d/nfs.client stop or #ps -e | grep automountd #kill <pid> #/usr/sbin/unmountall -F nfs #/usr/sbin/unmountall -F autofs Checking AutoFS =============== #ps -e | grep -e automountd -e autofs_proc #mount -v Configuring the AutoFS master MAp ================================= -/etc/auto_master is a special map ,contains a catalog of mount mount directory followed by the names of the maps. Exmaple : /net -hosts -soft,nosuid ====> -hosts is a special map ,-soft option pr events users acess attempts from hanging if the NFS server is unreachable. /drawings /etc/auto.drawings ====> Indirect map /home /etc/auto.home //etc/auto.direct ====> Direct map If /etc/auto_master does not exist when AutoFS started , a minimal /etc/automast er file is created automatically with just one map entry i.e. /net -hosts -soft,nosuid Configuring the AutoFS -hosts map ---------------------------------Configuring the -hosts map allows user to automatically mount filesystems fron any NFS server just by accessing /net/servername -No need to issue mount command , no need to modify /etc/fstab Example : #mount -v -hosts on /net type autofs ignore,indirect,soft,nosuid #ll /net -- nothing appears total 0 if # ll /net/server1 -- it will mount all the available network filesystem autom

atically which are exported from server "server1" then check # mount -v -hosts on /net type autofs ignore,indirect,soft,nosuid server1:/home on /net/server1/home server1:/opt on /net/server1/net Configuring the AutoFS -Direct map ---------------------------------Use the direct map to automatically mount NFS file systems on multiple unrelated mount points. #more /etc/auto_master //etc/auto.direct /etc/auto.direct /usr/contrib/games /opt/tools /var/mail Client side mount points -ro -ro -rw Mount options gamesvr:/usr/contrib/games toolsvr:/opt/tools mailsvr:/var/mail NFS server Sources

#mount -v <when NFS filesystem is not access it will shows the contents of aut o.direct,when we access any filesystem mentioned in map mount -v will shows that the file system is mounted > Configuring the AutoFS -Indirect map ------------------------------------Use indirect maps to automatically mount multiple file systems under a common p arent directory. #vi /etc/auto_master /drawings /etc/auto.drawings #vi /etc/auto.drawings gizmos -ro gizmosvr:/drawings/gizmos gadgets -ro gadgetsvr:/drawings/gadgets widgets -ro widgetsvr:/drawings/widgets Accessing NFS filesystem will mount the NFS filesystem under /drawing #ll /drawings/gizmos #mount -v /etc/auto.drawings on drawings type autofs ignore,indirect gizmosvr:/drawings/gizmos on /drawings/gizmos type nfs Compareing Direct and Indirect map : --------------------------------------------------------------------------------------------Direct Maps | Indirect Maps | --------------------------------------------------------------------------------------------Direct mounted file system mount | Indirect mounted file systems onl y become | points are always visible to users | visible after being accessed | --------------------------------------------------------------------------------

-------------Direct mounted and local file systems | Inirect mounted and local file s ystems | may co-exist in the same parent directory | may not co-exist in the same par ent directory| --------------------------------------------------------------------------------------------Large direct maps quickly lead to | Each indirect map yields just on e entry | cluttered mount tables | in the mount table. | --------------------------------------------------------------------------------------------The automountcommand must be executed every | AutoFS automatically recognizes | time the direct map changes | indirect map changes | --------------------------------------------------------------------------------------------Troubleshooting AutoFS ----------------------Verify that /etc/rc.config.d/nfsconfis configured properly. -Verify that the AutoFS daemons are running. -Verify that the AutoFS maps are configured properly. -Verify that DNS resolves the NFS server's hostname properly. -Verify that you have network connectivity to the NFS server. -Verify that the NFS server daemons are running. -Verify that the NFS server has exported the file systems in question. -Consider stopping and restarting AutoFS. -Consider enabling AutoFS logging. -Determine if the NFS server is overloaded. Comparing AutoFS with Automounter --------------------------------Automounter will not be supported in future HP-UX releases Automounter doesn't support NFSv3 Automounter direct maps may cause "mount storms" Automounter mounts file systems in /tmp_mnt Automounter must be restarted when the master or direct maps change

Você também pode gostar