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