home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / unix / aix / 8837 < prev    next >
Encoding:
Internet Message Format  |  1992-08-15  |  21.5 KB

  1. Path: sparky!uunet!usc!cs.utexas.edu!ut-emx!ibmchs!auschs!awdprime.austin.ibm.com!ekhadafi.austin.ibm.com!curt
  2. From: curt@ekhadafi.austin.ibm.com (Curt Finch 903 2F021 curt@aixwiz.austin.ibm.com 512-838-2806)
  3. Newsgroups: comp.unix.aix
  4. Subject: Re: automount docs
  5. Message-ID: <1992Aug14.133848.8360@awdprime.austin.ibm.com>
  6. Date: 14 Aug 92 13:38:48 GMT
  7. References: <4636@d75.UUCP>
  8. Sender: news@awdprime.austin.ibm.com (USENET News)
  9. Organization: IBM AWD, Austin
  10. Lines: 557
  11.  
  12. >A mass clamor will result in them being posted here
  13.  
  14. Geez, I think got enough msgs to qualify for mass clamor status.
  15.  
  16. If you have suggestions or find bugs in the docs let me know and
  17. I'll try to get it fixed.  With bugs in the code you have to call
  18. defect support and open a PMR/APAR.
  19.  
  20. _____________________________________________________________________
  21.  
  22.  
  23. automount Daemon
  24.  
  25. Purpose
  26.  
  27. Mounts NFS file systems automatically.
  28.  
  29.  Syntax
  30.  
  31. /usr/sbin/automount  [  -m  -n  -T  -v  ] [  -D  name=value ] [   -f
  32. MasterFile  ] [  -M  MountDirectory ] [  -tl  Duration ] [   -tm
  33. Interval ] [   -tw Interval ] Directory ... MapName ...   [
  34. -MountOption [  ,MountOption ] ... ]
  35.  
  36. Description
  37.  
  38. The automount  daemon automatically and transparently mounts an NFS
  39. file system whenever a file or directory in that file system is
  40. opened.  The automount daemon forks a child process daemon, which
  41. appears as an NFS server to the client.  The forked daemon monitors
  42. attempts to access file systems that are associated with an automount
  43. map.  When a file is accessed, the daemon mounts the appropriate NFS
  44. directory.  A map is assigned to a directory either by using an entry
  45. in a direct automount map, or by specifying an indirect map on the
  46. command line.
  47.  
  48. Maps
  49.  
  50. The automount  daemon uses maps to locate an appropriate NFS file
  51. server and exported file system, and to determine mount options.  The
  52. daemon mounts the file system in a temporary location, creating a
  53. symbolic link to the temporary location.  If the file system is not
  54. accessed within a given interval (five minutes, by default), the daemon
  55. unmounts the file system and removes the symbolic link.  If the
  56. indicated directory has not already been created, the daemon first
  57. creates it, then removes the directory upon exiting.
  58.  
  59. A map can be a file or a Network Information Service (NIS ) map.  If a
  60. file is supplied, the map argument must be a full path name.
  61.  
  62. If the directory argument supplied to the automount daemon is a path
  63. name, the map argument must be an indirect map.  In an indirect map,
  64. the key for each entry is a simple name that represents a symbolic link
  65. in a directory to an NFS mount point.
  66.  
  67. If the directory argument is /- (slash, minus), the map that follows
  68. must be a direct map.  A direct map is not associated with a single
  69. directory.  Instead, the key for each entry is a full path name that
  70. serves as a symbolic link to an NFS mount point.
  71.  
  72. Updates to an automount map are transparent to the users because
  73. name-to-location binding is dynamic.  This process eliminates the need
  74. to pre-mount shared file systems for applications containing hard-coded
  75. references to files.
  76.  
  77. See   "How to Manage NIS automount Maps" for more information about
  78. formatting map entries, multiple mounts, special maps, and the
  79. auto.master NIS configuration map file.
  80.  
  81. Mounts
  82.  
  83. Warning: Do not terminate the automount daemon with the kill -9
  84. command.  This procedure does not permit the daemon to unmount itself,
  85. which causes the kernel to interpret automount mounts as an NFS server
  86. that is not responding.  Terminate automount services by sending the
  87. kill -15 command to the daemon.  This method allows the automounter to
  88. first receive the signal, then unmount its daemon and evaluate any
  89. mount points in the /tmp_mnt file.  Mounts in the /tmp_mnt file that
  90. are busy will not be unmounted.
  91.  
  92. The -MountOptions argument is a list of mount options.  The list is
  93. preceded by a - (minus sign), and each option is separated by a comma.
  94. If this argument is supplied, the options usually become the default
  95. mount options for all entries in the map.
  96.  
  97. Notes:
  98.  
  99. 1. Mount options provided in a map entry override the -MountOptions
  100. argument.
  101.  
  102. 2. The   mount command's bg background mount option is not recognized
  103. by the automount daemon.
  104.  
  105. The automount  daemon is single-threaded.  Any request delayed by a
  106. slow or unresponsive NFS server delays all subsequent automatic mount
  107. requests until the initial request completes.  Programs that read the
  108. /etc/mtab file and then touch files that reside under automatic mount
  109. points introduce further entries to the file.  Automatically mounted
  110. file systems are mounted with the mount command's -t  type option set
  111. equal to ignore.  These file systems do not appear in the output of
  112. either the mount command or the   df command.
  113.  
  114. Environment Variables
  115.  
  116. Environment variables, specific only to the automount daemon, can be
  117. used in an automount map.  When the daemon encounters an automount
  118. variable, the environment expands to account for the new variable.
  119. Environment variables are valid only for the automounter's environment,
  120. not for the operating system's environment.
  121.  
  122. References can be protected from affixed characters by enclosing the
  123. variable name in { } (curly braces).
  124.  
  125. Note: Some NFS servers support mount options not supported by the AIX:
  126. grpid, noauto , remount, quota, noquota, posix, nocto, and noac. By
  127. default, the AIX version of the automount  daemon ignores these listed
  128. options.  To reverse the effect of this default, use the
  129. AUTOMOUNT_BAD_OPTS  shell environment variable.
  130.  
  131. Configuration
  132.  
  133. The automount daemon normally consults the auto.master  NIS
  134. configuration map for a list of initial Directory-to-MapName pairs, and
  135. sets up automatic mounts for them in addition to those given on the
  136. command line.  If there are duplications, the command-line parameters
  137. take precedence.
  138.  
  139. Note: This map contains the automount daemon parameter.  The automount
  140. daemon does not look for an auto.master file on the local host.
  141.  
  142. See   "How to Manage NIS automount Maps" for more information about
  143. configuring the auto.master NIS map file.
  144.  
  145. Flags
  146.  
  147. -Denvar =value Assigns a value to the indicated automount command
  148. environment variable.
  149.  
  150. -f MasterFile Reads the named local file, rather than the auto.master
  151. NIS map file, for initialization.
  152.  
  153. -m  Suppresses initialization of directory-mapname pairs listed in the
  154. auto.master NIS database.
  155.  
  156. The automount  daemon is single-threaded.  Any request delayed by a
  157. slow or unresponsive NFS server delays all subsequent automatic mount
  158. requests until the initial request completes.  Programs that read the
  159. /etc/mtab file and then touch files that reside under automatic mount
  160. points introduce further entries to the file.  Automatically mounted
  161. file systems are mounted with the mount command's -t  type option set
  162. equal to ignore.  These file systems do not appear in the output of
  163. either the mount command or the   df command.
  164.  
  165. Environment Variables
  166.  
  167. Environment variables, specific only to the automount daemon, can be
  168. used in an automount map.  When the daemon encounters an automount
  169. variable, the environment expands to account for the new variable.
  170. Environment variables are valid only for the automounter's environment,
  171. not for the operating system's environment.
  172.  
  173. References can be protected from affixed characters by enclosing the
  174. variable name in { } (curly braces).
  175.  
  176. Note: Some NFS servers support mount options not supported by the AIX:
  177. grpid, noauto , remount, quota, noquota, posix, nocto, and noac. By
  178. default, the AIX version of the automount  daemon ignores these listed
  179. options.  To reverse the effect of this default, use the
  180. AUTOMOUNT_BAD_OPTS  shell environment variable.
  181.  
  182. Configuration
  183.  
  184. The automount daemon normally consults the auto.master  NIS
  185. configuration map for a list of initial Directory-to-MapName pairs, and
  186. sets up automatic mounts for them in addition to those given on the
  187. command line.  If there are duplications, the command-line parameters
  188. take precedence.
  189.  
  190. Note: This map contains the automount daemon parameter.  The automount
  191. daemon does not look for an auto.master file on the local host.
  192.  
  193. See   "How to Manage NIS automount Maps" for more information about
  194. configuring the auto.master NIS map file.
  195.  
  196. Flags
  197.  
  198. -Denvar =value Assigns a value to the indicated automount command
  199. environment variable.
  200.  
  201. -f MasterFile Reads the named local file, rather than the auto.master
  202. NIS map file, for initialization.
  203.  
  204. -m  Suppresses initialization of directory-mapname pairs listed in the
  205. auto.master NIS database.
  206.  
  207. ________________________________________________________________________
  208.  
  209. How to Manage NIS automount Maps
  210.  
  211. Prerequisite Tasks or Conditions
  212.  
  213. 1. NFS must be installed on your system.
  214.  
  215. 2. TCP/IP must be running.
  216.  
  217. 3. The master server and slave servers must be configured.
  218.  
  219. Procedure
  220.  
  221. 1. Edit the /etc/auto.master file.  The   automount daemon, by default,
  222. reads the NIS /etc/auto.master map to find which directories to watch
  223. for mounts.  The auto.master  map has the following format:
  224.  
  225. DirectoryPath     AutomountMapName
  226.  
  227. The AutomountMapName  filed specifies a file containing the automount
  228. map for the directory specified by the DirectoryPath field.  For
  229. example, the contents of the /etc/auto.master file on the NIS server
  230. might be as follows:
  231.  
  232. /home/home     /etc/auto.home /usr/lpp       /etc/auto.direct
  233.  
  234. The above auto.master  file entries will direct the automount  daemon
  235. to use the /etc/auto.home automount map for the /home/home  directory
  236. and the /etc/auto.direct automount map for the /usr/lpp  directory.
  237.  
  238. 2. Create the AutomountMapName files.  The AutomountMapName files have
  239. the following format:
  240.  
  241. Subdirectory   MountOptions   ServerName:ServerDirectory
  242.  
  243. The Subdirectory  field specifies a subdirectory of the DirectoryPath
  244. field directory of the auto.master file.  For example, the contents of
  245. the /etc/auto.home file on the NIS client might be as follows:
  246.  
  247. john  -rw,hard,intr host1:/home/john bill  -rw,hard,intr
  248. host3:/home/bill sally  -rw,hard,intr host5:/home/sally fred
  249. -rw,hard,intr host9:/home/fred jane  -rw,hard,intr host1:/home/jane
  250.  
  251. The contents of the /etc/auto.direct file on the NIS client might be as
  252. follows:
  253.  
  254. X11 -ro,hard,intr lppserver:/usr/lpp/X11 bsmEn_US -ro,hard,intr
  255. lppserver:/usr/lpp/bsmEn_US gnuemacs -ro,hard,intr
  256. lppserver:/usr/lpp/gnuemacs info -ro,hard,intr lppserver:/usr/lpp/info
  257.  
  258. 3. Update the /var/yp/Makefile file.  The following must be added to
  259. the Makefile file:
  260.  
  261. z Add auto.master to the all: listing.
  262.  
  263. z Add an entry for $(DIR)/auto.master: at the appropriate point in the
  264. file.
  265.  
  266. z Add the following stanza to the Makefile file:
  267.  
  268. auto.master.time: $(DIR)/auto.master
  269.  -@if [ -f $(DIR)/auto.master ] ; then \
  270.   $(MAKEDBM) $(DIR)/auto.master $(YPDBDIR)/$(DOM)/auto.master; \ touch
  271.   auto.master.time ; \ echo "updated auto.master" ; \ if [ ! $(NOPUSH)
  272.   ] ; then \
  273.    $(YPPUSH) auto.master ; \ echo "pushed auto.master" ; \ else \
  274.    : ; \ fi \ else \
  275.   echo "couldn't find $(DIR)/auto.master" ; \ fi
  276.  
  277. In general, the same format that is used for the netmasks entry in the
  278. Makefile file can be used for the auto.master entry.
  279.  
  280. 4. Build the auto.master map by executing the following command:
  281.  
  282. make auto.master
  283.  
  284. If errors are generated, check for improper configuration of NIS,
  285. errors in the Makefile file, or errors in the syntax of the
  286. /etc/auto.master file.
  287.  
  288. 5. Start the automount daemon by executing the following command:
  289.  
  290. /usr/sbin/automount
  291.  
  292. This starts the automount daemon, which reads the auto.master NIS map.
  293.  
  294. In the examples above, when these procedures are completed, a user on
  295. the client can issue the cd /home/home/bill command and have the
  296. /home/bill directory mounted from the host3 system onto the
  297. /home/home/bill directory.  The same is true if the info command is
  298. executed.  The /usr/lpp/info directory will be mounted from the
  299. lppserver system onto the /usr/lpp/info directory on the client and the
  300. info command will be executed from the mounted directory.
  301.  
  302. Maintaining All of the automount Maps with NIS
  303.  
  304. In the example above, the /etc/auto.home and /etc/auto.direct  were
  305. local files on the client that contained all of the automount map
  306. needed.  The contents of the automount maps can also be maintained by
  307. NIS.  The files would still exist on the client, but the contents would
  308. be different.  For example, the /etc/auto.home  file would contain the
  309. following:
  310.  
  311.  
  312. +auto.home
  313.  
  314. And the /etc/auto.direct file would contain the following:
  315.  
  316. +auto.direct
  317.  
  318. This directs the automount daemon to consult the NIS maps auto.home and
  319. auto.direct when it reads the local files.  The NIS server would
  320. contain two new NIS maps.  The maps would be auto.home and auto.direct.
  321. They would be added to the /var/yp/Makefile in the same way that the
  322. auto.master NIS map was added.  This makes them available for use by
  323. the NIS clients running the automount daemon.
  324.  
  325. This facility can also be used to define local portions of the
  326. automount maps and then refer to the NIS maps for the rest of the
  327. automount map.  For example, the /etc/auto.home file could contain the
  328. following:
  329.  
  330. sandy  -rw,hard,intr  host10:/home/sandy james  -rw,hard,intr
  331. host2:/home/james bill  -rw,hard,intr  host20:/home/bill +auto.home
  332.  
  333. This automount  map has three local entries and then it contains the
  334. NIS map auto.home. This way, local definitions can be maintained while
  335. taking advantage of the NIS map for the /home/home directory.  The
  336. entry bill in the local map would appear in the auto.home NIS map.  The
  337. local map entry will override the NIS map entry.
  338.  
  339. Defect 48974, added the following, 03-23-92
  340.  
  341. Using automount Maps
  342.  
  343. The use of automount  maps involves map formats, replicated file
  344. systems, shared mounts, comments in maps, directory patterns, multiple
  345. mounts, included maps, maps for the automount command, and the
  346. auto.master map file.
  347.  
  348. Map Entry Format
  349.  
  350. A simple map entry (mapping) follows:
  351.  
  352. key [-mount-options] location ...
  353.  
  354. The key is the full path name of the directory to mount when used in a
  355. direct map.  In an indirect map, key represents a simple name.  The
  356. mount-options is a list separated by commas.  The location specifies a
  357. remote file system from which the directory can be mounted.  In the
  358. example case, location takes the form:
  359.  
  360. hostname:pathname
  361.  
  362. Replicated File Systems
  363.  
  364. Multiple location fields can be specified for replicated read-only file
  365. systems, in which case automount sends multiple mount requests;
  366. automount mounts the file system from the first host that replies to
  367. the mount request.  This initial request goes to the local net or
  368. subnet.  If there is no response, any connected server may respond.
  369. Since automount does not monitor the status of the server while the
  370. file system is mounted, it will not use another location in the list if
  371. the currently mounted server crashes.  This support for replicated file
  372. systems is available only at mount time.
  373.  
  374. If each location in the list shares the same path name, a single
  375. location can be used with a list of host names, separated by commas.
  376.  
  377. hostname,hostname...:pathname
  378.  
  379. Sharing Mounts
  380.  
  381. The following is an example location entry.
  382.  
  383. hostname:pathname:subdir
  384.  
  385. The hostname is the server name where the file system will mount,
  386. pathname is the directory path to mount, and subdir, when supplied, is
  387. where the symbolic link is made to a subdirectory.  This can be used to
  388. prevent duplicate mounts when multiple directories in the same remote
  389. file system can be accessed.  For example, consider the following map
  390. for /home:
  391.  
  392. able prime:/home/prime:able
  393.  
  394. baker prime:/home/prime:baker
  395.  
  396. When a user attempts to access a file in /home/able, the automount
  397. command mounts prime:/home/prime, but creates a symbolic link called
  398. /home/able  to the able subdirectory in the temporarily-mounted file
  399. system.  If a user immediately tries to access a file in /home/baker ,
  400. the automount command creates a symbolic link that points to the baker
  401. subdirectory.  The /home/prime directory would already be mounted.
  402.  
  403. With the following map, automount would have to mount the file system
  404. twice.
  405.  
  406. able prime:/home/prime/able
  407.  
  408. baker prime:/home/prime/baker
  409.  
  410. Comments and Quoting
  411.  
  412. A mapping can be continued across input lines by escaping the NEWLINE
  413. with a \ (backslash).  Comments begin with a # (pound sign) and end at
  414. the subsequent NEWLINE.
  415.  
  416. Characters that have special significance to the automount map parser
  417. may be protected either with " (double quotation marks) or by escaping
  418. with a \ (backslash).  For example, path names with embedded
  419. whitespace, : (colon), or $ (dollar sign) should be protected.
  420.  
  421. Directory Pattern Matching
  422.  
  423. The & (ampersand) character is expanded to the value of the key field
  424. for the entry in which it occurs.  In the following example, the &
  425. expands to able.
  426.  
  427. able prime:/home/prime:&
  428.  
  429. The * (asterisk) character, when supplied as the key field, is
  430. recognized as the catchall entry.  Such an entry will be used if any
  431. previous entry has not successfully matched the key being searched
  432. for.  For example, if the following entry appeared in the indirect map
  433. for /home,
  434.  
  435. *   &:/home/&
  436.  
  437. it would allow automatic mounts in the /home directory of any remote
  438. file system.  Their location could be specified as:
  439.  
  440. hostname:/home/hostname
  441.  
  442. Multiple Mounts
  443.  
  444. A multiple mount entry takes the form:
  445.  
  446. key [ /[mountpoint [ -mount-options ] location ...  ]      ...
  447.  
  448. The initial / (forward slash) within /[mountpoint] is required.  The
  449. optional mount point is taken as a path name relative to the
  450. destination of the symbolic link for key.  If the mountpoint  option is
  451. omitted in the first occurrence, a mount point of / (or the root
  452. directory) is assumed.  An example of a direct map entry follows:
  453.  
  454. /arch/src  \   /                   -ro,intr
  455. arch:/arch/src           alt:/ arch/src   \      /1.0
  456. -ro,intr       alt:/arch/src/1.0        arch:  /arch/src/1.0   \
  457. /1.0/man  -ro,intr       arch:/arch/src/1.0/man   alt:/arch/src/1
  458. .0/man
  459.  
  460.  
  461. The /arch/src, /arch/src/1.0 and /arch/src/1.0/man  are mounted as
  462. needed, from either arch  or alt, whichever host responded first.  If
  463. the mounts are hierarchically related, mounts closer to the root must
  464. appear before submounts.  All the mounts in a multiple mount entry will
  465. occur together and will be unmounted together.  This is important if
  466. the file systems reference each other with relative symbolic links.
  467. Multiple mount entries can be used both in direct maps and in indirect
  468. maps.
  469.  
  470. Included Maps
  471.  
  472. The contents of another map can be included within another map by
  473. entering:
  474.  
  475. +mapname
  476.  
  477. The mapname can be a file name or the name of an NIS map.  Or, the
  478. mapname can be one of the special maps described in the following
  479. section.  If the key being searched for is not located in an included
  480. map, the search continues with the next entry.
  481.  
  482. Special automount command Maps
  483.  
  484. There are two special maps available: -hosts, and -null.  The -hosts
  485. map uses the NIS  hosts.byname map to locate a remote host when the
  486. host name is specified.  This map specifies mounts of all exported file
  487. systems from any host.  For example, if the following automount command
  488. is in effect:
  489.  
  490. automount /net -hosts
  491.  
  492. then a reference to /net/hermes/usr would initiate an automatic mount
  493. of all file systems from hermes that automount  can mount; references
  494. to a directory under /net/hermes will refer to the corresponding
  495. directory relative to the hermes root directory.
  496.  
  497. The -null map, when indicated on the command line, cancels any
  498. subsequent map for the directory indicated.  It can be used to cancel a
  499. map given in the auto.master file or for a mount point specified as an
  500. entry in a direct map.
  501.  
  502. Configuration and the auto.master Map File
  503.  
  504. The automount command normally consults the auto.master NIS
  505. configuration map for a list of initial automount maps, and establishes
  506. mounts for them in addition to those given on the command line.  If
  507. there are duplications, the command line arguments take precedence over
  508. a local -f master map and they both take precedence over an NIS
  509. auto.master map.  This configuration database contains arguments to the
  510. automount command, rather than mappings; unless -f is in effect,
  511. automount does not look for an auto.master file on the local host.
  512.  
  513.  
  514.  
  515. Maps given on the command line, or those given in a local auto.master
  516. file specified with the -f flag override those in the NIS auto.master
  517. map.  For example, given the command:
  518.  
  519. automount -f
  520.  
  521. /etc/auto.master /home -null   /-  /etc/auto.direct
  522.  
  523. and a /etc/auto.master  file containing:
  524.  
  525. /home auto.home
  526.  
  527. the automount command would ignore the /home entry in the
  528. /etc/auto.master file.
  529.  
  530. Special automount daemon Maps
  531.  
  532. There are two special maps that the automount daemon can use.  They are
  533. described in the command documentation for the automount daemon.  The
  534. first is the -passwd map.  It is not recommended that this special map
  535. be used.  It does not work very well with the login process.  The
  536. alternative is to use something like the auto.home map as described
  537. above.  This can be developed to provide similar functionality.  The
  538. other map is the -hosts map.  This map works well and can be used to
  539. offer a powerful mounting tool for users.  This map provides the means
  540. to mount all available directories from a particular server.
  541.  
  542. Suggested Reading
  543.  
  544. Prerequisite Information
  545.  
  546.  Network  Information Service (NIS) Overview for System Management,
  547.  Network File System (NFS) Overview for System  Management.
  548.  
  549. Related Information
  550.  
  551.  Understanding Secure NFS.
  552.  
  553.  How to  Export a Directory Using Secure NFS,  How to  Mount a File
  554.  System Using Secure NFS,  How to  Mount a File System Using the
  555.  automount Daemon,  How to Unmount a File System Using NFS.
  556.  
  557. The  make command,  mount command.
  558.  
  559. The  automount daemon.
  560.  
  561. The  /etc/filesystems file.
  562.  
  563.  
  564. -- 
  565. curt@aixwiz.austin.ibm.com (Curt L. Finch) | AIX NFS/NIS Field Quality 
  566. My views are unrelated to those of IBM     |        Austin, TX
  567.      Lead_or_Leave's objective is to get all Congressmen to sign a pledge 
  568.   that if the Deficit has not halved by their term's end, they'll step down.
  569.