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 77utility 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. 81The 82.Nm 83utility configures an 84.Xr md 4 85disk using 86.Xr mdconfig 8 , 87labels it using 88.Xr disklabel 8 , 89puts a UFS filesystem 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 filesystem, 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 filesystem. 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 mininum 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 filesystem 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 filesystem. 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 filesystem. 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 filesystem. 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 w Ar user : Ns Ar group 228Set the owner and group to 229.Ar user 230and 231.Ar group , 232respectively. 233The arguments have the same semantics as with 234.Xr chown 8 , 235but specifying just a 236.Ar user 237or just a 238.Ar group 239is not supported. 240.It Fl X 241Print what command will be run before running it, and 242other assorted debugging information. 243.El 244.Pp 245The 246.Fl F 247and 248.Fl s 249options are passed to 250.Xr mdconfig 8 251as 252.Fl f 253and 254.Fl s , 255respectively. 256The 257.Fl a , b , c , d , e , f , i , m 258and 259.Fl n 260options are passed to 261.Xr newfs 8 262with the same letter; 263the 264.Fl O 265option is passed to 266.Xr newfs 8 267as 268.Fl o . 269The 270.Fl o 271option is passed to 272.Xr mount 8 273with the same letter. 274See the programs that the options are passed to for more information 275on their semantics. 276.Sh EXAMPLES 277Create and mount a 32 megabyte swap-backed filesystem on 278.Pa /tmp : 279.Pp 280.Dl "mdmfs -s 32m md /tmp" 281.Pp 282Create and mount a 16 megabyte malloc-backed filesystem on 283.Pa /tmp 284using the 285.Pa /dev/md1 286device; 287furthermore, 288do not use soft-updates on it and mount it 289.Cm async : 290.Pp 291.Dl "mdmfs -M -S -o async -s 16m md1 /tmp" 292.Sh COMPATIBILITY 293The 294.Nm 295utility, while designed to be fully compatible with 296.Xr mount_mfs 8 , 297can be useful by itself. 298Since 299.Xr mount_mfs 8 300has some silly defaults, a 301.Dq full compatibility 302mode is provided for the case where bug-to-bug compatibility is desired. 303.Pp 304Full compatibility is enabled with the 305.Fl C 306flag, 307or by starting 308.Nm 309with the name 310.Li mount_mfs 311or 312.Li mfs 313(as returned by 314.Xr getprogname 3 ) . 315In this mode, only the options which would be accepted by 316.Xr mount_mfs 8 317are valid. 318Furthermore, the following behavior, as done by 319.Xr mount_mfs 8 , 320is duplicated: 321.Bl -bullet -offset indent 322.It 323The file mode of 324.Ar mount-point 325is set to 326.Li 01777 327as if 328.Fl p Ar 1777 329was given on the command line. 330.El 331.Sh SEE ALSO 332.Xr md 4 , 333.Xr fstab 5 , 334.Xr disklabel 8 , 335.Xr mdconfig 8 , 336.Xr mount 8 , 337.Xr newfs 8 338.Sh AUTHORS 339.An Dima Dorfman 340