home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / comp / unix / aix / 9451 < prev    next >
Encoding:
Internet Message Format  |  1992-09-08  |  21.8 KB

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