Enable automount on HP-UX
Monday, September 14, 2009 5:45:37 PM
NFS_CLIENT=1 # 1 if this node is an NFS client, 0 if not AUTOFS=1 # 0 do not start AutoFS; 1 start AutoFS.
Second start NFS client and automountd.
# /sbin/init.d/nfs.client stop killing biod killing automountd # /sbin/init.d/nfs.client start starting NFS CLIENT networking starting up the rpcbind rpcbind already started, using pid: 812 starting up the BIO daemons /usr/sbin/biod 16 starting up the Status Monitor daemon rpc.statd already started, using pid: 900 starting up the Lock Manager daemon rpc.lockd already started, using pid: 906 Starting up the AutoFS daemon /usr/sbin/automountd Running the AutoFS command interface /usr/sbin/automount mounting remote NFS file systems ... mounting CacheFS file systems ... # ps -ef|grep -i automountd |grep -v grep root 3727 1 0 16:16:33 ? 0:00 /usr/sbin/automountd
Third we should create automount map file to tell automountd which remote shares we want to mount.There are two kinds of AutoFS map file we can use. One is direct map and the other is indirect map. Generally speaking, the indirect map is better than a direct map because an indirect map is more flexible to modify when AutoFS is running. Another reason of using an indirect map is to avoid mount storms in a directory when many AutoFS mounts point.
1. Using indirect map
create a file named auto_test in /etc
testfile -nosuid sol10iv:/space/test installer -nosuid lotus:/space/Installeredit the master map file /etc/auto_master
After we modify the master map file, we can issue the following command to let auotmountd to reload the master map file.
/usr/sbin/automountAfter done. The folder under lotus:/space/Installer will be shown under /home/tony/installer on the local machine.
2. Using direct map
create the direct map file in /etc and name it as auto_direct.
/space/test/f1 -nosuid sol10iv:/space/test /space2/test/f2 -nosuid lotus:/space/Installeredit the master map file /etc/auto_master
/- /etc/auto_directAfter we modify the master map file, we can issue the following command to let auotmountd to reload the master map file.
/usr/sbin/automountAfter done. The folder under sol10iv:/space/test will be shown under /space/test/f1 on local machine. and the folder under lotus:/space/Installer will be listed under /space2/test/f2 on local machine.
Beside these above, we should decide to automount all exported directories from any host using the -hosts map. To edit /etc/auto_master and add the entry as the following:
/net -host -nosuid,soft,nobrowseAfter done. All shares on sol10iv will be shown in /net/sol10iv on local. All shares on lotus will be listed in /net/lotus on local.