MDMFS(8)
π MDMFS(8) β the mdmfs / mount_mfs glow-up guide π
okay so bestie, you're reading the MDMFS(8) page from the System Manager's Manual, section 8 (that's the admin-commands girlies). grab a strawberry drink, we're configuring an in-memory file system together and it's gonna be iconic. β¨
πΈ NAME πΈ
mdmfs, mount_mfs β configure and mount an in-memory file system, either using the md(4) driver or using the tmpfs(4) filesystem. two paths, one destiny, no cap. π«
π¦ SYNOPSIS π¦
mdmfs [-DLlMNnPStTUX] [-a maxcontig] [-b block-size]
[-c blocks-per-cylinder-group] [-d max-extent-size]
[-E path-mdconfig] [-e maxbpg] [-F file] [-f frag-size] [-i bytes]
[-k skel] [-m percent-free] [-O optimization] [-o mount-options]
[-p permissions] [-s size] [-T fstype] [-v version]
[-w user:group] md-device mount-point
like, yeah, that's a lot of letters. it's giving alphabet soup but make it powerful. π«Ά
π DESCRIPTION π
so the mdmfs utility is literally designed to be a work-alike and a look-alike of the deprecated mount_mfs. the end result? essentially the same. the way it gets there? completely different, main character energy only. π₯
working off md-device, mdmfs either:
- creates a
tmpfs(4)filesystem, or - configures an
md(4)disk usingmdconfig(8), slaps a UFS file system on it (unless-Pwas specified) usingnewfs(8), and mounts it usingmount(8).
it can also handle geom_uzip(4) compressed disk images β as long as your kernel supports that GEOM class. all the command line options get passed to the appropriate program at the appropriate stage so you get exactly the effect you asked for. it's a whole relay race and everyone ate. πββοΈπ¨
when md-device is `auto', mdmfs uses tmpfs(4) if it's present in the kernel or can be loaded as a module. otherwise it falls back to using the md(4) auto-unit, exactly as if you'd specified `md'.
when md-device is `tmpfs', mdmfs mounts a tmpfs(4) filesystem, translating the -s size option (if present) into a `-o size=' mount option. any -o options on the command line get passed straight through to the tmpfs(4) mount. options that are specific to mdconfig(8) or newfs(8)? ignored. bye. π
when md-device does not result in tmpfs(4) being used, then an md(4) device gets configured instead. by default, mdmfs creates a swap-based (MD_SWAP) disk with soft-updates enabled and mounts it on mount-point. it uses the md(4) device specified by md-device. if md-device is βmdβ (no unit number), it'll use md(4)'s auto-unit feature to automatically pick an unused device. unless you say otherwise with one of the options below, it uses the default arguments for all the helper programs. defaults are cute like that. π
the following options are available. where possible, the option letter matches the one mount_mfs used for the same thing β consistency queen. π
β¨ OPTIONS β¨
-amaxcontig β specify the maximum number of contiguous blocks that get laid out before forcing a rotational delay (check the-doption for the related tea β).-bblock-size β the block size of the file system, in bytes.-cblocks-per-cylinder-group β the number of blocks per cylinder group in the file system.-Dβ if you're not using auto-unit, don't runmdconfig(8)to try to detach the unit before attaching it. skip the breakup, go straight to the situationship. π-dmax-extent-size β the file system may choose to store large files using extents. this parameter specifies the largest extent size that may be used. it is presently limited to its default value, which is 16 times the file system blocksize. (so like, don't get creative with it, bestie. it's locked in. π)-Epath-mdconfig β use path-mdconfig as the location of themdconfig(8)utility.-emaxbpg β indicate the maximum number of blocks any single file can allocate out of a cylinder group before it's forced to start allocating blocks from another cylinder group. boundaries, we love to see them. π-Ffile β create a vnode-backed (MD_VNODE) memory disk backed by file.-ffrag-size β the fragment size of the file system in bytes.-ibytes β number of bytes per inode.-kskel β copy the content of directory skel into mount-point.-lβ enable multilabel MAC on the new file system.-Lβ show the output of the helper programs. by default it's sent to/dev/null(silenced, ghosted, gone πΆβπ«οΈ).-Mβ create amalloc(9)-backed disk (MD_MALLOC) instead of a swap-backed disk.-mpercent-free β the percentage of space reserved for the superuser.-Nβ do not actually run the helper programs. this is most useful in conjunction with-X.-nβ do not create a.snapdirectory on the new file system.-Ooptimization β select the optimization preference; valid choices arespaceandtime, which optimize for minimum space fragmentation and minimum time spent allocating blocks, respectively. pick your fighter. βοΈ-omount-options β specify the mount options with which to mount the file system. seemount(8)for more info.-Pβ preserve the existing file system; do not runnewfs(8). this only makes sense if-Fis specified to create a vnode-backed disk.-ppermissions β set the file (directory) permissions of the mount point mount-point to permissions. the permissions argument can be in any of the mode formats recognized bychmod(1). if symbolic permissions are specified, the operation charactersβ+βandβ-βare interpreted relative to the initial permissions ofβa=rwxβ.-Sβ do not enable soft-updates on the file system.-ssize β specify the size of the disk to create. this only makes sense if-Fis not specified. that is, it'll work when the backing storage is some form of memory, as opposed to a fixed-size file. the size may include the usual SI suffixes (k,m,g,t,p). a number without a suffix is interpreted as a count of 512-byte sectors. (so32mslaps, and a bare number means sectors, iykyk π§)-tβ turn on the TRIM enable flag fornewfs(8). when used with a file system that issuesBIO_DELETEbio requests,md(4)returns deleted blocks to the system memory pool. recycling era β»οΈβ¨-Tfstype β specify a file system type for a vnode-backed memory disk. any file system supported by themount(8)command can be specified. this option only makes sense when-Fand-Pare used.-Uβ enable soft-updates on the file system. this is the default, and is accepted only for compatibility. it's only really useful to negate the-Sflag, should such a need occur. (yes she's redundant, she's still invited to the party π)-vversion β specify the UFS version number for use on the file system; it may be either1or2. the default is derived from the default of thenewfs(8)command.-wuser:group β set the owner and group to user and group, respectively. the arguments have the same semantics as withchown(8), but specifying just a user or just a group is not supported. (both or nothing, babe. π)-Xβ print what command will be run before running it, plus other assorted debugging information. narrating your own life, honestly iconic. π€
so here's the passing-the-notes situation, bestie π:
- the
-Fand-soptions are passed tomdconfig(8)as-fand-s, respectively. - the
-a,-b,-c,-d,-e,-f,-i,-mand-noptions are passed tonewfs(8)with the same letter. - the
-Ooption is passed tonewfs(8)as-o. - the
-ooption is passed tomount(8)with the same letter. - the
-Toption is passed tomount(8)as-t.
for info on semantics, refer to the documentation of the programs the options are passed to. they said what they said. π¬
π EXAMPLES π
create and mount a 32 megabyte swap-backed file system on /tmp:
mdmfs -s 32m md /tmp
the same file system, created as an entry in /etc/fstab:
md /tmp mfs rw,-s32m 2 0
create and mount a 16 megabyte malloc-backed file system on /tmp using the /dev/md1 device; furthermore, do not use soft-updates on it and mount it async:
mdmfs -M -S -o async -s 16m md1 /tmp
create and mount a geom_uzip(4)-based compressed disk image:
mdmfs -P -F foo.uzip -oro md.uzip /tmp/
mount the same image, specifying the /dev/md1 device:
mdmfs -P -F foo.uzip -oro md1.uzip /tmp/
configure a vnode-backed file system and mount its first partition, using automatic device numbering:
mdmfs -P -F foo.img mds1a /tmp/
mount a vnode-backed cd9660 file system using automatic device numbering:
mdmfs -T cd9660 -P -F foo.iso md /tmp
π COMPATIBILITY π
the mdmfs utility, while designed to be compatible with mount_mfs, can absolutely be useful all by itself. but since mount_mfs had some silly defaults, a βcompatibilityβ mode is provided for when bug-to-bug compatibility is what you actually want. (yes, bug-to-bug. we're honoring the mess. π)
compatibility is enabled by starting mdmfs with the name mount_mfs or mfs (as returned by getprogname(3)). in this mode, the following behavior, as done by mount_mfs, is duplicated:
- the file mode of mount-point is set by default to
01777as if-p 1777was given on the command line.
π¦ SEE ALSO π¦
md(4), tmpfs(4), fstab(5), mdconfig(8), mount(8), newfs(8) β go read the whole friend group, they're all linked. π
β HISTORY β
the mdmfs utility appeared in FreeBSD 5.0. a legend was born. π
π AUTHORS π
Dima Dorfman β thank you for your service, king. π«Ά
and that's the whole page, bestie! every flag, every caveat, every default β nothing dropped, nothing skipped, no cap. π§ββοΈβ¨
this lil rewrite is serving the Debian flavor of the page, dated October 31, 2019, and it's called MDMFS(8) β mwah, go mount something cute. π π
π¦ where this page comes from
- freebsd 15.1: base 15.1
- Copyright (c) 2001 Dima Dorfman
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms