1*a53f50b9Schristos Sun-style Automounter Syntax Support in Amd 2*a53f50b9Schristos Last updated: October 10, 2005 3*a53f50b9Schristos 4*a53f50b9Schristos 5*a53f50b9Schristos* Summary 6*a53f50b9Schristos 7*a53f50b9SchristosThe goal of this effort is to provide a drop in replacement for the Sun 8*a53f50b9Schristosautomounter. This is implemented in two ways. (1) A new parser built into 9*a53f50b9SchristosAmd. (2) a standalone sun2amd Unix filter tool that can convert Sun-style 10*a53f50b9Schristosmaps to Amd maps. 11*a53f50b9Schristos 12*a53f50b9SchristosSupport for Sun-style maps in Amd (including this document) is a 13*a53f50b9Schristoswork-in-progress. This feature as a whole has not been throughly tested and 14*a53f50b9Schristosis "alpha" quality as of the date posted at the top of this document. 15*a53f50b9Schristos 16*a53f50b9Schristos* Status 17*a53f50b9Schristos 18*a53f50b9SchristosCurrently sun2amd supports most of the basic syntax features of Sun maps. 19*a53f50b9SchristosHowever, support for Sun auto.master maps does not yet exists at any level. 20*a53f50b9SchristosBelow is a list of supported and not-yet supported features. 21*a53f50b9Schristos 22*a53f50b9Schristos1. Supported Sun map features: 23*a53f50b9Schristos 24*a53f50b9Schristos- Simple map entry format: <key> [mount_options] location ... 25*a53f50b9Schristos locations take the form of host:pathname 26*a53f50b9Schristos 27*a53f50b9Schristos- Map Key Substitution: <key> <hostname>:/tmp/& 28*a53f50b9Schristos the & expands to <key> 29*a53f50b9Schristos 30*a53f50b9Schristos- Wildcard Key: * <hostname>:/tmp 31*a53f50b9Schristos This is is a catch-all entry. 32*a53f50b9Schristos 33*a53f50b9Schristos- Variable Substitution: 34*a53f50b9Schristos $ARCH, $CPU, $HOST, $OSNAME, $OSREL, $OSVERS, $NATISA 35*a53f50b9Schristos 36*a53f50b9Schristos- Multiple Mount format: 37*a53f50b9Schristos <key> [mount_options] [mountpoint] [mount-options locations...]... 38*a53f50b9Schristos 39*a53f50b9Schristos ex. 40*a53f50b9Schristos pluto -ro /tmp1 host1:/tmp1 /tmp2 host2:/tmp2 41*a53f50b9Schristos 42*a53f50b9Schristos- HSFS file-system (cdrom): <key> -fstype=hsfs,ro :/dev/cdrom 43*a53f50b9Schristos 44*a53f50b9Schristos 45*a53f50b9Schristos2. Not-yet supported Sun map features: 46*a53f50b9Schristos 47*a53f50b9Schristos- Replicated File Systems: <hostname>,<hostname>...:<pathname> 48*a53f50b9Schristos This is a feature of Solaris that allows a user to specify a 49*a53f50b9Schristos set of hosts to appear as one in a map entry. When a host 50*a53f50b9Schristos does not respond the kernel will switch to an alternate 51*a53f50b9Schristos server. Amd will supports the syntax for replicated file 52*a53f50b9Schristos systems by creating multiple hosts, however, Amd will not 53*a53f50b9Schristos perform any kind of fail over. 54*a53f50b9Schristos 55*a53f50b9Schristos- CacheFS (although Amd supports type:=cachefs, sun2amd doesn't yet parse 56*a53f50b9Schristos it). 57*a53f50b9Schristos 58*a53f50b9Schristos- AutoFS (although Amd supports Autofs mounts and type:=auto, sun2amd 59*a53f50b9Schristos may not parse it fully). 60*a53f50b9Schristos 61*a53f50b9Schristos- Included maps: +<map_name> 62*a53f50b9Schristos This will include the contents of a map into another map. 63*a53f50b9Schristos 64*a53f50b9Schristos- Sun master maps: auto.master 65*a53f50b9Schristos Amd still relies and amd.conf. Any feature in auto.master 66*a53f50b9Schristos must be duplicated using Amd equivalent features in amd.conf. 67*a53f50b9Schristos 68*a53f50b9Schristos- /net mount point: 69*a53f50b9Schristos The automounter is suppose to dynamically create map entries 70*a53f50b9Schristos under this mount point corresponding to NFS server(s) exported 71*a53f50b9Schristos file systems. While this isn't parser by sun2amd, Amd does support 72*a53f50b9Schristos host maps (type:=host). 73*a53f50b9Schristos 74*a53f50b9Schristos- Federated Naming Service (FNS) (-xfn): 75*a53f50b9Schristos A naming server that wraps a number of other naming service 76*a53f50b9Schristos under one interface. 77*a53f50b9Schristos 78*a53f50b9Schristos- "-null" map option: A way to cancel maps in the auto.master file. 79*a53f50b9Schristos 80*a53f50b9Schristos- nsswitch.conf: 81*a53f50b9Schristos This file provides a way to specify what lookup service to use 82*a53f50b9Schristos for a number of systems including Sun's automounter. In amd 83*a53f50b9Schristos lookup services for map files are define in the amd.conf file. 84*a53f50b9Schristos 85*a53f50b9Schristos 86*a53f50b9Schristos* Setup 87*a53f50b9Schristos 88*a53f50b9SchristosTo enable Sun-style maps in Amd, set "sun_map_syntax = yes" in your amd.conf 89*a53f50b9Schristosfile. When this flag is set in [global], all maps read by Amd are assumed 90*a53f50b9Schristosto be Sun style maps. You can set this on a per map basis, thus mixing 91*a53f50b9SchristosSun-style and Amd-style maps. For more information about amd.conf please 92*a53f50b9Schristossee the Amd documentation. 93*a53f50b9Schristos 94*a53f50b9SchristosExample: 95*a53f50b9Schristos 96*a53f50b9Schristos# file: amd.conf 97*a53f50b9Schristos################ 98*a53f50b9Schristos[ global ] 99*a53f50b9Schristossun_map_syntax = yes 100*a53f50b9Schristos 101*a53f50b9Schristos[ /home ] 102*a53f50b9Schristosmap_name = /etc/amd.sun_map 103*a53f50b9Schristosmap_type = file 104*a53f50b9Schristos 105*a53f50b9Schristos 106*a53f50b9Schristos* sun2amd command line utility 107*a53f50b9Schristos 108*a53f50b9SchristosIn addition to build-in Amd support there also exists the sun2amd command 109*a53f50b9Schristosline utility that converts Sun maps to Amd maps. This can be useful in 110*a53f50b9Schristosmigrating one or more Sun maps to the Amd syntax in one step. 111*a53f50b9Schristos 112*a53f50b9SchristosExample usage: 113*a53f50b9Schristos 114*a53f50b9Schristos$ sun2amd -i sun_map -o amd_map 115*a53f50b9Schristos 116*a53f50b9SchristosThis line tells sun2amd to read the file sun_map and redirect its output to 117*a53f50b9Schristosa file called amd_map. By default sun2amd reads from stdin and writes to 118*a53f50b9Schristosstdout (i.e., traditional Unix filter). 119*a53f50b9Schristos 120*a53f50b9Schristos 121*a53f50b9Schristos* FAQ 122*a53f50b9Schristos 123*a53f50b9SchristosQ1: I know "/net" is not supported, but how can I achieve the same 124*a53f50b9Schristos functionality with Amd? 125*a53f50b9Schristos 126*a53f50b9SchristosA1: In short, you must create the '/net' entry as a Amd entry of type host 127*a53f50b9Schristos by hand. Below is an example of how to do this. See the Amd 128*a53f50b9Schristos documentation on type autofs for more information. 129*a53f50b9Schristos 130*a53f50b9SchristosExample: 131*a53f50b9Schristos 132*a53f50b9Schristos# file: amd.conf 133*a53f50b9Schristos################ 134*a53f50b9Schristos[ /net ] 135*a53f50b9Schristosmap_name = /etc/amd.net 136*a53f50b9Schristos 137*a53f50b9Schristos# file: /etc/amd.net 138*a53f50b9Schristos############### 139*a53f50b9Schristos/defaults fs:=${autodir}/${rhost}/root/${rfs} 140*a53f50b9Schristos* rhost:=${key};type:=host;rfs:=/ 141*a53f50b9Schristos 142*a53f50b9Schristos(more FAQ entries to come...) 143