1.\" 2.\" Copyright (c) 2001 Dima Dorfman <dd@FreeBSD.org> 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 May 26, 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 DLMNSX 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.Sh DESCRIPTION 57The 58.Nm 59program is designed to be a work-alike and look-alike of the deprecated 60.Xr mount_mfs 8 . 61The end result is essentially the same, 62but is accomplished in a completely different way. 63.Nm 64configures an 65.Xr md 4 66disk using 67.Xr mdconfig 8 , 68labels it using 69.Xr disklabel 8 , 70puts a UFS filesystem on it using 71.Xr newfs 8 , 72and mounts it using 73.Xr mount 8 . 74All the command line options are passed to the appropriate program 75at the appropriate stage in order to achieve the desired effect. 76.Pp 77By default, 78.Nm 79creates a swap-based 80.Pq Dv MD_SWAP 81disk with soft-updates enabled 82and mounts it on 83.Ar mount-point . 84It uses the 85.Xr md 4 86device specified by 87.Ar md-device . 88If 89.Ar md-device 90is 91.Ql md 92(no unit number), 93it will use 94.Xr md 4 Ns 's 95auto-unit feature to automatically select an unused device. 96Unless otherwise specified with one of the options below, 97it uses the default arguments to all the helper programs. 98.Pp 99The following options are available. 100Where possible, 101the option letter matches the one used by 102.Xr mount_mfs 8 103for the same thing. 104.Bl -tag -width indent 105.It Fl a Ar maxcontig 106Specify the maximum number of contiguous blocks that will be laid 107out before forcing a rotational delay 108(see the 109.Fl d 110option). 111.It Fl b Ar block-size 112The block size of the filesystem, in bytes. 113.It Fl c Ar cylinders 114The number of cylinders per cylinder group in the filesystem. 115.It Fl D 116If not using auto-unit, 117do not run 118.Xr mdconfig 8 119to try to detach the unit before attaching it. 120.It Fl d Ar rotdelay 121Specify the mininum time in milliseconds required to initiate another 122disk transfer on the same cylinder. 123Modern disks with read/write-behind achieve higher performance without 124this feature, 125so it is best to leave it at 0 milliseconds. 126.It Fl e Ar maxbpg 127Indicate the maximum number of blocks any single file can allocate 128out of a cylinder group before it is forced to begin allocating 129blocks from another cylinder group. 130.It Fl F Ar file 131Create a vnode-backed 132.Pq Dv MD_VNODE 133memory disk backed by 134.Ar file . 135.It Fl f Ar frag-size 136The fragment size of the filesystem in bytes. 137.It Fl i Ar bytes 138Number of bytes per inode. 139.It Fl L 140Show the output of the helper programs. 141By default, 142it is sent to 143.Pa /dev/null . 144.It Fl M 145Create a 146.Xr malloc 9 147backed disk 148.Pq Dv MD_MALLOC 149instead of a swap-backed disk. 150.It Fl m Ar percent-free 151The percentage of space reserved for the superuser. 152.It Fl N 153Do not actually run the helper programs. 154This is most useful in conjunction with 155.Fl X . 156.It Fl n Ar rotational-positions 157The default number of rotational positions to distinguish. 158.It Fl O Ar optimization 159Select the optimization preference; 160valid choices are 161.Cm space 162and 163.Cm time , 164which will optimize for minimum space fragmentation and 165minimum time spent allocating blocks, 166respectively. 167.It Fl o Ar mount-options 168Specify the mount options with which to mount the filesystem. 169See 170.Xr mount 8 171for more information. 172.It Fl p Ar permissions 173Set the file (directory) permissions of the mount point 174.Ar mount-point 175to 176.Ar permissions . 177.It Fl S 178Do not enable soft-updates on the filesystem. 179.It Fl s Ar size 180Specify the size of the disk to create. 181This only makes sense if 182.Fl F 183is 184.Em not 185specified. 186That is, 187this will work for the default swap-backed 188.Pq Dv MD_SWAP 189disks, 190and the optional 191.Pq Fl M 192.Xr malloc 9 193backed disks 194.Pq Dv MD_MALLOC . 195.It Fl w Ar user : Ns Ar group 196Set the owner and group to 197.Ar user 198and 199.Ar group , 200respectively. 201The arguments have the same semantics as with 202.Xr chown 8 , 203but specifying just a 204.Ar user 205or just a 206.Ar group 207is not supported. 208.El 209.Pp 210The 211.Fl F 212and 213.Fl s 214options are passed to 215.Xr mdconfig 8 216as 217.Fl f 218and 219.Fl s , 220respectively. 221The 222.Fl a , b , c , d , e , f , i , m 223and 224.Fl n 225options are passed to 226.Xr newfs 8 227with the same letter; 228the 229.Fl O 230option is passed to 231.Xr newfs 8 232as 233.Fl o . 234The 235.Fl o 236option is passed to 237.Xr mount 8 238with the same letter. 239See the programs that the options are passed to for more information 240on their semantics. 241.Sh EXAMPLES 242Create and mount a 32 megabyte swap-backed filesystem on 243.Pa /tmp : 244.Pp 245.Dl "mdmfs -s 32m md /tmp" 246.Pp 247Create and mount a 16 megabyte malloc-backed filesystem on 248.Pa /tmp 249using the 250.Pa /dev/md1 251device; 252furthermore, 253do not use soft-updates it and mount it 254.Cm async : 255.Pp 256.Dl "mdmfs -M -S -o async -s 16m md1 /tmp" 257.Sh SEE ALSO 258.Xr md 4 , 259.Xr disklabel 8 , 260.Xr mdconfig 8 , 261.Xr mount 8 , 262.Xr newfs 8 263.Sh AUTHORS 264.An Dima Dorfman 265.Aq dd@FreeBSD.org 266