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