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