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