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 91basing its defaults on the information in the disk label. 92Typically the defaults are reasonable, however 93.Nm newfs 94has numerous options to allow the defaults to be selectively overridden. 95.Pp 96.Nm Mount_mfs 97is used to build a file system in virtual memory and then mount it 98on a specified node. 99.Nm Mount_mfs 100exits and the contents of the file system are lost 101when the file system is unmounted. 102If 103.Nm mount_mfs 104is sent a signal while running, 105for example during system shutdown, 106it will attempt to unmount its 107corresponding file system. 108The parameters to 109.Nm mount_mfs 110are the same as those to 111.Nm newfs . 112The special file is only used to read the disk label which provides 113a set of configuration parameters for the memory based file system. 114The special file is typically that of the primary swap area, 115since that is where the file system will be backed up when 116free memory gets low and the memory supporting 117the file system has to be paged. 118.Pp 119The following options define the general layout policies. 120.Bl -tag -width Fl 121.It Fl T Ar disktype 122For backward compatibility and for 123.Nm mount_mfs . 124.It Fl F Ar file 125.Nm mount_mfs 126will use this file for the image of the filesystem. When 127.Nm mount_mfs 128exits, this file will be left behind. 129.It Fl N 130Causes the file system parameters to be printed out 131without really creating the file system. 132.It Fl O 133Creates a 4.3BSD format filesystem. 134This options is primarily used to build root filesystems 135that can be understood by older boot ROMs. 136.It Fl a Ar maxcontig 137This specifies the maximum number of contiguous blocks that will be 138laid out before forcing a rotational delay (see the 139.Fl d 140option). 141The default value is one. 142See 143.Xr tunefs 8 144for more details on how to set this option. 145.It Fl b Ar block-size 146The block size of the file system, in bytes. 147.It Fl c Ar #cylinders/group 148The number of cylinders per cylinder group in a file system. 149The default value is 16. 150.It Fl d Ar rotdelay 151This specifies the expected time (in milliseconds) to service a transfer 152completion interrupt and initiate a new transfer on the same disk. 153The default is 0 milliseconds. 154See 155.Xr tunefs 8 156for more details on how to set this option. 157.It Fl e Ar maxbpg 158This indicates the maximum number of blocks any single file can 159allocate out of a cylinder group before it is forced to begin 160allocating blocks from another cylinder group. 161The default is about one quarter of the total blocks in a cylinder group. 162See 163.Xr tunefs 8 164for more details on how to set this option. 165.It Fl f Ar frag-size 166The fragment size of the file system in 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 each 2048 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 10%. 176See 177.Xr tunefs 8 178for more details on how to set this option. 179.It Fl n Ar number of distinguished rotational positions 180Determines how many rotational time slots there are in one revolution of 181the disk. Defaults to 1, which escentially disables the rotational position table. 182.It Fl o Ar optimization\ preference 183.Pq ``space'' or ``time'' 184The file system can either be instructed to try to minimize the time spent 185allocating blocks, or to try to minimize the space fragmentation on the disk. 186If the value of minfree (see above) is less than 10%, 187the default is to optimize for space; 188if the value of minfree is greater than or equal to 10%, 189the default is to optimize for time. 190See 191.Xr tunefs 8 192for more details on how to set this option. 193.It Fl s Ar size 194The size of the file system in sectors. 195.El 196.Pp 197The following options override the standard sizes for the disk geometry. 198Their default values are taken from the disk label. 199Changing these defaults is useful only when using 200.Nm newfs 201to build a file system whose raw image will eventually be used on a 202different type of disk than the one on which it is initially created 203(for example on a write-once disk). 204Note that changing any of these values from their defaults will make 205it impossible for 206.Xr fsck 207to find the alternate superblocks if the standard superblock is lost. 208.Bl -tag -width Fl 209.It Fl S Ar sector-size 210The size of a sector in bytes (almost never anything but 512). 211.It Fl k Ar sector \&0 skew , per track 212Used to describe perturbations in the media format to compensate for 213a slow controller. 214Track skew is the offset of sector 0 on track N relative to sector 0 215on track N-1 on the same cylinder. 216.It Fl l Ar hardware sector interleave 217Used to describe perturbations in the media format to compensate for 218a slow controller. 219Interleave is physical sector interleave on each track, 220specified as the denominator of the ratio: 221.Dl sectors read/sectors passed over 222Thus an interleave of 1/1 implies contiguous layout, while 1/2 implies 223logical sector 0 is separated by one sector from logical sector 1. 224.It Fl p Ar spare sectors per track 225Spare sectors (bad sector replacements) are physical sectors that occupy 226space at the end of each track. 227They are not counted as part of the sectors/track 228.Pq Fl u 229since they are not available to the file system for data allocation. 230.It Fl r Ar revolutions/minute 231The speed of the disk in revolutions per minute. 232.It Fl t Ar #tracks/cylinder 233The number of tracks/cylinder available for data allocation by the file 234system. 235.It Fl u Ar sectors/track 236The number of sectors per track available for data allocation by the file 237system. 238This does not include sectors reserved at the end of each track for bad 239block replacement (see the 240.Fl p 241option.) 242.It Fl x Ar spare sectors per cylinder 243Spare sectors (bad sector replacements) are physical sectors that occupy 244space at the end of the last track in the cylinder. 245They are deducted from the sectors/track 246.Pq Fl u 247of the last track of each cylinder since they are not available to the file 248system for data allocation. 249.El 250.Pp 251The options to the 252.Nm mount_mfs 253command are as described for the 254.Nm newfs 255command, except for the 256.Fl o 257option. 258.Pp 259That option is as follows: 260.Bl -tag -width indent 261.It Fl o 262Options are specified with a 263.Fl o 264flag followed by a comma separated string of options. 265See the 266.Xr mount 8 267man page for possible options and their meanings. 268.El 269.Sh SEE ALSO 270.Xr disktab 5 , 271.Xr fs 5 , 272.Xr dumpfs 8 , 273.Xr disklabel 8 , 274.Xr diskpart 8 , 275.Xr fsck 8 , 276.Xr format 8 , 277.Xr mount 8 , 278.Xr tunefs 8 279.Rs 280.%A M. McKusick 281.%A W. Joy 282.%A S. Leffler 283.%A R. Fabry 284.%T A Fast File System for UNIX , 285.%J ACM Transactions on Computer Systems 2 286.%V 3 287.%P pp 181-197 288.%D August 1984 289.%O (reprinted in the BSD System Manager's Manual) 290.Re 291.Sh HISTORY 292The 293.Nm 294command appeared in 295.Bx 4.2 . 296