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