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