2001-06-18 23:46:58 +00:00
|
|
|
.\"
|
2001-07-30 09:11:17 +00:00
|
|
|
.\" Copyright (c) 2001 Dima Dorfman.
|
2001-06-18 23:46:58 +00:00
|
|
|
.\" 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$
|
|
|
|
.\"
|
2016-03-11 06:07:09 +00:00
|
|
|
.Dd March 9, 2016
|
2001-06-18 23:46:58 +00:00
|
|
|
.Dt MDMFS 8
|
|
|
|
.Os
|
|
|
|
.Sh NAME
|
2003-04-27 01:40:45 +00:00
|
|
|
.Nm mdmfs ,
|
|
|
|
.Nm mount_mfs
|
2002-08-21 18:11:48 +00:00
|
|
|
.Nd configure and mount an in-memory file system using the
|
2001-06-18 23:46:58 +00:00
|
|
|
.Xr md 4
|
|
|
|
driver
|
|
|
|
.Sh SYNOPSIS
|
|
|
|
.Nm
|
2016-03-11 06:07:09 +00:00
|
|
|
.Op Fl DLlMNnPStTUX
|
2001-06-18 23:46:58 +00:00
|
|
|
.Op Fl a Ar maxcontig
|
|
|
|
.Op Fl b Ar block-size
|
2007-02-15 14:46:04 +00:00
|
|
|
.Op Fl c Ar blocks-per-cylinder-group
|
2012-03-29 05:02:12 +00:00
|
|
|
.Op Fl d Ar max-extent-size
|
2006-02-16 21:28:54 +00:00
|
|
|
.Op Fl E Ar path-mdconfig
|
2001-06-18 23:46:58 +00:00
|
|
|
.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 O Ar optimization
|
|
|
|
.Op Fl o Ar mount-options
|
|
|
|
.Op Fl p Ar permissions
|
|
|
|
.Op Fl s Ar size
|
2016-03-11 06:07:09 +00:00
|
|
|
.Op Fl T Ar fstype
|
2002-12-01 23:19:57 +00:00
|
|
|
.Op Fl v Ar version
|
2001-06-20 00:34:20 +00:00
|
|
|
.Op Fl w Ar user : Ns Ar group
|
2001-06-18 23:46:58 +00:00
|
|
|
.Ar md-device
|
|
|
|
.Ar mount-point
|
|
|
|
.Sh DESCRIPTION
|
|
|
|
The
|
|
|
|
.Nm
|
2002-07-06 19:34:18 +00:00
|
|
|
utility is designed to be a work-alike and look-alike of the deprecated
|
2001-06-18 23:46:58 +00:00
|
|
|
.Xr mount_mfs 8 .
|
|
|
|
The end result is essentially the same,
|
|
|
|
but is accomplished in a completely different way.
|
2002-07-06 19:34:18 +00:00
|
|
|
The
|
2001-06-18 23:46:58 +00:00
|
|
|
.Nm
|
2002-07-06 19:34:18 +00:00
|
|
|
utility configures an
|
2001-06-18 23:46:58 +00:00
|
|
|
.Xr md 4
|
|
|
|
disk using
|
|
|
|
.Xr mdconfig 8 ,
|
2006-10-01 09:40:55 +00:00
|
|
|
puts a UFS file system on it (unless
|
|
|
|
.Fl P
|
|
|
|
was specified) using
|
2001-06-18 23:46:58 +00:00
|
|
|
.Xr newfs 8 ,
|
|
|
|
and mounts it using
|
|
|
|
.Xr mount 8 .
|
2012-03-29 05:02:12 +00:00
|
|
|
It can handle
|
|
|
|
.Xr geom_uzip 4
|
2007-02-15 21:49:32 +00:00
|
|
|
compressed disk images, as long as the kernel supports this GEOM class.
|
2001-06-18 23:46:58 +00:00
|
|
|
All the command line options are passed to the appropriate program
|
|
|
|
at the appropriate stage in order to achieve the desired effect.
|
|
|
|
.Pp
|
|
|
|
By default,
|
|
|
|
.Nm
|
|
|
|
creates a swap-based
|
|
|
|
.Pq 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.
|
|
|
|
.Pp
|
|
|
|
The following options are available.
|
|
|
|
Where possible,
|
|
|
|
the option letter matches the one used by
|
|
|
|
.Xr mount_mfs 8
|
|
|
|
for the same thing.
|
2001-06-20 00:34:20 +00:00
|
|
|
.Bl -tag -width indent
|
2001-06-18 23:46:58 +00:00
|
|
|
.It 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).
|
|
|
|
.It Fl b Ar block-size
|
2002-08-21 18:11:48 +00:00
|
|
|
The block size of the file system, in bytes.
|
2007-02-15 14:46:04 +00:00
|
|
|
.It Fl c Ar blocks-per-cylinder-group
|
|
|
|
The number of blocks per cylinder group in the file system.
|
2001-06-18 23:46:58 +00:00
|
|
|
.It Fl D
|
|
|
|
If not using auto-unit,
|
2001-06-20 00:34:20 +00:00
|
|
|
do not run
|
2001-06-18 23:46:58 +00:00
|
|
|
.Xr mdconfig 8
|
|
|
|
to try to detach the unit before attaching it.
|
2007-02-15 14:46:04 +00:00
|
|
|
.It Fl d Ar max-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.
|
2006-02-16 21:28:54 +00:00
|
|
|
.It Fl E Ar path-mdconfig
|
|
|
|
Use
|
|
|
|
.Ar path-mdconfig
|
|
|
|
as a location of the
|
|
|
|
.Xr mdconfig 8
|
|
|
|
utility.
|
2001-06-18 23:46:58 +00:00
|
|
|
.It 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.
|
|
|
|
.It Fl F Ar file
|
|
|
|
Create a vnode-backed
|
|
|
|
.Pq Dv MD_VNODE
|
|
|
|
memory disk backed by
|
|
|
|
.Ar file .
|
|
|
|
.It Fl f Ar frag-size
|
2002-08-21 18:11:48 +00:00
|
|
|
The fragment size of the file system in bytes.
|
2001-06-18 23:46:58 +00:00
|
|
|
.It Fl i Ar bytes
|
|
|
|
Number of bytes per inode.
|
2004-02-26 01:15:47 +00:00
|
|
|
.It Fl l
|
2004-05-17 08:35:43 +00:00
|
|
|
Enable multilabel MAC on the new file system.
|
2001-06-18 23:46:58 +00:00
|
|
|
.It Fl L
|
|
|
|
Show the output of the helper programs.
|
|
|
|
By default,
|
|
|
|
it is sent to
|
|
|
|
.Pa /dev/null .
|
|
|
|
.It Fl M
|
|
|
|
Create a
|
|
|
|
.Xr malloc 9
|
|
|
|
backed disk
|
|
|
|
.Pq Dv MD_MALLOC
|
|
|
|
instead of a swap-backed disk.
|
|
|
|
.It Fl m Ar percent-free
|
|
|
|
The percentage of space reserved for the superuser.
|
|
|
|
.It Fl N
|
2001-06-20 00:34:20 +00:00
|
|
|
Do not actually run the helper programs.
|
2001-06-18 23:46:58 +00:00
|
|
|
This is most useful in conjunction with
|
|
|
|
.Fl X .
|
2016-03-07 10:56:21 +00:00
|
|
|
.It Fl n
|
|
|
|
Do not create a
|
|
|
|
.Pa .snap
|
|
|
|
directory on the new file system.
|
2001-06-18 23:46:58 +00:00
|
|
|
.It Fl O Ar optimization
|
|
|
|
Select the optimization preference;
|
|
|
|
valid choices are
|
2001-06-20 00:34:20 +00:00
|
|
|
.Cm space
|
2001-06-18 23:46:58 +00:00
|
|
|
and
|
2001-06-20 00:34:20 +00:00
|
|
|
.Cm time ,
|
2001-06-18 23:46:58 +00:00
|
|
|
which will optimize for minimum space fragmentation and
|
|
|
|
minimum time spent allocating blocks,
|
|
|
|
respectively.
|
|
|
|
.It Fl o Ar mount-options
|
2002-08-21 18:11:48 +00:00
|
|
|
Specify the mount options with which to mount the file system.
|
2001-06-18 23:46:58 +00:00
|
|
|
See
|
|
|
|
.Xr mount 8
|
|
|
|
for more information.
|
2006-01-02 01:50:30 +00:00
|
|
|
.It Fl P
|
2006-09-18 11:55:10 +00:00
|
|
|
Preserve the existing file system;
|
2006-01-02 01:50:30 +00:00
|
|
|
do not run
|
|
|
|
.Xr newfs 8 .
|
|
|
|
This only makes sense if
|
|
|
|
.Fl F
|
|
|
|
is specified to create a vnode-backed disk.
|
2001-06-18 23:46:58 +00:00
|
|
|
.It Fl p Ar permissions
|
|
|
|
Set the file (directory) permissions of the mount point
|
|
|
|
.Ar mount-point
|
|
|
|
to
|
|
|
|
.Ar permissions .
|
2003-08-05 15:04:39 +00:00
|
|
|
The
|
|
|
|
.Ar permissions
|
|
|
|
argument can be in any of the mode formats recognized by
|
|
|
|
.Xr chmod 1 .
|
|
|
|
If symbolic permissions are specified,
|
|
|
|
the operation characters
|
|
|
|
.Dq +
|
|
|
|
and
|
|
|
|
.Dq -
|
|
|
|
are interpreted relative to the initial permissions of
|
|
|
|
.Dq a=rwx .
|
2001-06-18 23:46:58 +00:00
|
|
|
.It Fl S
|
2002-08-21 18:11:48 +00:00
|
|
|
Do not enable soft-updates on the file system.
|
2001-06-18 23:46:58 +00:00
|
|
|
.It 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
|
|
|
|
.Pq Dv MD_SWAP
|
|
|
|
disks,
|
|
|
|
and the optional
|
|
|
|
.Pq Fl M
|
|
|
|
.Xr malloc 9
|
|
|
|
backed disks
|
|
|
|
.Pq Dv MD_MALLOC .
|
2011-09-06 10:19:01 +00:00
|
|
|
.It Fl t
|
|
|
|
Turn on the TRIM enable flag for
|
|
|
|
.Xr newfs 8 .
|
2016-03-11 06:07:09 +00:00
|
|
|
When used with a file system that issue BIO_DELETE bio requests,
|
2011-09-06 10:19:01 +00:00
|
|
|
.Xr md 4
|
2016-03-11 06:07:09 +00:00
|
|
|
returns deleted blocks to the system memory pool.
|
|
|
|
.It Fl T Ar fstype
|
|
|
|
Specify a file system type for a vnode-backed memory disk.
|
|
|
|
Any file system supported by
|
|
|
|
.Xr mount 8
|
|
|
|
command can be specified.
|
|
|
|
This option only makes sense when
|
|
|
|
.Fl F
|
|
|
|
and
|
|
|
|
.Fl P
|
|
|
|
are used.
|
2001-08-16 02:40:29 +00:00
|
|
|
.It Fl U
|
2002-08-21 18:11:48 +00:00
|
|
|
Enable soft-updates on the file system.
|
2006-11-03 12:02:24 +00:00
|
|
|
This is the default, and is accepted only
|
2001-08-16 02:40:29 +00:00
|
|
|
for compatibility.
|
|
|
|
It is only really useful to negate the
|
|
|
|
.Fl S
|
|
|
|
flag, should such a need occur.
|
2002-12-01 23:19:57 +00:00
|
|
|
.It Fl v Ar version
|
|
|
|
Specify the UFS version number for use on the file system; it may be
|
|
|
|
either
|
|
|
|
.Dv 1
|
|
|
|
or
|
|
|
|
.Dv 2 .
|
|
|
|
The default is derived from the default of the
|
|
|
|
.Xr newfs 8
|
|
|
|
command.
|
2001-06-20 00:34:20 +00:00
|
|
|
.It Fl w Ar user : Ns Ar group
|
|
|
|
Set the owner and group to
|
2001-06-18 23:46:58 +00:00
|
|
|
.Ar user
|
|
|
|
and
|
|
|
|
.Ar group ,
|
|
|
|
respectively.
|
|
|
|
The arguments have the same semantics as with
|
|
|
|
.Xr chown 8 ,
|
2001-06-20 00:34:20 +00:00
|
|
|
but specifying just a
|
|
|
|
.Ar user
|
|
|
|
or just a
|
|
|
|
.Ar group
|
|
|
|
is not supported.
|
2001-07-30 09:13:21 +00:00
|
|
|
.It Fl X
|
|
|
|
Print what command will be run before running it, and
|
|
|
|
other assorted debugging information.
|
2001-06-18 23:46:58 +00:00
|
|
|
.El
|
|
|
|
.Pp
|
|
|
|
The
|
|
|
|
.Fl F
|
|
|
|
and
|
|
|
|
.Fl s
|
|
|
|
options are passed to
|
|
|
|
.Xr mdconfig 8
|
|
|
|
as
|
|
|
|
.Fl f
|
|
|
|
and
|
|
|
|
.Fl s ,
|
|
|
|
respectively.
|
|
|
|
The
|
2001-06-20 00:34:20 +00:00
|
|
|
.Fl a , b , c , d , e , f , i , m
|
2001-06-18 23:46:58 +00:00
|
|
|
and
|
|
|
|
.Fl n
|
|
|
|
options are passed to
|
|
|
|
.Xr newfs 8
|
2016-03-11 06:07:09 +00:00
|
|
|
with the same letter.
|
|
|
|
The
|
2001-06-18 23:46:58 +00:00
|
|
|
.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.
|
2016-03-11 06:07:09 +00:00
|
|
|
The
|
|
|
|
.Fl T
|
|
|
|
option is passed to
|
|
|
|
.Xr mount 8
|
|
|
|
as
|
|
|
|
.Fl t .
|
2001-06-18 23:46:58 +00:00
|
|
|
See the programs that the options are passed to for more information
|
|
|
|
on their semantics.
|
|
|
|
.Sh EXAMPLES
|
2002-08-21 18:11:48 +00:00
|
|
|
Create and mount a 32 megabyte swap-backed file system on
|
2001-06-18 23:46:58 +00:00
|
|
|
.Pa /tmp :
|
|
|
|
.Pp
|
2001-06-20 00:34:20 +00:00
|
|
|
.Dl "mdmfs -s 32m md /tmp"
|
2001-06-18 23:46:58 +00:00
|
|
|
.Pp
|
2003-05-05 23:41:17 +00:00
|
|
|
The same file system created as an entry in
|
|
|
|
.Pa /etc/fstab :
|
2003-05-17 22:31:48 +00:00
|
|
|
.Pp
|
2003-05-05 23:41:17 +00:00
|
|
|
.Dl "md /tmp mfs rw,-s32m 2 0"
|
|
|
|
.Pp
|
2002-08-21 18:11:48 +00:00
|
|
|
Create and mount a 16 megabyte malloc-backed file system on
|
2001-06-18 23:46:58 +00:00
|
|
|
.Pa /tmp
|
|
|
|
using the
|
|
|
|
.Pa /dev/md1
|
|
|
|
device;
|
|
|
|
furthermore,
|
2001-06-20 22:10:31 +00:00
|
|
|
do not use soft-updates on it and mount it
|
2001-06-18 23:46:58 +00:00
|
|
|
.Cm async :
|
|
|
|
.Pp
|
2001-06-20 00:34:20 +00:00
|
|
|
.Dl "mdmfs -M -S -o async -s 16m md1 /tmp"
|
2007-02-15 18:07:52 +00:00
|
|
|
.Pp
|
2012-03-29 05:02:12 +00:00
|
|
|
Create and mount a
|
2007-02-15 18:07:52 +00:00
|
|
|
.Xr geom_uzip 4
|
|
|
|
based compressed disk image:
|
|
|
|
.Pp
|
|
|
|
.Dl "mdmfs -P -F foo.uzip -oro md.uzip /tmp/"
|
|
|
|
.Pp
|
2007-02-15 21:49:32 +00:00
|
|
|
Mount the same image, specifying the
|
2007-02-15 18:07:52 +00:00
|
|
|
.Pa /dev/md1
|
|
|
|
device:
|
|
|
|
.Pp
|
|
|
|
.Dl "mdmfs -P -F foo.uzip -oro md1.uzip /tmp/"
|
|
|
|
.Pp
|
|
|
|
Configure a vnode-backed file system and mount its first partition,
|
|
|
|
using automatic device numbering:
|
|
|
|
.Pp
|
|
|
|
.Dl "mdmfs -P -F foo.img mds1a /tmp/"
|
2016-03-11 06:07:09 +00:00
|
|
|
.Pp
|
|
|
|
Mount a vnode-backed cd9660 file system using automatic device numbering:
|
|
|
|
.Pp
|
|
|
|
.Dl "mdmfs -T cd9660 -P -F foo.iso md /tmp"
|
2001-08-16 02:40:29 +00:00
|
|
|
.Sh COMPATIBILITY
|
2002-07-06 19:34:18 +00:00
|
|
|
The
|
|
|
|
.Nm
|
2006-11-03 12:02:24 +00:00
|
|
|
utility, while designed to be compatible with
|
2001-08-16 02:40:29 +00:00
|
|
|
.Xr mount_mfs 8 ,
|
|
|
|
can be useful by itself.
|
|
|
|
Since
|
|
|
|
.Xr mount_mfs 8
|
2003-04-27 01:40:45 +00:00
|
|
|
had some silly defaults, a
|
2006-11-03 12:02:24 +00:00
|
|
|
.Dq compatibility
|
2001-08-16 02:40:29 +00:00
|
|
|
mode is provided for the case where bug-to-bug compatibility is desired.
|
|
|
|
.Pp
|
2006-11-03 12:02:24 +00:00
|
|
|
Compatibility is enabled by starting
|
2001-08-16 02:40:29 +00:00
|
|
|
.Nm
|
2001-09-30 15:14:16 +00:00
|
|
|
with the name
|
|
|
|
.Li mount_mfs
|
|
|
|
or
|
|
|
|
.Li mfs
|
2001-08-16 02:40:29 +00:00
|
|
|
(as returned by
|
|
|
|
.Xr getprogname 3 ) .
|
2006-11-03 12:02:24 +00:00
|
|
|
In this mode, the following behavior, as done by
|
2001-08-16 02:40:29 +00:00
|
|
|
.Xr mount_mfs 8 ,
|
|
|
|
is duplicated:
|
2001-08-16 07:43:16 +00:00
|
|
|
.Bl -bullet -offset indent
|
2001-08-16 02:40:29 +00:00
|
|
|
.It
|
|
|
|
The file mode of
|
|
|
|
.Ar mount-point
|
2006-11-03 12:02:24 +00:00
|
|
|
is set by default to
|
2001-08-16 02:40:29 +00:00
|
|
|
.Li 01777
|
|
|
|
as if
|
|
|
|
.Fl p Ar 1777
|
|
|
|
was given on the command line.
|
|
|
|
.El
|
2001-06-20 00:37:34 +00:00
|
|
|
.Sh SEE ALSO
|
|
|
|
.Xr md 4 ,
|
2001-08-16 02:40:29 +00:00
|
|
|
.Xr fstab 5 ,
|
2001-06-20 00:37:34 +00:00
|
|
|
.Xr mdconfig 8 ,
|
|
|
|
.Xr mount 8 ,
|
|
|
|
.Xr newfs 8
|
2001-06-20 00:34:20 +00:00
|
|
|
.Sh AUTHORS
|
2001-06-18 23:46:58 +00:00
|
|
|
.An Dima Dorfman
|