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