]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - sbin/mdmfs/mdmfs.8
This commit was generated by cvs2svn to compensate for changes in r155511,
[FreeBSD/FreeBSD.git] / sbin / mdmfs / mdmfs.8
1 .\"
2 .\" Copyright (c) 2001 Dima Dorfman.
3 .\" All rights reserved.
4 .\"
5 .\" Redistribution and use in source and binary forms, with or without
6 .\" modification, are permitted provided that the following conditions
7 .\" are met:
8 .\" 1. Redistributions of source code must retain the above copyright
9 .\"    notice, this list of conditions and the following disclaimer.
10 .\" 2. Redistributions in binary form must reproduce the above copyright
11 .\"    notice, this list of conditions and the following disclaimer in the
12 .\"    documentation and/or other materials provided with the distribution.
13 .\"
14 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
15 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17 .\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
18 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 .\" SUCH DAMAGE.
25 .\"
26 .\" $FreeBSD$
27 .\"
28 .Dd January 2, 2006
29 .Dt MDMFS 8
30 .Os
31 .Sh NAME
32 .Nm mdmfs ,
33 .Nm mount_mfs
34 .Nd configure and mount an in-memory file system using the
35 .Xr md 4
36 driver
37 .Sh SYNOPSIS
38 .Nm
39 .Op Fl DLlMNPSUX
40 .Op Fl a Ar maxcontig
41 .Op Fl b Ar block-size
42 .Op Fl c Ar cylinders
43 .Op Fl d Ar rotdelay
44 .Op Fl e Ar maxbpg
45 .Op Fl F Ar file
46 .Op Fl f Ar frag-size
47 .Op Fl i Ar bytes
48 .Op Fl m Ar percent-free
49 .Op Fl n Ar rotational-positions
50 .Op Fl O Ar optimization
51 .Op Fl o Ar mount-options
52 .Op Fl p Ar permissions
53 .Op Fl s Ar size
54 .Op Fl v Ar version
55 .Op Fl w Ar user : Ns Ar group
56 .Ar md-device
57 .Ar mount-point
58 .Nm
59 .Fl C
60 .Op Fl lNU
61 .Op Fl a Ar maxcontig
62 .Op Fl b Ar block-size
63 .Op Fl c Ar cylinders
64 .Op Fl d Ar rotdelay
65 .Op Fl e Ar maxbpg
66 .Op Fl F Ar file
67 .Op Fl f Ar frag-size
68 .Op Fl i Ar bytes
69 .Op Fl m Ar percent-free
70 .Op Fl n Ar rotational-positions
71 .Op Fl O Ar optimization
72 .Op Fl o Ar mount-options
73 .Op Fl s Ar size
74 .Op Fl v Ar version
75 .Ar md-device
76 .Ar mount-point
77 .Sh DESCRIPTION
78 The
79 .Nm
80 utility is designed to be a work-alike and look-alike of the deprecated
81 .Xr mount_mfs 8 .
82 The end result is essentially the same,
83 but is accomplished in a completely different way.
84 The
85 .Nm
86 utility configures an
87 .Xr md 4
88 disk using
89 .Xr mdconfig 8 ,
90 puts a UFS file system on it using
91 .Xr newfs 8 ,
92 and mounts it using
93 .Xr mount 8 .
94 All the command line options are passed to the appropriate program
95 at the appropriate stage in order to achieve the desired effect.
96 .Pp
97 By default,
98 .Nm
99 creates a swap-based
100 .Pq Dv MD_SWAP
101 disk with soft-updates enabled
102 and mounts it on
103 .Ar mount-point .
104 It uses the
105 .Xr md 4
106 device specified by
107 .Ar md-device .
108 If
109 .Ar md-device
110 is
111 .Ql md
112 (no unit number),
113 it will use
114 .Xr md 4 Ns 's
115 auto-unit feature to automatically select an unused device.
116 Unless otherwise specified with one of the options below,
117 it uses the default arguments to all the helper programs.
118 .Pp
119 The following options are available.
120 Where possible,
121 the option letter matches the one used by
122 .Xr mount_mfs 8
123 for the same thing.
124 .Bl -tag -width indent
125 .It Fl a Ar maxcontig
126 Specify the maximum number of contiguous blocks that will be laid
127 out before forcing a rotational delay
128 (see the
129 .Fl d
130 option).
131 .It Fl b Ar block-size
132 The block size of the file system, in bytes.
133 .It Fl C
134 Enable full compatibility mode with
135 .Xr mount_mfs 8 .
136 See the
137 .Sx COMPATIBILITY
138 section for more information.
139 .It Fl c Ar cylinders
140 The number of cylinders per cylinder group in the file system.
141 .It Fl D
142 If not using auto-unit,
143 do not run
144 .Xr mdconfig 8
145 to try to detach the unit before attaching it.
146 .It Fl d Ar rotdelay
147 Specify the minimum time in milliseconds required to initiate another
148 disk transfer on the same cylinder.
149 Modern disks with read/write-behind achieve higher performance without
150 this feature,
151 so it is best to leave it at 0 milliseconds.
152 .It Fl e Ar maxbpg
153 Indicate the maximum number of blocks any single file can allocate
154 out of a cylinder group before it is forced to begin allocating
155 blocks from another cylinder group.
156 .It Fl F Ar file
157 Create a vnode-backed
158 .Pq Dv MD_VNODE
159 memory disk backed by
160 .Ar file .
161 .It Fl f Ar frag-size
162 The fragment size of the file system in bytes.
163 .It Fl i Ar bytes
164 Number of bytes per inode.
165 .It Fl l
166 Enable multilabel MAC on the new file system.
167 .It Fl L
168 Show the output of the helper programs.
169 By default,
170 it is sent to
171 .Pa /dev/null .
172 .It Fl M
173 Create a
174 .Xr malloc 9
175 backed disk
176 .Pq Dv MD_MALLOC
177 instead of a swap-backed disk.
178 .It Fl m Ar percent-free
179 The percentage of space reserved for the superuser.
180 .It Fl N
181 Do not actually run the helper programs.
182 This is most useful in conjunction with
183 .Fl X .
184 .It Fl n Ar rotational-positions
185 The default number of rotational positions to distinguish.
186 .It Fl O Ar optimization
187 Select the optimization preference;
188 valid choices are
189 .Cm space
190 and
191 .Cm time ,
192 which will optimize for minimum space fragmentation and
193 minimum time spent allocating blocks,
194 respectively.
195 .It Fl o Ar mount-options
196 Specify the mount options with which to mount the file system.
197 See
198 .Xr mount 8
199 for more information.
200 .It Fl P
201 Preserve the existing filesystem;
202 do not run
203 .Xr newfs 8 .
204 This only makes sense if
205 .Fl F
206 is specified to create a vnode-backed disk.
207 .It Fl p Ar permissions
208 Set the file (directory) permissions of the mount point
209 .Ar mount-point
210 to
211 .Ar permissions .
212 The
213 .Ar permissions
214 argument can be in any of the mode formats recognized by
215 .Xr chmod 1 .
216 If symbolic permissions are specified,
217 the operation characters
218 .Dq +
219 and
220 .Dq -
221 are interpreted relative to the initial permissions of
222 .Dq a=rwx .
223 .It Fl S
224 Do not enable soft-updates on the file system.
225 .It Fl s Ar size
226 Specify the size of the disk to create.
227 This only makes sense if
228 .Fl F
229 is
230 .Em not
231 specified.
232 That is,
233 this will work for the default swap-backed
234 .Pq Dv MD_SWAP
235 disks,
236 and the optional
237 .Pq Fl M
238 .Xr malloc 9
239 backed disks
240 .Pq Dv MD_MALLOC .
241 .It Fl U
242 Enable soft-updates on the file system.
243 This is the default, even in compatibility mode, and is accepted only
244 for compatibility.
245 It is only really useful to negate the
246 .Fl S
247 flag, should such a need occur.
248 .It Fl v Ar version
249 Specify the UFS version number for use on the file system; it may be
250 either
251 .Dv 1
252 or
253 .Dv 2 .
254 The default is derived from the default of the
255 .Xr newfs 8
256 command.
257 .It Fl w Ar user : Ns Ar group
258 Set the owner and group to
259 .Ar user
260 and
261 .Ar group ,
262 respectively.
263 The arguments have the same semantics as with
264 .Xr chown 8 ,
265 but specifying just a
266 .Ar user
267 or just a
268 .Ar group
269 is not supported.
270 .It Fl X
271 Print what command will be run before running it, and
272 other assorted debugging information.
273 .El
274 .Pp
275 The
276 .Fl F
277 and
278 .Fl s
279 options are passed to
280 .Xr mdconfig 8
281 as
282 .Fl f
283 and
284 .Fl s ,
285 respectively.
286 The
287 .Fl a , b , c , d , e , f , i , m
288 and
289 .Fl n
290 options are passed to
291 .Xr newfs 8
292 with the same letter;
293 the
294 .Fl O
295 option is passed to
296 .Xr newfs 8
297 as
298 .Fl o .
299 The
300 .Fl o
301 option is passed to
302 .Xr mount 8
303 with the same letter.
304 See the programs that the options are passed to for more information
305 on their semantics.
306 .Sh EXAMPLES
307 Create and mount a 32 megabyte swap-backed file system on
308 .Pa /tmp :
309 .Pp
310 .Dl "mdmfs -s 32m md /tmp"
311 .Pp
312 The same file system created as an entry in
313 .Pa /etc/fstab :
314 .Pp
315 .Dl "md /tmp mfs rw,-s32m 2 0"
316 .Pp
317 Create and mount a 16 megabyte malloc-backed file system on
318 .Pa /tmp
319 using the
320 .Pa /dev/md1
321 device;
322 furthermore,
323 do not use soft-updates on it and mount it
324 .Cm async :
325 .Pp
326 .Dl "mdmfs -M -S -o async -s 16m md1 /tmp"
327 .Sh COMPATIBILITY
328 The
329 .Nm
330 utility, while designed to be fully compatible with
331 .Xr mount_mfs 8 ,
332 can be useful by itself.
333 Since
334 .Xr mount_mfs 8
335 had some silly defaults, a
336 .Dq full compatibility
337 mode is provided for the case where bug-to-bug compatibility is desired.
338 .Pp
339 Full compatibility is enabled with the
340 .Fl C
341 flag,
342 or by starting
343 .Nm
344 with the name
345 .Li mount_mfs
346 or
347 .Li mfs
348 (as returned by
349 .Xr getprogname 3 ) .
350 In this mode, only the options which would be accepted by
351 .Xr mount_mfs 8
352 are valid.
353 Furthermore, the following behavior, as done by
354 .Xr mount_mfs 8 ,
355 is duplicated:
356 .Bl -bullet -offset indent
357 .It
358 The file mode of
359 .Ar mount-point
360 is set to
361 .Li 01777
362 as if
363 .Fl p Ar 1777
364 was given on the command line.
365 .El
366 .Sh SEE ALSO
367 .Xr md 4 ,
368 .Xr fstab 5 ,
369 .Xr mdconfig 8 ,
370 .Xr mount 8 ,
371 .Xr newfs 8
372 .Sh AUTHORS
373 .An Dima Dorfman