Import Upstream version 1.8.5
[hcoop/debian/openafs.git] / doc / man-pages / pod1 / fs_mkmount.pod
CommitLineData
805e021f
CE
1=head1 NAME
2
3fs_mkmount - Creates a mount point for a volume
4
5=head1 SYNOPSIS
6
7=for html
8<div class="synopsis">
9
10B<fs mkmount> S<<< B<-dir> <I<directory>> >>> S<<< B<-vol> <I<volume name>> >>>
11 S<<< [B<-cell> <I<cell name>>] >>> [B<-rw>] [B<-fast>] [B<-help>]
12
13B<fs mk> S<<< B<-d> <I<directory>> >>> S<<< B<-v> <I<volume name>> >>>
14 S<<< [B<-c> <I<cell name>>] >>> [B<-r>] [B<-f>] [B<-h>]
15
16=for html
17</div>
18
19=head1 DESCRIPTION
20
21The B<fs mkmount> command creates a mount point for the volume named by
22the B<-vol> argument at the location in the AFS file space specified by
23the B<-dir> argument. The mount point looks like a standard directory
24element, and serves as the volume's root directory, but is actually a
25special file system object that refers to an AFS volume. When the Cache
26Manager first encounters a given mount point during pathname traversal, it
27contacts the VL Server to learn which file server machines house the
28indicated volume, then fetches a copy of the volume's root directory from
29the appropriate file server machine.
30
31It is possible, although not recommended, to create more than one mount
32point to a volume. The Cache Manager can become confused if a volume is
33mounted in two places along the same path through the filespace.
34
35The Cache Manager observes three basic rules as it traverses the AFS
36filespace and encounters mount points:
37
38=over 4
39
40=item Rule 1: Access Backup and Read-only Volumes When Specified
41
42When the Cache Manager encounters a mount point that specifies a volume
43with either a C<.readonly> or a C<.backup> extension, it accesses that
44type of volume only. If a mount point does not have either a C<.backup> or
45C<.readonly> extension, the Cache Manager uses Rules 2 and 3.
46
47For example, the Cache Manager never accesses the read/write version of a
48volume if the mount point names the backup version. If the specified
49version is inaccessible, the Cache Manager reports an error.
50
51=item Rule 2: Follow the Read-only Path When Possible
52
53If a mount point resides in a read-only volume and the volume that it
54references is replicated, the Cache Manager attempts to access a read-only
55copy of the volume; if the referenced volume is not replicated, the Cache
56Manager accesses the read/write copy. The Cache Manager is thus said to
57prefer a I<read-only path> through the filespace, accessing read-only
58volumes when they are available.
59
60The Cache Manager starts on the read-only path in the first place because
61it always accesses a read-only copy of the B<root.afs> volume if it
62exists; the volume is mounted at the root of a cell's AFS filespace (named
63F</afs> by convention). That is, if the C<root.afs> volume is replicated,
64the Cache Manager attempts to access a read-only copy of it rather than
65the read/write copy. This rule then keeps the Cache Manager on a read-only
66path as long as each successive volume is replicated. The implication is
67that both the C<root.afs> and C<root.cell> volumes must be replicated for
68the Cache Manager to access replicated volumes mounted below them in the
69AFS filespace. The volumes are conventionally mounted at the F</afs> and
70F</afs/I<cellname>> directories, respectively.
71
72=item Rule 3: Once on a Read/write Path, Stay There
73
74If a mount point resides in a read/write volume and the volume name does
75not have a C<.readonly> or a C<.backup> extension, the Cache Manager
76attempts to access only the read/write version of the volume. The access
77attempt fails with an error if the read/write version is inaccessible,
78even if a read-only version is accessible. In this situation the Cache
79Manager is said to be on a I<read/write path> and cannot switch back to
80the read-only path unless mount point explicitly names a volume with a
81C<.readonly> extension. (Cellular mount points are an important exception
82to this rule, as explained in the following discussion.
83
84=back
85
86There are three types of mount points, each appropriate for a different
87purpose because of the manner in which the Cache Manager interprets them.
88
89=over 4
90
91=item *
92
93When the Cache Manager crosses a I<regular> mount point, it obeys all
94three of the mount point traversal rules previously described. To create a
95regular mount point, include only the required B<-dir> and B<-vol>
96arguments to the B<fs mkmount> command.
97
98=item *
99
100When the Cache Manager crosses a I<read/write> mount point, it attempts to
101access only the volume version named in the mount point. If the volume
102name is the base (read/write) form, without a C<.readonly> or C<.backup>
103extension, the Cache Manager accesses the read/write version of the
104volume, even if it is replicated. In other words, the Cache Manager
105disregards the second mount point traversal rule when crossing a
106read/write mount point: it switches to the read/write path through the
107filespace.
108
109To create a read/write mount point, include the B<-rw> flag on the B<fs
110mkmount> command. It is conventional to create only one read/write mount
111point in a cell's filespace, using it to mount the cell's C<root.cell>
112volume just below the AFS filespace root (by convention,
113F</afs/.I<cellname>>). See the I<OpenAFS Quick Start Guide> for
114instructions and the chapter about volume management in the I<OpenAFS
115Administration Guide> for further discussion.
116
117Creating a read/write mount point for a read-only or backup volume is
118acceptable, but unnecessary. The first rule of mount point traversal
119already specifies that the Cache Manager accesses them if the volume name
120in a regular mount point has a C<.readonly> or C<.backup> extension.
121
122=item *
123
124When the Cache Manager crosses a I<cellular> mount point, it accesses the
125indicated volume in the specified cell, which is normally a foreign
126cell. (If the mount point does not name a cell along with the volume, the
127Cache Manager accesses the volume in the cell where the mount point
128resides.) The Cache Manager disregards the third mount point traversal
129rule when crossing a regular cellular mount point: it accesses a read-only
130version of the volume if it is replicated, even if the volume that houses
131the mount point is read/write. Switching to the read-only path in this way
132is designed to avoid imposing undue load on the file server machines in
133foreign cells.
134
135To create a regular cellular mount point, include the B<-cell> argument on
136the B<fs mkmount> command. It is conventional to create cellular mount
137points only at the second level in a cell's filespace, using them to mount
138foreign cells' B<root.cell> volumes just below the AFS filespace root (by
139convention, at F</afs/I<foreign_cellname>>). The mount point enables local
140users to access the foreign cell's filespace, assuming they have the
141necessary permissions on the ACL of the volume's root directory and that
142there is an entry for the foreign cell in each local client machine's
143F</usr/vice/etc/CellServDB> file. In the output of the B<fs lsmount>
144command, the cell name and a colon (C<:>) appear between the initial
145number sign and the volume name in a regular cellular mount point name.
146
147=back
148
149=head1 OPTIONS
150
151=over 4
152
153=item B<-dir> <I<directory>>+
154
155Names the directory to create as a mount point. The directory must not
156already exist. Relative pathnames are interpreted with respect to the
157current working directory.
158
159Specify the read/write path to the directory, to avoid the failure that
160results from attempting to create a new mount point in a read-only
161volume. By convention, the read/write path is indicated by placing a
162period before the cell name at the pathname's second level (for example,
163F</afs/.example.com>). For further discussion of the concept of read/write and
164read-only paths through the filespace, see L</DESCRIPTION>.
165
166=item B<-vol> <I<volume name>>
167
168Specifies the name or volume ID number of the volume to mount. If
169appropriate, add the C<.readonly> or C<.backup> extension to the name, or
170specify the appropriate volume ID number.
171
172=item B<-cell> <I<cell name>>
173
174Names the cell in which the volume resides (creates a cellular mount
175point). Provide the fully qualified domain name, or a shortened form that
176disambiguates it from the other cells listed in the local
177F</usr/vice/etc/CellServDB> file.
178
179If this argument is omitted, no cell indicator appears in the mount
180point. When the Cache Manager interprets it, it assumes that the volume
181named in the mount point resides in the same cell as the volume that
182houses the mount point.
183
184=item B<-rw>
185
186Creates a read/write mount point. Omit this flag to create a regular mount
187point.
188
189=item B<-fast>
190
191Prevents the Volume Location (VL) Server from checking that the volume has
192a VLDB entry and printing a warning message if it does not. Whether or not
193this flag is included, the File Server creates the mount point even when
194the volume has no VLDB entry.
195
196=item B<-help>
197
198Prints the online help for this command. All other valid options are
199ignored.
200
201=back
202
203=head1 EXAMPLES
204
205The following command creates a regular mount point, mounting the volume
206C<user.smith> at F</afs/example.com/usr/smith>:
207
208 % cd /afs/example.com/usr
209 % fs mkmount -dir smith -vol user.smith
210
211The following commands create a read/write mount point and a regular mount
212point for the Example Corporation cell's C<root.cell> volume in that cell's
213file tree. The second command follows the convention of putting a period
214at the beginning of the read/write mount point's name.
215
216 % fs mkmount -dir /afs/example.com -vol root.cell
217 % fs mkmount -dir /afs/.example.com -vol root.cell -rw
218
219The following command mounts the Example Organization cell's C<root.cell>
220volume in the Example Corporation cell's file tree, creating a regular
221cellular mount point called F</afs/example.org>. When a Example Corporation
222Cache Manager encounters this mount point, it crosses into the Example
223Organization cell on a read-only path.
224
225 % fs mkmount -dir /afs/example.org -vol root.cell -c example.org
226
227=head1 PRIVILEGE REQUIRED
228
229The issuer must have the C<i> (insert) and C<a> (administer) permissions
230on the ACL of the directory that is to house the mount point.
231
232=head1 SEE ALSO
233
234L<CellServDB(5)>,
235L<fs_lsmount(1)>,
236L<fs_rmmount(1)>
237
238=head1 COPYRIGHT
239
240IBM Corporation 2000. <http://www.ibm.com/> All Rights Reserved.
241
242This documentation is covered by the IBM Public License Version 1.0. It was
243converted from HTML to POD by software written by Chas Williams and Russ
244Allbery, based on work by Alf Wachsmann and Elizabeth Cassell.