1*58aefd4bSaaron.\" $OpenBSD: newfs.8,v 1.12 1998/11/28 19:56:28 aaron Exp $ 2df930be7Sderaadt.\" $NetBSD: newfs.8,v 1.12 1995/03/18 14:58:41 cgd Exp $ 3df930be7Sderaadt.\" 4df930be7Sderaadt.\" Copyright (c) 1983, 1987, 1991, 1993, 1994 5df930be7Sderaadt.\" The Regents of the University of California. All rights reserved. 6df930be7Sderaadt.\" 7df930be7Sderaadt.\" Redistribution and use in source and binary forms, with or without 8df930be7Sderaadt.\" modification, are permitted provided that the following conditions 9df930be7Sderaadt.\" are met: 10df930be7Sderaadt.\" 1. Redistributions of source code must retain the above copyright 11df930be7Sderaadt.\" notice, this list of conditions and the following disclaimer. 12df930be7Sderaadt.\" 2. Redistributions in binary form must reproduce the above copyright 13df930be7Sderaadt.\" notice, this list of conditions and the following disclaimer in the 14df930be7Sderaadt.\" documentation and/or other materials provided with the distribution. 15df930be7Sderaadt.\" 3. All advertising materials mentioning features or use of this software 16df930be7Sderaadt.\" must display the following acknowledgement: 17df930be7Sderaadt.\" This product includes software developed by the University of 18df930be7Sderaadt.\" California, Berkeley and its contributors. 19df930be7Sderaadt.\" 4. Neither the name of the University nor the names of its contributors 20df930be7Sderaadt.\" may be used to endorse or promote products derived from this software 21df930be7Sderaadt.\" without specific prior written permission. 22df930be7Sderaadt.\" 23df930be7Sderaadt.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 24df930be7Sderaadt.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 25df930be7Sderaadt.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 26df930be7Sderaadt.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 27df930be7Sderaadt.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 28df930be7Sderaadt.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 29df930be7Sderaadt.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 30df930be7Sderaadt.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 31df930be7Sderaadt.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 32df930be7Sderaadt.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 33df930be7Sderaadt.\" SUCH DAMAGE. 34df930be7Sderaadt.\" 35df930be7Sderaadt.\" @(#)newfs.8 8.3 (Berkeley) 3/27/94 36df930be7Sderaadt.\" 37df930be7Sderaadt.Dd March 27, 1994 38df930be7Sderaadt.Dt NEWFS 8 39df930be7Sderaadt.Os BSD 4.2 40df930be7Sderaadt.Sh NAME 41*58aefd4bSaaron.Nm newfs , mount_mfs 42df930be7Sderaadt.Nd construct a new file system 43df930be7Sderaadt.Sh SYNOPSIS 44*58aefd4bSaaron.Nm 45df930be7Sderaadt.Op Fl NO 46df930be7Sderaadt.Op Fl S Ar sector-size 475eaf1a72Saaron.Op Fl a Ar maxcontig 48df930be7Sderaadt.Op Fl b Ar block-size 49df930be7Sderaadt.Op Fl c Ar cylinders 50df930be7Sderaadt.Op Fl d Ar rotdelay 51df930be7Sderaadt.Op Fl e Ar maxbpg 52df930be7Sderaadt.Op Fl f Ar frag-size 53df930be7Sderaadt.Op Fl i Ar bytes 54df930be7Sderaadt.Op Fl k Ar skew 55df930be7Sderaadt.Op Fl l Ar interleave 56df930be7Sderaadt.Op Fl m Ar free space 57df930be7Sderaadt.Op Fl n Ar nrpos 58df930be7Sderaadt.Op Fl o Ar optimization 59df930be7Sderaadt.Op Fl p Ar sectors 60df930be7Sderaadt.Op Fl r Ar revolutions 61df930be7Sderaadt.Op Fl s Ar size 62212ed4daSderaadt.Op Fl t Ar fstype 63df930be7Sderaadt.Op Fl u Ar sectors 64df930be7Sderaadt.Op Fl x Ar sectors 65212ed4daSderaadt.Op Fl z Ar tracks 66df930be7Sderaadt.Ar special 67*58aefd4bSaaron.Pp 68df930be7Sderaadt.Nm mount_mfs 69df930be7Sderaadt.Op Fl N 705eaf1a72Saaron.Op Fl a Ar maxcontig 71df930be7Sderaadt.Op Fl b Ar block-size 72df930be7Sderaadt.Op Fl c Ar cylinders 73df930be7Sderaadt.Op Fl d Ar rotdelay 74df930be7Sderaadt.Op Fl e Ar maxbpg 75df930be7Sderaadt.Op Fl f Ar frag-size 76df930be7Sderaadt.Op Fl i Ar bytes 77df930be7Sderaadt.Op Fl m Ar free space 78df930be7Sderaadt.Op Fl o Ar options 79df930be7Sderaadt.Op Fl s Ar size 80df930be7Sderaadt.Ar special node 81df930be7Sderaadt.Sh DESCRIPTION 82*58aefd4bSaaron.Nm 83df930be7Sderaadtreplaces the more obtuse 84df930be7Sderaadt.Xr mkfs 8 85df930be7Sderaadtprogram. 86df930be7SderaadtBefore running 87*58aefd4bSaaron.Nm 88df930be7Sderaadtor 89df930be7Sderaadt.Nm mount_mfs , 90df930be7Sderaadtthe disk must be labeled using 91df930be7Sderaadt.Xr disklabel 8 . 92*58aefd4bSaaron.Nm 935eaf1a72Saaronbuilds a file system on the specified 945eaf1a72Saaron.Ar special 955eaf1a72Saarondevice, 96df930be7Sderaadtbasing its defaults on the information in the disk label. 97df930be7SderaadtTypically the defaults are reasonable, however 98*58aefd4bSaaron.Nm 99df930be7Sderaadthas numerous options to allow the defaults to be selectively overridden. 100df930be7Sderaadt.Pp 1015eaf1a72Saaron.Nm mount_mfs 102df930be7Sderaadtis used to build a file system in virtual memory and then mount it 103df930be7Sderaadton a specified node. 1045eaf1a72Saaron.Nm mount_mfs 105df930be7Sderaadtexits and the contents of the file system are lost 106df930be7Sderaadtwhen the file system is unmounted. 107df930be7SderaadtIf 108df930be7Sderaadt.Nm mount_mfs 109df930be7Sderaadtis sent a signal while running, 110df930be7Sderaadtfor example during system shutdown, 111df930be7Sderaadtit will attempt to unmount its 112df930be7Sderaadtcorresponding file system. 113df930be7SderaadtThe parameters to 114df930be7Sderaadt.Nm mount_mfs 115df930be7Sderaadtare the same as those to 116df930be7Sderaadt.Nm newfs . 117df930be7SderaadtThe special file is only used to read the disk label which provides 118df930be7Sderaadta set of configuration parameters for the memory based file system. 119df930be7SderaadtThe special file is typically that of the primary swap area, 120df930be7Sderaadtsince that is where the file system will be backed up when 121df930be7Sderaadtfree memory gets low and the memory supporting 12295675cd5Saaronthe file system has to be paged. If the keyword 12395675cd5Saaron.Dq swap 124df930be7Sderaadtis used instead of a special file name, default configuration parameters 125df930be7Sderaadtwill be used. (This option is useful when trying to use 126df930be7Sderaadt.Nm mount_mfs 127df930be7Sderaadton a machine without any disks.) 128df930be7Sderaadt.Pp 129b3593665SmillertBoth 130b3593665Smillert.Nm 131b3593665Smillertand 132b3593665Smillert.Nm mount_mfs 133b3593665Smillertnow have the functionality of 134b3593665Smillert.Xr fsirand 8 135ff72a048Sderaadtbuilt-in so it is not necessary to run 136b3593665Smillert.Xr fsirand 8 137b3593665Smillertmanually unless you wish to re-randomize the 138b3593665Smillertfilesystem (or list the inode generation numbers). 139b3593665Smillert.Pp 1405eaf1a72SaaronThe following options define the general layout policies: 141df930be7Sderaadt.Bl -tag -width Fl 142df930be7Sderaadt.It Fl N 143df930be7SderaadtCauses the file system parameters to be printed out 144df930be7Sderaadtwithout really creating the file system. 145df930be7Sderaadt.It Fl O 146a873166dSmickeyCreates a 147a873166dSmickey.Bx 4.3 148a873166dSmickeyformat filesystem. 149df930be7SderaadtThis options is primarily used to build root filesystems 150df930be7Sderaadtthat can be understood by older boot ROMs. 151df930be7Sderaadt.It Fl a Ar maxcontig 152df930be7SderaadtThis specifies the maximum number of contiguous blocks that will be 153df930be7Sderaadtlaid out before forcing a rotational delay (see the 154df930be7Sderaadt.Fl d 155df930be7Sderaadtoption). 156df930be7SderaadtThe default value is 8. 157df930be7SderaadtSee 158df930be7Sderaadt.Xr tunefs 8 159df930be7Sderaadtfor more details on how to set this option. 160df930be7Sderaadt.It Fl b Ar block-size 161df930be7SderaadtThe block size of the file system, in bytes. 162df930be7Sderaadt.It Fl c Ar #cylinders/group 163df930be7SderaadtThe number of cylinders per cylinder group in a file system. 164df930be7SderaadtThe default value is 16. 165df930be7Sderaadt.It Fl d Ar rotdelay 166df930be7SderaadtThis specifies the expected time (in milliseconds) to service a transfer 167df930be7Sderaadtcompletion interrupt and initiate a new transfer on the same disk. 168df930be7SderaadtThe default is 0 milliseconds. 169df930be7SderaadtSee 170df930be7Sderaadt.Xr tunefs 8 171df930be7Sderaadtfor more details on how to set this option. 172df930be7Sderaadt.It Fl e Ar maxbpg 173df930be7SderaadtThis indicates the maximum number of blocks any single file can 174df930be7Sderaadtallocate out of a cylinder group before it is forced to begin 175df930be7Sderaadtallocating blocks from another cylinder group. 176df930be7SderaadtThe default is about one quarter of the total blocks in a cylinder group. 177df930be7SderaadtSee 178df930be7Sderaadt.Xr tunefs 8 179df930be7Sderaadtfor more details on how to set this option. 180df930be7Sderaadt.It Fl f Ar frag-size 181df930be7SderaadtThe fragment size of the file system in bytes. 182df930be7Sderaadt.It Fl i Ar number of bytes per inode 183df930be7SderaadtThis specifies the density of inodes in the file system. 184e4cb669cSderaadtThe default is to create an inode for each 4096 bytes of data space. 185df930be7SderaadtIf fewer inodes are desired, a larger number should be used; 186df930be7Sderaadtto create more inodes a smaller number should be given. 187df930be7Sderaadt.It Fl m Ar free space \&% 188df930be7SderaadtThe percentage of space reserved from normal users; the minimum free 189df930be7Sderaadtspace threshold. 190e4cb669cSderaadtThe default value used is 5%. 191df930be7SderaadtSee 192df930be7Sderaadt.Xr tunefs 8 193df930be7Sderaadtfor more details on how to set this option. 194df930be7Sderaadt.It Fl n Ar number of rotational positions 195df930be7SderaadtThe number of distinct rotational positions. The default is 1. 196df930be7Sderaadt.It Fl o Ar optimization\ preference 19795675cd5Saaron.Ar space 19895675cd5Saaronor 19995675cd5Saaron.Ar time . 200df930be7SderaadtThe file system can either be instructed to try to minimize the time spent 201df930be7Sderaadtallocating blocks, or to try to minimize the space fragmentation on the disk. 2025eaf1a72SaaronUnless an optimization has been specified, if the value of minfree 2031c6dacc2Sderaadt(see above) is less than 5%, the default is to optimize for space; 204e4cb669cSderaadtif the value of minfree is greater than or equal to 5%, 205df930be7Sderaadtthe default is to optimize for time. 206df930be7SderaadtSee 207df930be7Sderaadt.Xr tunefs 8 208df930be7Sderaadtfor more details on how to set this option. 209df930be7Sderaadt.It Fl s Ar size 210df930be7SderaadtThe size of the file system in sectors. 211df930be7Sderaadt.El 212df930be7Sderaadt.Pp 213df930be7SderaadtThe following options override the standard sizes for the disk geometry. 214df930be7SderaadtTheir default values are taken from the disk label. 215df930be7SderaadtChanging these defaults is useful only when using 216*58aefd4bSaaron.Nm 217df930be7Sderaadtto build a file system whose raw image will eventually be used on a 218df930be7Sderaadtdifferent type of disk than the one on which it is initially created 219df930be7Sderaadt(for example on a write-once disk). 220df930be7SderaadtNote that changing any of these values from their defaults will make 221df930be7Sderaadtit impossible for 2225eaf1a72Saaron.Xr fsck 8 223df930be7Sderaadtto find the alternate superblocks if the standard superblock is lost. 224df930be7Sderaadt.Bl -tag -width Fl 225df930be7Sderaadt.It Fl S Ar sector-size 226df930be7SderaadtThe size of a sector in bytes (almost never anything but 512). 227df930be7Sderaadt.It Fl k Ar sector \&0 skew , per track 228df930be7SderaadtUsed to describe perturbations in the media format to compensate for 229df930be7Sderaadta slow controller. 230df930be7SderaadtTrack skew is the offset of sector 0 on track N relative to sector 0 231df930be7Sderaadton track N-1 on the same cylinder. 232df930be7Sderaadt.It Fl l Ar hardware sector interleave 233df930be7SderaadtUsed to describe perturbations in the media format to compensate for 234df930be7Sderaadta slow controller. 235df930be7SderaadtInterleave is physical sector interleave on each track, 236df930be7Sderaadtspecified as the denominator of the ratio: 237df930be7Sderaadt.Dl sectors read/sectors passed over 238df930be7SderaadtThus an interleave of 1/1 implies contiguous layout, while 1/2 implies 239df930be7Sderaadtlogical sector 0 is separated by one sector from logical sector 1. 240df930be7Sderaadt.It Fl p Ar spare sectors per track 241df930be7SderaadtSpare sectors (bad sector replacements) are physical sectors that occupy 242df930be7Sderaadtspace at the end of each track. 243df930be7SderaadtThey are not counted as part of the sectors/track 244df930be7Sderaadt.Pq Fl u 245df930be7Sderaadtsince they are not available to the file system for data allocation. 246df930be7Sderaadt.It Fl r Ar revolutions/minute 247df930be7SderaadtThe speed of the disk in revolutions per minute. 248212ed4daSderaadt.It Fl z Ar #tracks/cylinder 249df930be7SderaadtThe number of tracks/cylinder available for data allocation by the file 250df930be7Sderaadtsystem. 251212ed4daSderaadt.It Fl t Ar fstype 252212ed4daSderaadtSet the filesystem type of which filesystem you wish to create. 253*58aefd4bSaaron.Nm 254212ed4daSderaadtwill be smart enough to run the alternate newfs_XXX program instead. 255df930be7Sderaadt.It Fl u Ar sectors/track 256df930be7SderaadtThe number of sectors per track available for data allocation by the file 257df930be7Sderaadtsystem. 258df930be7SderaadtThis does not include sectors reserved at the end of each track for bad 259df930be7Sderaadtblock replacement (see the 260df930be7Sderaadt.Fl p 261df930be7Sderaadtoption.) 262df930be7Sderaadt.It Fl x Ar spare sectors per cylinder 263df930be7SderaadtSpare sectors (bad sector replacements) are physical sectors that occupy 264df930be7Sderaadtspace at the end of the last track in the cylinder. 265df930be7SderaadtThey are deducted from the sectors/track 266df930be7Sderaadt.Pq Fl u 267df930be7Sderaadtof the last track of each cylinder since they are not available to the file 268df930be7Sderaadtsystem for data allocation. 269df930be7Sderaadt.El 270df930be7Sderaadt.Pp 271df930be7SderaadtThe options to the 272df930be7Sderaadt.Nm mount_mfs 273df930be7Sderaadtcommand are as described for the 274*58aefd4bSaaron.Nm 275df930be7Sderaadtcommand, except for the 276df930be7Sderaadt.Fl o 277df930be7Sderaadtoption. 278df930be7Sderaadt.Pp 279df930be7SderaadtThat option is as follows: 280df930be7Sderaadt.Bl -tag -width indent 281df930be7Sderaadt.It Fl o 282df930be7SderaadtOptions are specified with a 283df930be7Sderaadt.Fl o 284df930be7Sderaadtflag followed by a comma separated string of options. 285df930be7SderaadtSee the 286df930be7Sderaadt.Xr mount 8 287df930be7Sderaadtman page for possible options and their meanings. 288df930be7Sderaadt.El 289df930be7Sderaadt.Sh SEE ALSO 290df930be7Sderaadt.Xr disktab 5 , 291df930be7Sderaadt.Xr fs 5 , 292df930be7Sderaadt.Xr disklabel 8 , 293df930be7Sderaadt.Xr diskpart 8 , 2947acc01d2Saaron.Xr dumpfs 8 , 295df930be7Sderaadt.Xr format 8 , 2967acc01d2Saaron.Xr fsck 8 , 2977acc01d2Saaron.Xr fsirand 8 , 298df930be7Sderaadt.Xr mount 8 , 2997acc01d2Saaron.Xr tunefs 8 300df930be7Sderaadt.Rs 301df930be7Sderaadt.%A M. McKusick 302df930be7Sderaadt.%A W. Joy 303df930be7Sderaadt.%A S. Leffler 304df930be7Sderaadt.%A R. Fabry 305df930be7Sderaadt.%T A Fast File System for UNIX , 306df930be7Sderaadt.%J ACM Transactions on Computer Systems 2 307df930be7Sderaadt.%V 3 308df930be7Sderaadt.%P pp 181-197 309df930be7Sderaadt.%D August 1984 310df930be7Sderaadt.%O (reprinted in the BSD System Manager's Manual) 311df930be7Sderaadt.Re 312df930be7Sderaadt.Sh HISTORY 313df930be7SderaadtThe 314df930be7Sderaadt.Nm 315df930be7Sderaadtcommand appeared in 316df930be7Sderaadt.Bx 4.2 . 317