6253 F_GETLK doesn't always return lock owner
[illumos-gate.git] / usr / src / man / man1m / cfsadmin.1m
blob942ee1c067a4ca45ebf9b6b7eec470c804d3234e
1 '\" te
2 .\"  Copyright (c) 2004, Sun Microsystems, Inc. All Rights Reserved
3 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
4 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
5 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
6 .TH CFSADMIN 1M "Feb 21, 2004"
7 .SH NAME
8 cfsadmin \- administer disk space used for caching file systems with the Cache
9 File-System (CacheFS)
10 .SH SYNOPSIS
11 .LP
12 .nf
13 \fBcfsadmin\fR \fB-c\fR [\fB-o\fR \fIcacheFS-parameters\fR] \fIcache_directory\fR
14 .fi
16 .LP
17 .nf
18 \fBcfsadmin\fR \fB-d\fR {\fIcache_ID\fR | all} \fIcache_directory\fR
19 .fi
21 .LP
22 .nf
23 \fBcfsadmin\fR \fB-l\fR \fIcache_directory\fR
24 .fi
26 .LP
27 .nf
28 \fBcfsadmin\fR \fB-s\fR {\fImntpt1 ....\fR} | all
29 .fi
31 .LP
32 .nf
33 \fBcfsadmin\fR \fB-u\fR [\fB-o\fR \fIcacheFS-parameters\fR] \fIcache_directory\fR
34 .fi
36 .SH DESCRIPTION
37 .sp
38 .LP
39 The \fBcfsadmin\fR command provides the following functions:
40 .RS +4
41 .TP
42 .ie t \(bu
43 .el o
44 cache creation
45 .RE
46 .RS +4
47 .TP
48 .ie t \(bu
49 .el o
50 deletion of cached file systems
51 .RE
52 .RS +4
53 .TP
54 .ie t \(bu
55 .el o
56 listing of cache contents and statistics
57 .RE
58 .RS +4
59 .TP
60 .ie t \(bu
61 .el o
62 resource parameter adjustment when the file system is unmounted.
63 .RE
64 .sp
65 .LP
66 You must always supply an option for \fBcfsadmin\fR. For each form of the
67 command except \fB-s\fR, you must specify a cache directory, that is, the
68 directory under which the cache is actually stored. A path name in the front
69 file system identifies the cache directory. For the \fB-s\fR form of the
70 command, you must specify a mount point.
71 .sp
72 .LP
73 You can specify a cache ID when you mount a file system with CacheFS, or you
74 can let the system generate one for you. The \fB-l\fR option includes the cache
75 ID in its listing of information. You must know the cache ID to delete a cached
76 file system.
77 .SH OPTIONS
78 .sp
79 .LP
80 The following options are supported:
81 .sp
82 .ne 2
83 .na
84 \fB\fB-c\fR [ \fB-o\fR \fIcacheFS-parameters\fR ] \fIcache_directory\fR\fR
85 .ad
86 .sp .6
87 .RS 4n
88 Create a cache under the directory specified by \fIcache_directory\fR. This
89 directory must not exist prior to cache creation.
90 .RE
92 .sp
93 .ne 2
94 .na
95 \fB\fB-d\fR { \fIcache_ID\fR | all } \fIcache_directory\fR\fR
96 .ad
97 .sp .6
98 .RS 4n
99 Remove the file system whose cache ID you specify and release its resources, or
100 remove all file systems in the cache by specifying \fBall\fR. After deleting a
101 file system from the cache, you must run the \fBfsck_cachefs\fR(1M) command to
102 correct the resource counts for the cache.
104 As indicated by the syntax above, you must supply either a \fIcache_ID\fR or
105 \fBall\fR, in addition to \fIcache_directory\fR.
109 .ne 2
111 \fB\fB-l\fR \fIcache_directory\fR\fR
113 .sp .6
114 .RS 4n
115 List file systems stored in the specified cache, as well as statistics about
116 them. Each cached file system is listed by cache ID. The statistics document
117 resource utilization and cache resource parameters.
121 .ne 2
123 \fB\fB-s\fR { \fImntpt1\fR ... } | all\fR
125 .sp .6
126 .RS 4n
127 Request a consistency check on the specified file system (or all \fBcachefs\fR
128 mounted file systems). The \fB-s\fR option only works if the cache file system
129 was mounted with \fBdemandconst\fR enabled (see \fBmount_cachefs\fR(1M)). Each
130 file in the specified cache file system is checked for consistency with its
131 corresponding file in the back file system. Note that the consistency check is
132 performed file by file as files are accessed. If no files are accessed, no
133 checks are performed. Use of this option does not result in a sudden "storm" of
134 consistency checks.
136 As indicated by the syntax above, you must supply one or more mount points, or
137 \fBall\fR.
141 .ne 2
143 \fB\fB-u\fR [ \fB-o\fR \fIcacheFS-parameters\fR ] \fIcache_directory\fR\fR
145 .sp .6
146 .RS 4n
147 Update resource parameters of the specified cache directory. Parameter values
148 can only be increased. To decrease the values, you must remove the cache and
149 recreate it. All file systems in the cache directory must be unmounted when you
150 use this option. Changes take effect the next time you mount any file system in
151 the specified cache directory. The \fB-u\fR option with no \fB-o\fR option sets
152 all parameters to their default values.
155 .SS "CacheFS Resource Parameters"
158 You can specify the following CacheFS resource parameters as arguments to the
159 \fB-o\fR option. Separate multiple parameters with commas.
161 .ne 2
163 \fB\fBmaxblocks=\fR\fIn\fR\fR
165 .RS 18n
166 Maximum amount of storage space that CacheFS can use, expressed as a percentage
167 of the total number of blocks in the front file system. If CacheFS does not
168 have exclusive use of the front file system, there is no guarantee that all the
169 space the \fBmaxblocks\fR parameter allows is available. The default is
170 \fB90\fR.
174 .ne 2
176 \fB\fBminblocks=\fR\fIn\fR\fR
178 .RS 18n
179 Minimum amount of storage space, expressed as a percentage of the total number
180 of blocks in the front file system, that CacheFS is always allowed to use
181 without limitation by its internal control mechanisms. If CacheFS does not have
182 exclusive use of the front file system, there is no guarantee that all the
183 space the \fBminblocks\fR parameter attempts to reserve is available. The
184 default is \fB0\fR.
188 .ne 2
190 \fB\fBthreshblocks=\fR\fIn\fR\fR
192 .RS 18n
193 A percentage of the total blocks in the front file system beyond which CacheFS
194 cannot claim resources once its block usage has reached the level specified by
195 \fBminblocks\fR. The default is \fB85\fR.
199 .ne 2
201 \fB\fBmaxfiles=\fR\fIn\fR\fR
203 .RS 18n
204 Maximum number of files that CacheFS can use, expressed as a percentage of the
205 total number of inodes in the front file system. If CacheFS does not have
206 exclusive use of the front file system, there is no guarantee that all the
207 inodes the \fBmaxfiles\fR parameter allows is available. The default is
208 \fB90\fR.
212 .ne 2
214 \fB\fBminfiles=\fR\fIn\fR\fR
216 .RS 18n
217 Minimum number of files, expressed as a percentage of the total number of
218 inodes in the front file system, that CacheFS is always allowed to use without
219 limitation by its internal control mechanisms. If CacheFS does not have
220 exclusive use of the front file system, there is no guarantee that all the
221 inodes the \fBminfiles\fR parameter attempts to reserve is available. The
222 default is \fB0\fR.
226 .ne 2
228 \fB\fBthreshfiles=\fR\fIn\fR\fR
230 .RS 18n
231 A percentage of the total inodes in the front file system beyond which CacheFS
232 cannot claim inodes once its usage has reached the level specified by
233 \fBminfiles\fR. The default is \fB85\fR.
237 .ne 2
239 \fB\fBmaxfilesize=\fR\fIn\fR\fR
241 .RS 18n
242 Largest file size, expressed in megabytes, that CacheFS is allowed to cache.
243 The default is \fB3\fR. You cannot decrease the block or inode allotment for a
244 cache. To decrease the size of a cache, you must remove it and create it again
245 with different parameters.
247 Currently \fBmaxfilesize\fR is ignored by \fBcachefs\fR, therefore, setting it
248 has no effect.
251 .SH OPERANDS
253 .ne 2
255 \fB\fIcache_directory\fR\fR
257 .RS 19n
258 The directory under which the cache is actually stored.
262 .ne 2
264 \fB\fImntpt1\fR\fR
266 .RS 19n
267 The directory where the CacheFS is mounted.
270 .SH USAGE
273 See \fBlargefile\fR(5) for the description of the behavior of \fBcfsadmin\fR
274 when encountering files greater than or equal to 2 Gbyte ( 2^31 bytes).
275 .SH EXAMPLES
277 \fBExample 1 \fRCreating a Cache Directory
280 The following example creates a cache directory named \fB/cache\fR:
283 .in +2
285 example# cfsadmin -c /cache
287 .in -2
291 \fBExample 2 \fRCreating a Cache
294 The following example creates a cache named \fB/cache1\fR that can claim a
295 maximum of 60 percent of the blocks in the front file system, can use 40
296 percent of the front file system blocks without interference by CacheFS
297 internal control mechanisms, and has a threshold value of 50 percent. The
298 threshold value indicates that after CacheFS reaches its guaranteed minimum, it
299 cannot claim more space if 50 percent of the blocks in the front file system
300 are already used.
303 .in +2
305 example# cfsadmin \fB-c\fR \fB-o\fR maxblocks=60,minblocks=40,threshblocks=50 /cache1
307 .in -2
311 \fBExample 3 \fRChanging the \fBmaxfilesize\fR Parameter
314 The following example changes the \fBmaxfilesize\fR parameter for the cache
315 directory \fB/cache2\fR to 2 megabytes:
318 .in +2
320 example# cfsadmin \fB-u\fR \fB-o\fR maxfilesize=2 /cache2
322 .in -2
326 \fBExample 4 \fRListing the Contents of a Cache Directory
329 The following example lists the contents of a cache directory named
330 \fB/cache3\fR and provides statistics about resource utilization:
333 .in +2
335 example# cfsadmin \fB-l\fR /cache3
337 .in -2
341 \fBExample 5 \fRRemoving a Cached File System
344 The following example removes the cached file system with cache ID \fB23\fR
345 from the cache directory \fB/cache3\fR and frees its resources (the cache ID is
346 part of the information returned by \fBcfsadmin \fR\fB-l\fR):
349 .in +2
351 example# cfsadmin \fB-d\fR 23 /cache3
353 .in -2
357 \fBExample 6 \fRRemoving All Cached File Systems
360 The following example removes all cached file systems from the cache directory
361 \fB/cache3\fR:
364 .in +2
366 example# cfsadmin \fB-d\fR all /cache3
368 .in -2
372 \fBExample 7 \fRChecking for Consistency in File Systems
375 The following example checks for consistency all file systems mounted with
376 \fBdemandconst\fR enabled. No errors are reported if no \fBdemandconst\fR file
377 systems were found.
380 .in +2
382 example# \fBcfsadmin\fR \fB-s\fR \fBall\fR
384 .in -2
387 .SH EXIT STATUS
390 The following exit values are returned:
392 .ne 2
394 \fB\fB0\fR\fR
396 .RS 5n
397 Successful completion.
401 .ne 2
403 \fB\fB1\fR\fR
405 .RS 5n
406 An error occurred.
409 .SH SEE ALSO
412 \fBcachefslog\fR(1M), \fBcachefsstat\fR(1M), \fBcachefswssize\fR(1M),
413 \fBfsck_cachefs\fR(1M), \fBmount_cachefs\fR(1M), \fBattributes\fR(5),
414 \fBlargefile\fR(5)