1cfsadmin(1M) System Administration Commands cfsadmin(1M)
2
3
4
6 cfsadmin - administer disk space used for caching file systems with the
7 Cache File-System (CacheFS)
8
10 cfsadmin -c [-o cacheFS-parameters] cache_directory
11
12
13 cfsadmin -d {cache_ID | all} cache_directory
14
15
16 cfsadmin -l cache_directory
17
18
19 cfsadmin -s {mntpt1 ....} | all
20
21
22 cfsadmin -u [-o cacheFS-parameters] cache_directory
23
24
26 The cfsadmin command provides the following functions:
27
28 o cache creation
29
30 o deletion of cached file systems
31
32 o listing of cache contents and statistics
33
34 o resource parameter adjustment when the file system is
35 unmounted.
36
37
38 You must always supply an option for cfsadmin. For each form of the
39 command except -s, you must specify a cache directory, that is, the
40 directory under which the cache is actually stored. A path name in the
41 front file system identifies the cache directory. For the -s form of
42 the command, you must specify a mount point.
43
44
45 You can specify a cache ID when you mount a file system with CacheFS,
46 or you can let the system generate one for you. The -l option includes
47 the cache ID in its listing of information. You must know the cache ID
48 to delete a cached file system.
49
51 The following options are supported:
52
53 -c [ -o cacheFS-parameters ] cache_directory
54
55 Create a cache under the directory specified by cache_directory.
56 This directory must not exist prior to cache creation.
57
58
59 -d { cache_ID | all } cache_directory
60
61 Remove the file system whose cache ID you specify and release its
62 resources, or remove all file systems in the cache by specifying
63 all. After deleting a file system from the cache, you must run the
64 fsck_cachefs(1M) command to correct the resource counts for the
65 cache.
66
67 As indicated by the syntax above, you must supply either a cache_ID
68 or all, in addition to cache_directory.
69
70
71 -l cache_directory
72
73 List file systems stored in the specified cache, as well as statis‐
74 tics about them. Each cached file system is listed by cache ID. The
75 statistics document resource utilization and cache resource parame‐
76 ters.
77
78
79 -s { mntpt1 ... } | all
80
81 Request a consistency check on the specified file system (or all
82 cachefs mounted file systems). The -s option only works if the
83 cache file system was mounted with demandconst enabled (see
84 mount_cachefs(1M)). Each file in the specified cache file system is
85 checked for consistency with its corresponding file in the back
86 file system. Note that the consistency check is performed file by
87 file as files are accessed. If no files are accessed, no checks are
88 performed. Use of this option does not result in a sudden "storm"
89 of consistency checks.
90
91 As indicated by the syntax above, you must supply one or more mount
92 points, or all.
93
94
95 -u [ -o cacheFS-parameters ] cache_directory
96
97 Update resource parameters of the specified cache directory. Param‐
98 eter values can only be increased. To decrease the values, you must
99 remove the cache and recreate it. All file systems in the cache
100 directory must be unmounted when you use this option. Changes take
101 effect the next time you mount any file system in the specified
102 cache directory. The -u option with no -o option sets all parame‐
103 ters to their default values.
104
105
106 CacheFS Resource Parameters
107 You can specify the following CacheFS resource parameters as arguments
108 to the -o option. Separate multiple parameters with commas.
109
110 maxblocks=n Maximum amount of storage space that CacheFS can use,
111 expressed as a percentage of the total number of
112 blocks in the front file system. If CacheFS does not
113 have exclusive use of the front file system, there is
114 no guarantee that all the space the maxblocks parame‐
115 ter allows is available. The default is 90.
116
117
118 minblocks=n Minimum amount of storage space, expressed as a per‐
119 centage of the total number of blocks in the front
120 file system, that CacheFS is always allowed to use
121 without limitation by its internal control mecha‐
122 nisms. If CacheFS does not have exclusive use of the
123 front file system, there is no guarantee that all the
124 space the minblocks parameter attempts to reserve is
125 available. The default is 0.
126
127
128 threshblocks=n A percentage of the total blocks in the front file
129 system beyond which CacheFS cannot claim resources
130 once its block usage has reached the level specified
131 by minblocks. The default is 85.
132
133
134 maxfiles=n Maximum number of files that CacheFS can use,
135 expressed as a percentage of the total number of
136 inodes in the front file system. If CacheFS does not
137 have exclusive use of the front file system, there is
138 no guarantee that all the inodes the maxfiles parame‐
139 ter allows is available. The default is 90.
140
141
142 minfiles=n Minimum number of files, expressed as a percentage of
143 the total number of inodes in the front file system,
144 that CacheFS is always allowed to use without limita‐
145 tion by its internal control mechanisms. If CacheFS
146 does not have exclusive use of the front file system,
147 there is no guarantee that all the inodes the min‐
148 files parameter attempts to reserve is available. The
149 default is 0.
150
151
152 threshfiles=n A percentage of the total inodes in the front file
153 system beyond which CacheFS cannot claim inodes once
154 its usage has reached the level specified by min‐
155 files. The default is 85.
156
157
158 maxfilesize=n Largest file size, expressed in megabytes, that
159 CacheFS is allowed to cache. The default is 3. You
160 cannot decrease the block or inode allotment for a
161 cache. To decrease the size of a cache, you must
162 remove it and create it again with different parame‐
163 ters.
164
165 Currently maxfilesize is ignored by cachefs, there‐
166 fore, setting it has no effect.
167
168
170 cache_directory The directory under which the cache is actually
171 stored.
172
173
174 mntpt1 The directory where the CacheFS is mounted.
175
176
178 See largefile(5) for the description of the behavior of cfsadmin when
179 encountering files greater than or equal to 2 Gbyte ( 2^31 bytes).
180
182 Example 1 Creating a Cache Directory
183
184
185 The following example creates a cache directory named /cache:
186
187
188 example# cfsadmin -c /cache
189
190
191
192 Example 2 Creating a Cache
193
194
195 The following example creates a cache named /cache1 that can claim a
196 maximum of 60 percent of the blocks in the front file system, can use
197 40 percent of the front file system blocks without interference by
198 CacheFS internal control mechanisms, and has a threshold value of 50
199 percent. The threshold value indicates that after CacheFS reaches its
200 guaranteed minimum, it cannot claim more space if 50 percent of the
201 blocks in the front file system are already used.
202
203
204 example# cfsadmin -c -o maxblocks=60,minblocks=40,threshblocks=50 /cache1
205
206
207
208 Example 3 Changing the maxfilesize Parameter
209
210
211 The following example changes the maxfilesize parameter for the cache
212 directory /cache2 to 2 megabytes:
213
214
215 example# cfsadmin -u -o maxfilesize=2 /cache2
216
217
218
219 Example 4 Listing the Contents of a Cache Directory
220
221
222 The following example lists the contents of a cache directory named
223 /cache3 and provides statistics about resource utilization:
224
225
226 example# cfsadmin -l /cache3
227
228
229
230 Example 5 Removing a Cached File System
231
232
233 The following example removes the cached file system with cache ID 23
234 from the cache directory /cache3 and frees its resources (the cache ID
235 is part of the information returned by cfsadmin -l):
236
237
238 example# cfsadmin -d 23 /cache3
239
240
241
242 Example 6 Removing All Cached File Systems
243
244
245 The following example removes all cached file systems from the cache
246 directory /cache3:
247
248
249 example# cfsadmin -d all /cache3
250
251
252
253 Example 7 Checking for Consistency in File Systems
254
255
256 The following example checks for consistency all file systems mounted
257 with demandconst enabled. No errors are reported if no demandconst file
258 systems were found.
259
260
261 example# cfsadmin -s all
262
263
264
266 The following exit values are returned:
267
268 0 Successful completion.
269
270
271 1 An error occurred.
272
273
275 See attributes(5) for descriptions of the following attributes:
276
277
278
279
280 ┌─────────────────────────────┬─────────────────────────────┐
281 │ ATTRIBUTE TYPE │ ATTRIBUTE VALUE │
282 ├─────────────────────────────┼─────────────────────────────┤
283 │Availability │SUNWcsu │
284 └─────────────────────────────┴─────────────────────────────┘
285
287 cachefslog(1M), cachefsstat(1M), cachefswssize(1M), fsck_cachefs(1M),
288 mount_cachefs(1M), attributes(5), largefile(5)
289
290
291
292SunOS 5.11 21 Feb 2004 cfsadmin(1M)