mdmfs.8 revision 81742

Copyright (c) 2001 Dima Dorfman.
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.

$FreeBSD: head/sbin/mdmfs/mdmfs.8 81742 2001-08-16 02:40:29Z dd $

.Dd August 5, 2001 .Dt MDMFS 8 .Os .Sh NAME .Nm mdmfs .Nd configure and mount an in-memory filesystem using the .Xr md 4 driver .Sh SYNOPSIS .Nm .Op Fl DLMNSUX .Op Fl a Ar maxcontig .Op Fl b Ar block-size .Op Fl c Ar cylinders .Op Fl d Ar rotdelay .Op Fl e Ar maxbpg .Op Fl F Ar file .Op Fl f Ar frag-size .Op Fl i Ar bytes .Op Fl m Ar percent-free .Op Fl n Ar rotational-positions .Op Fl O Ar optimization .Op Fl o Ar mount-options .Op Fl p Ar permissions .Op Fl s Ar size .Op Fl w Ar user : Ns Ar group .Ar md-device .Ar mount-point .Nm .Fl C .Op Fl NU .Op Fl a Ar maxcontig .Op Fl b Ar block-size .Op Fl c Ar cylinders .Op Fl d Ar rotdelay .Op Fl e Ar maxbpg .Op Fl F Ar file .Op Fl f Ar frag-size .Op Fl i Ar bytes .Op Fl m Ar percent-free .Op Fl n Ar rotational-positions .Op Fl O Ar optimization .Op Fl o Ar mount-options .Op Fl s Ar size .Ar md-device .Ar mount-point .Sh DESCRIPTION The .Nm program is designed to be a work-alike and look-alike of the deprecated .Xr mount_mfs 8 . The end result is essentially the same, but is accomplished in a completely different way. .Nm configures an .Xr md 4 disk using .Xr mdconfig 8 , labels it using .Xr disklabel 8 , puts a UFS filesystem on it using .Xr newfs 8 , and mounts it using .Xr mount 8 . All the command line options are passed to the appropriate program at the appropriate stage in order to achieve the desired effect.

p By default, .Nm creates a swap-based

q Dv MD_SWAP disk with soft-updates enabled and mounts it on .Ar mount-point . It uses the .Xr md 4 device specified by .Ar md-device . If .Ar md-device is .Ql md (no unit number), it will use .Xr md 4 Ns 's auto-unit feature to automatically select an unused device. Unless otherwise specified with one of the options below, it uses the default arguments to all the helper programs.

p The following options are available. Where possible, the option letter matches the one used by .Xr mount_mfs 8 for the same thing. l -tag -width indent t Fl a Ar maxcontig Specify the maximum number of contiguous blocks that will be laid out before forcing a rotational delay (see the .Fl d option). t Fl b Ar block-size The block size of the filesystem, in bytes. t Fl C Enable full compatibility mode with .Xr mount_mfs 8 . See the XXX link to another section?
.Em COMPATIBILITY section for more information. t Fl c Ar cylinders The number of cylinders per cylinder group in the filesystem. t Fl D If not using auto-unit, do not run .Xr mdconfig 8 to try to detach the unit before attaching it. t Fl d Ar rotdelay Specify the mininum time in milliseconds required to initiate another disk transfer on the same cylinder. Modern disks with read/write-behind achieve higher performance without this feature, so it is best to leave it at 0 milliseconds. t Fl e Ar maxbpg Indicate the maximum number of blocks any single file can allocate out of a cylinder group before it is forced to begin allocating blocks from another cylinder group. t Fl F Ar file Create a vnode-backed

q Dv MD_VNODE memory disk backed by .Ar file . t Fl f Ar frag-size The fragment size of the filesystem in bytes. t Fl i Ar bytes Number of bytes per inode. t Fl L Show the output of the helper programs. By default, it is sent to

a /dev/null . t Fl M Create a .Xr malloc 9 backed disk

q Dv MD_MALLOC instead of a swap-backed disk. t Fl m Ar percent-free The percentage of space reserved for the superuser. t Fl N Do not actually run the helper programs. This is most useful in conjunction with .Fl X . t Fl n Ar rotational-positions The default number of rotational positions to distinguish. t Fl O Ar optimization Select the optimization preference; valid choices are .Cm space and .Cm time , which will optimize for minimum space fragmentation and minimum time spent allocating blocks, respectively. t Fl o Ar mount-options Specify the mount options with which to mount the filesystem. See .Xr mount 8 for more information. t Fl p Ar permissions Set the file (directory) permissions of the mount point .Ar mount-point to .Ar permissions . t Fl S Do not enable soft-updates on the filesystem. t Fl s Ar size Specify the size of the disk to create. This only makes sense if .Fl F is .Em not specified. That is, this will work for the default swap-backed

q Dv MD_SWAP disks, and the optional

q Fl M .Xr malloc 9 backed disks

q Dv MD_MALLOC . t Fl U Enable soft-updates on the filesystem. This is the default, even in compatibility mode, and is accepted only for compatibility. It is only really useful to negate the .Fl S flag, should such a need occur. t Fl w Ar user : Ns Ar group Set the owner and group to .Ar user and .Ar group , respectively. The arguments have the same semantics as with .Xr chown 8 , but specifying just a .Ar user or just a .Ar group is not supported. t Fl X Print what command will be run before running it, and other assorted debugging information. .El

p The .Fl F and .Fl s options are passed to .Xr mdconfig 8 as .Fl f and .Fl s , respectively. The .Fl a , b , c , d , e , f , i , m and .Fl n options are passed to .Xr newfs 8 with the same letter; the .Fl O option is passed to .Xr newfs 8 as .Fl o . The .Fl o option is passed to .Xr mount 8 with the same letter. See the programs that the options are passed to for more information on their semantics. .Sh EXAMPLES Create and mount a 32 megabyte swap-backed filesystem on

a /tmp :

p .Dl "mdmfs -s 32m md /tmp"

p Create and mount a 16 megabyte malloc-backed filesystem on

a /tmp using the

a /dev/md1 device; furthermore, do not use soft-updates on it and mount it .Cm async :

p .Dl "mdmfs -M -S -o async -s 16m md1 /tmp" .Sh COMPATIBILITY .Nm , while designed to be fully compatible with .Xr mount_mfs 8 , can be useful by itself. Since .Xr mount_mfs 8 has some silly defaults, a .Dq full compatibility mode is provided for the case where bug-to-bug compatibility is desired.

p Full compatibility is enabled with the .Fl C flag, or by starting .Nm with .Li mount_ at the beginning of its name (as returned by .Xr getprogname 3 ) . In this mode, only the options which would be accepted by .Xr mount_mfs 8 are valid. Furthermore, the following behavior, as done by .Xr mount_mfs 8 , is duplicated: l -bullet -offset indent -compat t The file mode of .Ar mount-point is set to .Li 01777 as if .Fl p Ar 1777 was given on the command line. .El .Sh SEE ALSO .Xr md 4 , .Xr fstab 5 , .Xr disklabel 8 , .Xr mdconfig 8 , .Xr mount 8 , .Xr newfs 8 .Sh AUTHORS .An Dima Dorfman