xref: /netbsd-src/sbin/newfs/mount_mfs.8 (revision 81e0d2b0af8485d94ed5da487d4253841a2e6e45)
1.\"	$NetBSD: mount_mfs.8,v 1.12 2003/09/11 12:21:01 dsl Exp $
2.\"
3.\" Copyright (c) 1983, 1987, 1991, 1993, 1994
4.\"	The Regents of the University of California.  All rights reserved.
5.\"
6.\" Redistribution and use in source and binary forms, with or without
7.\" modification, are permitted provided that the following conditions
8.\" are met:
9.\" 1. Redistributions of source code must retain the above copyright
10.\"    notice, this list of conditions and the following disclaimer.
11.\" 2. Redistributions in binary form must reproduce the above copyright
12.\"    notice, this list of conditions and the following disclaimer in the
13.\"    documentation and/or other materials provided with the distribution.
14.\" 3. Neither the name of the University nor the names of its contributors
15.\"    may be used to endorse or promote products derived from this software
16.\"    without specific prior written permission.
17.\"
18.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
19.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
22.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
24.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
25.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
26.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
27.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
28.\" SUCH DAMAGE.
29.\"
30.\"     @(#)newfs.8	8.6 (Berkeley) 5/3/95
31.\"
32.Dd September 11, 2003
33.Dt MOUNT_MFS 8
34.Os
35.Sh NAME
36.Nm mount_mfs
37.Nd mount a memory based file system
38.Sh SYNOPSIS
39.Nm mount_mfs
40.Op Fl N
41.Op Fl a Ar maxcontig
42.Op Fl b Ar block-size
43.Op Fl d Ar rotdelay
44.Op Fl e Ar maxbpg
45.Op Fl f Ar frag-size
46.Op Fl g Ar groupname
47.Op Fl i Ar bytes-per-inode
48.Op Fl m Ar free-space
49.Op Fl n Ar inodes
50.Op Fl o Ar options
51.Op Fl p Ar permissions
52.Op Fl s Ar size
53.Op Fl u Ar username
54.Ar special node
55.Sh DESCRIPTION
56.Nm
57is used to build a file system in virtual memory and then mount it
58on a specified node.
59.Nm
60exits and the contents of the file system are lost
61when the file system is unmounted.
62If
63.Nm
64is sent a signal while running,
65for example during system shutdown,
66it will attempt to unmount its
67corresponding file system.
68.Ar special
69is ignored.
70.Pp
71Options with numeric arguments may contain an optional (case-insensitive)
72suffix:
73.Bl -tag -width 3n -offset indent -compact
74.It b
75Bytes; causes no modification.
76(Default)
77.It k
78Kilo; multiply the argument by 1024
79.It m
80Mega; multiply the argument by 1048576
81.It g
82Giga; multiply the argument by 1073741824
83.El
84.Pp
85The following options define the general layout policies.
86.Bl -tag -width Fl
87.It Fl N
88Causes the memory file system parameters to be printed out
89without really mounting the memory file system.
90.It Fl a Ar maxcontig
91This specifies the maximum number of contiguous blocks that will be
92laid out before forcing a rotational delay (see the
93.Fl d
94option).
95The default value is 8.
96See
97.Xr tunefs 8
98for more details on how to set this option.
99.It Fl b Ar block-size
100The block size of the file system, in bytes.
101It must be a power of two.
102The smallest allowable size is 4096 bytes.
103The default size depends upon the size of the file system:
104.Pp
105.Bl -tag -width "file system size" -compact -offset indent
106.It Sy "file system size"
107.Ar block-size
108.It \&\*[Lt] 20 MB
1094 KB
110.It \&\*[Lt] 1024 MB
1118 KB
112.It \&\*[Gt]\&= 1024 MB
11316 KB
114.El
115.It Fl d Ar rotdelay
116This specifies the expected time (in milliseconds) to service a transfer
117completion interrupt and initiate a new transfer on the same disk.
118The default is 0 milliseconds.
119See
120.Xr tunefs 8
121for more details on how to set this option.
122.ne 1i
123.It Fl e Ar maxbpg
124This indicates the maximum number of blocks any single file can
125allocate out of a cylinder group before it is forced to begin
126allocating blocks from another cylinder group.
127The default is about one quarter of the total blocks in a cylinder group.
128See
129.Xr tunefs 8
130for more details on how to set this option.
131.It Fl f Ar frag-size
132The fragment size of the file system in bytes.
133It must be a power of two ranging in value between
134.Ar block-size Ns /8
135and
136.Ar block-size .
137The optimal
138.Ar block-size : Ns Ar frag-size
139ratio is 8:1.
140Other ratios are possible, but are not recommended,
141and may produce unpredictable results.
142The default size depends upon the size of the file system:
143.Pp
144.Bl -tag -width "file system size" -compact -offset indent
145.It Sy "file system size"
146.Ar frag-size
147.It \&\*[Lt] 20 MB
1480.5 KB
149.It \&\*[Lt] 1024 MB
1501 KB
151.It \&\*[Gt]\&= 1024 MB
1522 KB
153.El
154.It Fl g Ar groupname
155This specifies the group name or group id of the root
156inode of the file system.
157.It Fl i Ar bytes-per-inode
158This specifies the density of inodes in the file system.
159If fewer inodes are desired, a larger number should be used;
160to create more inodes a smaller number should be given.
161The default is to create an inode for every
162.Pq 4 * Ar frag-size
163bytes of data space:
164.Pp
165.Bl -tag -width "file system size" -compact -offset indent
166.It Sy "file system size"
167.Ar bytes-per-inode
168.It \&\*[Lt] 20 MB
1692 KB
170.It \&\*[Lt] 1024 MB
1714 KB
172.It \&\*[Gt]\&= 1024 MB
1738 KB
174.El
175.It Fl m Ar free-space
176The percentage of space reserved from normal users; the minimum free
177space threshold.
178The default value used is 5%.
179See
180.Xr tunefs 8
181for more details on how to set this option.
182.It Fl n Ar inodes
183This specifies the number of inodes for the filesystem.
184If both
185.Fl i
186and
187.Fl n
188are specified then
189.Fl n
190takes precedence.
191.It Fl o
192Options are specified with a
193.Fl o
194flag followed by a comma separated string of options.
195See the
196.Xr mount 8
197man page for possible options and their meanings.
198.It Fl p Ar permissions
199This specifies the permissions of the root
200inode of the file system.
201.It Fl s Ar size
202The size of the file system in sectors.
203An
204.Sq s
205suffix will be interpreted as the number of sectors (the default).
206All other suffixes are interpreted as per other numeric arguments,
207except that the number is converted into sectors by dividing by the
208sector size (as specified by
209.Fl S Ar secsize )
210after suffix interpretation.
211.It Fl u Ar username
212This specifies the user name or user id of the root
213inode of the file system.
214.El
215.Sh NOTES
216The owner and group ids of the root node of the new file system
217are set to the effective uid and gid of the user mounting
218the file system.
219.Sh EXAMPLES
220Mount a 32 MB mfs on /tmp:
221.Pp
222.Dl mount_mfs -s 32m swap /tmp
223.Sh SEE ALSO
224.Xr disktab 5 ,
225.Xr fs 5 ,
226.Xr disklabel 8 ,
227.Xr diskpart 8 ,
228.Xr dumpfs 8 ,
229.\" .Xr format 8 ,
230.Xr fsck_ffs 8 ,
231.Xr fsirand 8 ,
232.Xr mount 8 ,
233.Xr newfs 8 ,
234.Xr tunefs 8
235.Rs
236.%A M. McKusick
237.%A W. Joy
238.%A S. Leffler
239.%A R. Fabry
240.%T A Fast File System for UNIX ,
241.%J ACM Transactions on Computer Systems 2
242.%V 3
243.%P pp 181-197
244.%D August 1984
245.%O (reprinted in the BSD System Manager's Manual)
246.Re
247.Sh HISTORY
248The
249.Nm
250command appeared in
251.Bx 4.2 .
252.Sh BUGS
253The
254.Cm async
255.Xr mount 8
256option is currently disabled in this file system because it causes
257hangs when writing lots of data.
258The problem is that MFS needs to allocate pages to clean pages, so if
259it waits until the last minute to clean pages then there may not be
260any of them available to do the cleaning.
261