1.\" $NetBSD: mount_mfs.8,v 1.16 2010/02/18 14:00:39 wiz 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 December 8, 2007 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.Op Fl V Ar verbose 55.Ar special node 56.Sh DESCRIPTION 57.Nm 58is used to build a file system in virtual memory and then mount it 59on a specified node. 60.Nm 61exits and the contents of the file system are lost 62when the file system is unmounted. 63If 64.Nm 65is sent a signal while running, 66for example during system shutdown, 67it will attempt to unmount its 68corresponding file system. 69.Ar special 70is ignored. 71.Pp 72Options with numeric arguments may contain an optional (case-insensitive) 73suffix: 74.Bl -tag -width 3n -offset indent -compact 75.It b 76Bytes; causes no modification. 77(Default) 78.It k 79Kilo; multiply the argument by 1024 80.It m 81Mega; multiply the argument by 1048576 82.It g 83Giga; multiply the argument by 1073741824 84.El 85.Pp 86The following options define the general layout policies: 87.Bl -tag -width Fl 88.It Fl N 89Causes the memory file system parameters to be printed out 90without really mounting the memory file system. 91.It Fl a Ar maxcontig 92This specifies the maximum number of contiguous blocks that will be 93laid out before forcing a rotational delay (see the 94.Fl d 95option). 96The default value is 8. 97See 98.Xr tunefs 8 99for more details on how to set this option. 100.It Fl b Ar block-size 101The block size of the file system, in bytes. 102It must be a power of two. 103The smallest allowable size is 4096 bytes. 104The default size depends upon the size of the file system: 105.Pp 106.Bl -tag -width "file system size" -compact -offset indent 107.It Sy "file system size" 108.Ar block-size 109.It \&\*[Lt] 20 MB 1104 KB 111.It \&\*[Lt] 1024 MB 1128 KB 113.It \&\*[Gt]\&= 1024 MB 11416 KB 115.El 116.It Fl d Ar rotdelay 117This specifies the expected time (in milliseconds) to service a transfer 118completion interrupt and initiate a new transfer on the same disk. 119The default is 0 milliseconds. 120See 121.Xr tunefs 8 122for more details on how to set this option. 123.ne 1i 124.It Fl e Ar maxbpg 125This indicates the maximum number of blocks any single file can 126allocate out of a cylinder group before it is forced to begin 127allocating blocks from another cylinder group. 128The default is about one quarter of the total blocks in a cylinder group. 129See 130.Xr tunefs 8 131for more details on how to set this option. 132.It Fl f Ar frag-size 133The fragment size of the file system in bytes. 134It must be a power of two ranging in value between 135.Ar block-size Ns /8 136and 137.Ar block-size . 138The optimal 139.Ar block-size : Ns Ar frag-size 140ratio is 8:1. 141Other ratios are possible, but are not recommended, 142and may produce unpredictable results. 143The default size depends upon the size of the file system: 144.Pp 145.Bl -tag -width "file system size" -compact -offset indent 146.It Sy "file system size" 147.Ar frag-size 148.It \&\*[Lt] 20 MB 1490.5 KB 150.It \&\*[Lt] 1024 MB 1511 KB 152.It \&\*[Gt]\&= 1024 MB 1532 KB 154.El 155.It Fl g Ar groupname 156This specifies the group name or group id of the root 157inode of the file system. 158.It Fl i Ar bytes-per-inode 159This specifies the density of inodes in the file system. 160If fewer inodes are desired, a larger number should be used; 161to create more inodes a smaller number should be given. 162The default is to create an inode for every 163.Pq 4 * Ar frag-size 164bytes of data space: 165.Pp 166.Bl -tag -width "file system size" -compact -offset indent 167.It Sy "file system size" 168.Ar bytes-per-inode 169.It \&\*[Lt] 20 MB 1702 KB 171.It \&\*[Lt] 1024 MB 1724 KB 173.It \&\*[Gt]\&= 1024 MB 1748 KB 175.El 176.It Fl m Ar free-space 177The percentage of space reserved from normal users; the minimum free 178space threshold. 179The default value used is 5%. 180See 181.Xr tunefs 8 182for more details on how to set this option. 183.It Fl n Ar inodes 184This specifies the number of inodes for the filesystem. 185If both 186.Fl i 187and 188.Fl n 189are specified then 190.Fl n 191takes precedence. 192.It Fl o 193Options are specified with a 194.Fl o 195flag followed by a comma separated string of options. 196See the 197.Xr mount 8 198man page for possible options and their meanings. 199.It Fl p Ar permissions 200This specifies the permissions of the root 201inode of the file system. 202.It Fl s Ar size 203The size of the file system in sectors. 204An 205.Sq s 206suffix will be interpreted as the number of sectors (the default). 207All other suffixes are interpreted as per other numeric arguments, 208except that the number is converted into sectors by dividing by the 209default sector size (which is 512 bytes) 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.It Fl V Ar verbose 215This controls the amount of information written to stdout: 216.Bl -tag -width 3n -offset indent -compact 217.It 0 218No output 219.It 1 220Overall size and cylinder group details. 221.It 2 222A progress bar (dots ending at right hand margin). 223.It 3 224The first few super-block backup sector numbers are displayed before the 225progress bar. 226.It 4 227All the super-block backup sector numbers are displayed (no progress bar). 228.El 229The default is 0. 230If 231.Fl N 232is specified 233.Nm 234stops before outputting the progress bar. 235.El 236.Sh NOTES 237The owner and group ids of the root node of the new file system 238are set to the effective uid and gid of the user mounting 239the file system. 240.Sh EXAMPLES 241Mount a 32 MB mfs on /tmp: 242.Pp 243.Dl mount_mfs -s 32m swap /tmp 244.Sh SEE ALSO 245.Xr disktab 5 , 246.Xr fs 5 , 247.Xr disklabel 8 , 248.Xr diskpart 8 , 249.Xr dumpfs 8 , 250.\" .Xr format 8 , 251.Xr fsck_ffs 8 , 252.Xr fsirand 8 , 253.Xr mount 8 , 254.Xr newfs 8 , 255.Xr tunefs 8 256.Rs 257.%A M. McKusick 258.%A W. Joy 259.%A S. Leffler 260.%A R. Fabry 261.%T A Fast File System for UNIX , 262.%J ACM Transactions on Computer Systems 2 263.%V 3 264.%P pp 181-197 265.%D August 1984 266.%O (reprinted in the BSD System Manager's Manual) 267.Re 268.Sh HISTORY 269The 270.Nm 271command appeared in 272.Bx 4.2 . 273.Sh BUGS 274The 275.Cm async 276.Xr mount 8 277option is currently disabled in this file system because it causes 278hangs when writing lots of data. 279The problem is that MFS needs to allocate pages to clean pages, so if 280it waits until the last minute to clean pages then there may not be 281any of them available to do the cleaning. 282