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