1.\" Copyright (c) 1983, 1987, 1991, 1993, 1994 2.\" The Regents of the University of California. All rights reserved. 3.\" 4.\" Redistribution and use in source and binary forms, with or without 5.\" modification, are permitted provided that the following conditions 6.\" are met: 7.\" 1. Redistributions of source code must retain the above copyright 8.\" notice, this list of conditions and the following disclaimer. 9.\" 2. Redistributions in binary form must reproduce the above copyright 10.\" notice, this list of conditions and the following disclaimer in the 11.\" documentation and/or other materials provided with the distribution. 12.\" 3. All advertising materials mentioning features or use of this software 13.\" must display the following acknowledgement: 14.\" This product includes software developed by the University of 15.\" California, Berkeley and its contributors. 16.\" 4. Neither the name of the University nor the names of its contributors 17.\" may be used to endorse or promote products derived from this software 18.\" without specific prior written permission. 19.\" 20.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 21.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 23.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 24.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 26.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 27.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 28.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 29.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 30.\" SUCH DAMAGE. 31.\" 32.\" @(#)newfs.8 8.3 (Berkeley) 3/27/94 33.\" 34.Dd March 27, 1994 35.Dt NEWFS 8 36.Os BSD 4.2 37.Sh NAME 38.Nm newfs , 39.Nm mfs 40.Nd construct a new file system 41.Sh SYNOPSIS 42.Nm newfs 43.Op Fl NO 44.Op Fl S Ar sector-size 45.Op Fl a Ar maxcontig 46.Op Fl b Ar block-size 47.Op Fl c Ar cylinders 48.Op Fl d Ar rotdelay 49.Op Fl e Ar maxbpg 50.Op Fl f Ar frag-size 51.Op Fl i Ar bytes 52.Op Fl k Ar skew 53.Op Fl l Ar interleave 54.Op Fl m Ar free space 55.Op Fl o Ar optimization 56.Op Fl p Ar sectors 57.Op Fl r Ar revolutions 58.Op Fl s Ar size 59.Op Fl t Ar tracks 60.Op Fl u Ar sectors 61.Op Fl x Ar sectors 62.Ar special 63.Nm mount_mfs 64.Op Fl N 65.Op Fl F Ar file 66.Op Fl T Ar disktype 67.Op Fl a Ar maxcontig 68.Op Fl b Ar block-size 69.Op Fl c Ar cylinders 70.Op Fl d Ar rotdelay 71.Op Fl e Ar maxbpg 72.Op Fl f Ar frag-size 73.Op Fl i Ar bytes 74.Op Fl m Ar free space 75.Op Fl o Ar options 76.Op Fl s Ar size 77.Ar special node 78.Sh DESCRIPTION 79.Nm Newfs 80replaces the more obtuse 81.Xr mkfs 8 82program. 83Before running 84.Nm newfs 85or 86.Nm mount_mfs , 87the disk must be labeled using 88.Xr disklabel 8 . 89.Nm Newfs 90builds a file system on the specified special device. 91Typically the defaults are reasonable, however 92.Nm newfs 93has numerous options to allow the defaults to be selectively overridden. 94.Pp 95.Nm Mount_mfs 96is used to build a file system in virtual memory and then mount it 97on a specified node. 98.Nm Mount_mfs 99exits and the contents of the file system are lost 100when the file system is unmounted. 101If 102.Nm mount_mfs 103is sent a signal while running, 104for example during system shutdown, 105it will attempt to unmount its 106corresponding file system. 107The parameters to 108.Nm mount_mfs 109are the same as those to 110.Nm newfs . 111The special file is only used to read the disk label which provides 112a set of configuration parameters for the memory based file system. 113The special file is typically that of the primary swap area, 114since that is where the file system will be backed up when 115free memory gets low and the memory supporting 116the file system has to be paged. 117.Pp 118The following options define the general layout policies. 119.Bl -tag -width Fl 120.It Fl T Ar disktype 121For backward compatibility and for 122.Nm mount_mfs . 123.It Fl F Ar file 124.Nm mount_mfs 125will use this file for the image of the filesystem. When 126.Nm mount_mfs 127exits, this file will be left behind. 128.It Fl N 129Causes the file system parameters to be printed out 130without really creating the file system. 131.It Fl O 132Creates a 4.3BSD format filesystem. 133This options is primarily used to build root filesystems 134that can be understood by older boot ROMs. 135.It Fl a Ar maxcontig 136This specifies the maximum number of contiguous blocks that will be 137laid out before forcing a rotational delay (see the 138.Fl d 139option). 140The default value is one. 141See 142.Xr tunefs 8 143for more details on how to set this option. 144.It Fl b Ar block-size 145The block size of the file system, in bytes. 146.It Fl c Ar #cylinders/group 147The number of cylinders per cylinder group in a file system. 148The default value is 16. 149.It Fl d Ar rotdelay 150This specifies the expected time (in milliseconds) to service a transfer 151completion interrupt and initiate a new transfer on the same disk. 152The default is 0 milliseconds. 153See 154.Xr tunefs 8 155for more details on how to set this option. 156.It Fl e Ar maxbpg 157This indicates the maximum number of blocks any single file can 158allocate out of a cylinder group before it is forced to begin 159allocating blocks from another cylinder group. 160The default is about one quarter of the total blocks in a cylinder group. 161See 162.Xr tunefs 8 163for more details on how to set this option. 164.It Fl f Ar frag-size 165The fragment size of the file system in bytes. 166The default is 1024 bytes. 167.It Fl i Ar number of bytes per inode 168This specifies the density of inodes in the file system. 169The default is to create an inode for every (4 * frag-size) bytes of data space. 170If fewer inodes are desired, a larger number should be used; 171to create more inodes a smaller number should be given. 172.It Fl m Ar free space \&% 173The percentage of space reserved from normal users; the minimum free 174space threshold. 175The default value used is 176defined by 177.Dv MINFREE 178from 179.Ao Pa ufs/ffs/fs.h Ac , 180currently 8%. 181See 182.Xr tunefs 8 183for more details on how to set this option. 184.It Fl n Ar number of distinguished rotational positions 185Determines how many rotational time slots there are in one revolution of 186the disk. Defaults to 1, which essentially disables the rotational position table. 187.It Fl o Ar optimization\ preference 188.Pq ``space'' or ``time'' 189The file system can either be instructed to try to minimize the time spent 190allocating blocks, or to try to minimize the space fragmentation on the disk. 191If the value of minfree (see above) is less than 8%, 192the default is to optimize for space; 193if the value of minfree is greater than or equal to 8%. 194the default is to optimize for time. 195See 196.Xr tunefs 8 197for more details on how to set this option. 198.It Fl s Ar size 199The size of the file system in sectors. 200.El 201.Pp 202The following options override the standard sizes for the disk geometry. 203Their default values are taken from the disk label. 204Changing these defaults is useful only when using 205.Nm newfs 206to build a file system whose raw image will eventually be used on a 207different type of disk than the one on which it is initially created 208(for example on a write-once disk). 209Note that changing any of these values from their defaults will make 210it impossible for 211.Xr fsck 212to find the alternate superblocks if the standard superblock is lost. 213.Bl -tag -width Fl 214.It Fl S Ar sector-size 215The size of a sector in bytes (almost never anything but 512). 216.It Fl k Ar sector \&0 skew , per track 217Used to describe perturbations in the media format to compensate for 218a slow controller. 219Track skew is the offset of sector 0 on track N relative to sector 0 220on track N-1 on the same cylinder. 221.It Fl l Ar hardware sector interleave 222Used to describe perturbations in the media format to compensate for 223a slow controller. 224Interleave is physical sector interleave on each track, 225specified as the denominator of the ratio: 226.Dl sectors read/sectors passed over 227Thus an interleave of 1/1 implies contiguous layout, while 1/2 implies 228logical sector 0 is separated by one sector from logical sector 1. 229.It Fl p Ar spare sectors per track 230Spare sectors (bad sector replacements) are physical sectors that occupy 231space at the end of each track. 232They are not counted as part of the sectors/track 233.Pq Fl u 234since they are not available to the file system for data allocation. 235.It Fl r Ar revolutions/minute 236The speed of the disk in revolutions per minute. 237.It Fl t Ar #tracks/cylinder 238The number of tracks/cylinder available for data allocation by the file 239system. 240The default is 1. 241If zero is specified, the value from the disklabel will be used. 242.It Fl u Ar sectors/track 243The number of sectors per track available for data allocation by the file 244system. 245The default is 4096. 246If zero is specified, the value from the disklabel will be used. 247This does not include sectors reserved at the end of each track for bad 248block replacement (see the 249.Fl p 250option.) 251.It Fl x Ar spare sectors per cylinder 252Spare sectors (bad sector replacements) are physical sectors that occupy 253space at the end of the last track in the cylinder. 254They are deducted from the sectors/track 255.Pq Fl u 256of the last track of each cylinder since they are not available to the file 257system for data allocation. 258.El 259.Pp 260The options to the 261.Nm mount_mfs 262command are as described for the 263.Nm newfs 264command, except for the 265.Fl o 266option. 267.Pp 268That option is as follows: 269.Bl -tag -width indent 270.It Fl o 271Options are specified with a 272.Fl o 273flag followed by a comma separated string of options. 274See the 275.Xr mount 8 276man page for possible options and their meanings. 277.El 278.Sh EXAMPLES 279.Pp 280.Dl mount_mfs -s=20480 -o nosuid,nodev /dev/sd0b /tmp 281.Pp 282Mount a 10240 KB large memory file system on /tmp, with 283.Xr mount 8 284options nosuid and nodev. 285.Sh SEE ALSO 286.Xr fdformat 1 , 287.Xr disktab 5 , 288.Xr fs 5 , 289.Xr disklabel 8 , 290.Xr diskpart 8 , 291.Xr dumpfs 8 , 292.Xr fsck 8 , 293.Xr mount 8 , 294.Xr scsiformat 8 , 295.Xr tunefs 8 296.Rs 297.%A M. McKusick 298.%A W. Joy 299.%A S. Leffler 300.%A R. Fabry 301.%T A Fast File System for UNIX , 302.%J ACM Transactions on Computer Systems 2 303.%V 3 304.%P pp 181-197 305.%D August 1984 306.%O (reprinted in the BSD System Manager's Manual) 307.Re 308.Sh HISTORY 309The 310.Nm 311command appeared in 312.Bx 4.2 . 313