166488Sbostic.\" Copyright (c) 1983, 1987, 1991, 1993, 1994 261523Sbostic.\" The Regents of the University of California. All rights reserved. 318990Smckusick.\" 443792Strent.\" %sccs.include.redist.man% 518990Smckusick.\" 6*69213Smckusick.\" @(#)newfs.8 8.6 (Berkeley) 05/03/95 739269Smckusick.\" 847463Scael.Dd 947463Scael.Dt NEWFS 8 1047463Scael.Os BSD 4.2 1147463Scael.Sh NAME 1247463Scael.Nm newfs , 1367565Smckusick.Nm mount_mfs 1447463Scael.Nd construct a new file system 1547463Scael.Sh SYNOPSIS 1647463Scael.Nm newfs 1766488Sbostic.Op Fl NO 1866488Sbostic.Op Fl S Ar sector-size 19*69213Smckusick.Op Fl T Ar disktype 20*69213Smckusick.Op Fl a Ar maxcontig 2166488Sbostic.Op Fl b Ar block-size 2266488Sbostic.Op Fl c Ar cylinders 2366488Sbostic.Op Fl d Ar rotdelay 2466488Sbostic.Op Fl e Ar maxbpg 2566488Sbostic.Op Fl f Ar frag-size 2666488Sbostic.Op Fl i Ar bytes 2766488Sbostic.Op Fl k Ar skew 2866488Sbostic.Op Fl l Ar interleave 2966488Sbostic.Op Fl m Ar free space 30*69213Smckusick.Op Fl n Ar rotational positions 3166488Sbostic.Op Fl o Ar optimization 3266488Sbostic.Op Fl p Ar sectors 3366488Sbostic.Op Fl r Ar revolutions 3466488Sbostic.Op Fl s Ar size 3566488Sbostic.Op Fl t Ar tracks 3666488Sbostic.Op Fl u Ar sectors 3766488Sbostic.Op Fl x Ar sectors 3847463Scael.Ar special 3953710Smckusick.Nm mount_mfs 4066488Sbostic.Op Fl N 41*69213Smckusick.Op Fl T Ar disktype 42*69213Smckusick.Op Fl a Ar maxcontig 4366488Sbostic.Op Fl b Ar block-size 4466488Sbostic.Op Fl c Ar cylinders 4566488Sbostic.Op Fl d Ar rotdelay 4666488Sbostic.Op Fl e Ar maxbpg 4766488Sbostic.Op Fl f Ar frag-size 4866488Sbostic.Op Fl i Ar bytes 4966488Sbostic.Op Fl m Ar free space 50*69213Smckusick.Op Fl n Ar rotational positions 5166488Sbostic.Op Fl o Ar options 5266488Sbostic.Op Fl s Ar size 5347463Scael.Ar special node 5447463Scael.Sh DESCRIPTION 5547463Scael.Nm Newfs 5630392Smckusickreplaces the more obtuse 5747463Scael.Xr mkfs 8 5818990Smckusickprogram. 5930392SmckusickBefore running 6047463Scael.Nm newfs 6139327Smckusickor 6253710Smckusick.Nm mount_mfs , 6330392Smckusickthe disk must be labeled using 6447463Scael.Xr disklabel 8 . 6547463Scael.Nm Newfs 6630392Smckusickbuilds a file system on the specified special device 6730392Smckusickbasing its defaults on the information in the disk label. 6830392SmckusickTypically the defaults are reasonable, however 6947463Scael.Nm newfs 7030392Smckusickhas numerous options to allow the defaults to be selectively overridden. 7147463Scael.Pp 7253710Smckusick.Nm Mount_mfs 7339327Smckusickis used to build a file system in virtual memory and then mount it 7439327Smckusickon a specified node. 7553710Smckusick.Nm Mount_mfs 7639327Smckusickexits and the contents of the file system are lost 7739327Smckusickwhen the file system is unmounted. 7839327SmckusickIf 7953710Smckusick.Nm mount_mfs 8039327Smckusickis sent a signal while running, 8139327Smckusickfor example during system shutdown, 8239327Smckusickit will attempt to unmount its 8339327Smckusickcorresponding file system. 8439327SmckusickThe parameters to 8553710Smckusick.Nm mount_mfs 8639327Smckusickare the same as those to 8747463Scael.Nm newfs . 88*69213SmckusickIf the 89*69213Smckusick.Fl T 90*69213Smckusickflag is specified (see below), the special file is unused. 91*69213SmckusickOtherwise, it is only used to read the disk label which provides 9239327Smckusicka set of configuration parameters for the memory based file system. 9339327SmckusickThe special file is typically that of the primary swap area, 9439327Smckusicksince that is where the file system will be backed up when 9539327Smckusickfree memory gets low and the memory supporting 9639327Smckusickthe file system has to be paged. 9747463Scael.Pp 9830392SmckusickThe following options define the general layout policies. 9947463Scael.Bl -tag -width Fl 10047463Scael.It Fl N 10147463ScaelCauses the file system parameters to be printed out 10247463Scaelwithout really creating the file system. 10359751Smckusick.It Fl O 10465103SmckusickCreates a 4.3BSD format filesystem. 10559751SmckusickThis options is primarily used to build root filesystems 10659751Smckusickthat can be understood by older boot ROMs. 107*69213Smckusick.It Fl T 108*69213SmckusickUses information for the specified disk from 109*69213Smckusick.Pa /etc/disktab 110*69213Smckusickinstead of trying to get the information from a disklabel. 11147463Scael.It Fl a Ar maxcontig 11266488SbosticThis specifies the maximum number of contiguous blocks that will be 11366488Sbosticlaid out before forcing a rotational delay (see the 11447463Scael.Fl d 11566488Sbosticoption). 11632311SmckusickThe default value is one. 11732311SmckusickSee 11847463Scael.Xr tunefs 8 11932311Smckusickfor more details on how to set this option. 12066488Sbostic.It Fl b Ar block-size 12166488SbosticThe block size of the file system, in bytes. 12266488Sbostic.It Fl c Ar #cylinders/group 12366488SbosticThe number of cylinders per cylinder group in a file system. 12466488SbosticThe default value is 16. 12547463Scael.It Fl d Ar rotdelay 12666488SbosticThis specifies the expected time (in milliseconds) to service a transfer 12766488Sbosticcompletion interrupt and initiate a new transfer on the same disk. 12832311SmckusickThe default is 4 milliseconds. 12932311SmckusickSee 13047463Scael.Xr tunefs 8 13132311Smckusickfor more details on how to set this option. 13267327Sah.ne 1i 13347463Scael.It Fl e Ar maxbpg 13432311SmckusickThis indicates the maximum number of blocks any single file can 13532311Smckusickallocate out of a cylinder group before it is forced to begin 13632311Smckusickallocating blocks from another cylinder group. 13732311SmckusickThe default is about one quarter of the total blocks in a cylinder group. 13832311SmckusickSee 13947463Scael.Xr tunefs 8 14032311Smckusickfor more details on how to set this option. 14166488Sbostic.It Fl f Ar frag-size 14266488SbosticThe fragment size of the file system in bytes. 14347463Scael.It Fl i Ar number of bytes per inode 14430392SmckusickThis specifies the density of inodes in the file system. 14530392SmckusickThe default is to create an inode for each 2048 bytes of data space. 14630392SmckusickIf fewer inodes are desired, a larger number should be used; 14730392Smckusickto create more inodes a smaller number should be given. 14866488Sbostic.It Fl m Ar free space \&% 14966488SbosticThe percentage of space reserved from normal users; the minimum free 15066488Sbosticspace threshold. 15166488SbosticThe default value used is 10%. 15266488SbosticSee 15366488Sbostic.Xr tunefs 8 15466488Sbosticfor more details on how to set this option. 155*69213Smckusick.It Fl n Ar rotational\ positions 156*69213SmckusickDetermines how many rotational time slots there are in 157*69213Smckusickone revolution of the disk. 15866488Sbostic.It Fl o Ar optimization\ preference 15966488Sbostic.Pq ``space'' or ``time'' 16066488SbosticThe file system can either be instructed to try to minimize the time spent 16166488Sbosticallocating blocks, or to try to minimize the space fragmentation on the disk. 16266488SbosticIf the value of minfree (see above) is less than 10%, 16366488Sbosticthe default is to optimize for space; 16466488Sbosticif the value of minfree is greater than or equal to 10%, 16566488Sbosticthe default is to optimize for time. 16666488SbosticSee 16766488Sbostic.Xr tunefs 8 16866488Sbosticfor more details on how to set this option. 16947463Scael.It Fl s Ar size 17030392SmckusickThe size of the file system in sectors. 17166488Sbostic.El 17247463Scael.Pp 17330392SmckusickThe following options override the standard sizes for the disk geometry. 17430392SmckusickTheir default values are taken from the disk label. 17530392SmckusickChanging these defaults is useful only when using 17647463Scael.Nm newfs 17766488Sbosticto build a file system whose raw image will eventually be used on a 17866488Sbosticdifferent type of disk than the one on which it is initially created 17966488Sbostic(for example on a write-once disk). 18066488SbosticNote that changing any of these values from their defaults will make 18166488Sbosticit impossible for 18247463Scael.Xr fsck 18365103Smckusickto find the alternate superblocks if the standard superblock is lost. 18466488Sbostic.Bl -tag -width Fl 18547463Scael.It Fl S Ar sector-size 18618990SmckusickThe size of a sector in bytes (almost never anything but 512). 18766488Sbostic.It Fl k Ar sector \&0 skew , per track 18866488SbosticUsed to describe perturbations in the media format to compensate for 18966488Sbostica slow controller. 19066488SbosticTrack skew is the offset of sector 0 on track N relative to sector 0 19166488Sbosticon track N-1 on the same cylinder. 19266488Sbostic.It Fl l Ar hardware sector interleave 19366488SbosticUsed to describe perturbations in the media format to compensate for 19466488Sbostica slow controller. 19566488SbosticInterleave is physical sector interleave on each track, 19666488Sbosticspecified as the denominator of the ratio: 19766488Sbostic.Dl sectors read/sectors passed over 19866488SbosticThus an interleave of 1/1 implies contiguous layout, while 1/2 implies 19966488Sbosticlogical sector 0 is separated by one sector from logical sector 1. 20047463Scael.It Fl p Ar spare sectors per track 20166488SbosticSpare sectors (bad sector replacements) are physical sectors that occupy 20266488Sbosticspace at the end of each track. 20347463ScaelThey are not counted as part of the sectors/track 20447463Scael.Pq Fl u 20530392Smckusicksince they are not available to the file system for data allocation. 20666488Sbostic.It Fl r Ar revolutions/minute 20766488SbosticThe speed of the disk in revolutions per minute. 20867327Sah.ne 1i 20966488Sbostic.It Fl t Ar #tracks/cylinder 21066488SbosticThe number of tracks/cylinder available for data allocation by the file 21166488Sbosticsystem. 21266488Sbostic.It Fl u Ar sectors/track 21366488SbosticThe number of sectors per track available for data allocation by the file 21466488Sbosticsystem. 21566488SbosticThis does not include sectors reserved at the end of each track for bad 21666488Sbosticblock replacement (see the 21766488Sbostic.Fl p 21866488Sbosticoption.) 21947463Scael.It Fl x Ar spare sectors per cylinder 22066488SbosticSpare sectors (bad sector replacements) are physical sectors that occupy 22166488Sbosticspace at the end of the last track in the cylinder. 22247463ScaelThey are deducted from the sectors/track 22347463Scael.Pq Fl u 22466488Sbosticof the last track of each cylinder since they are not available to the file 22566488Sbosticsystem for data allocation. 22666488Sbostic.El 22747463Scael.Pp 22866488SbosticThe options to the 22953710Smckusick.Nm mount_mfs 23066488Sbosticcommand are as described for the 23166488Sbostic.Nm newfs 23266488Sbosticcommand, except for the 23366488Sbostic.Fl o 23466488Sbosticoption. 23566488Sbostic.Pp 23666488SbosticThat option is as follows: 23766488Sbostic.Bl -tag -width indent 23866488Sbostic.It Fl o 23966488SbosticOptions are specified with a 24066488Sbostic.Fl o 24166488Sbosticflag followed by a comma separated string of options. 24266488SbosticSee the 24347463Scael.Xr mount 8 24466488Sbosticman page for possible options and their meanings. 24547463Scael.El 24647463Scael.Sh SEE ALSO 24747463Scael.Xr disktab 5 , 24847463Scael.Xr fs 5 , 24955927Sbostic.Xr dumpfs 8 , 25047463Scael.Xr disklabel 8 , 25147463Scael.Xr diskpart 8 , 25247463Scael.Xr fsck 8 , 25347463Scael.Xr format 8 , 25466488Sbostic.Xr mount 8 , 25547463Scael.Xr tunefs 8 25647463Scael.Rs 25747463Scael.%A M. McKusick 25847463Scael.%A W. Joy 25947463Scael.%A S. Leffler 26047463Scael.%A R. Fabry 26147463Scael.%T A Fast File System for UNIX , 26247463Scael.%J ACM Transactions on Computer Systems 2 26347463Scael.%V 3 26447463Scael.%P pp 181-197 26547463Scael.%D August 1984 26647463Scael.%O (reprinted in the BSD System Manager's Manual) 26747463Scael.Re 26847463Scael.Sh HISTORY 26947463ScaelThe 27047463Scael.Nm 27147463Scaelcommand appeared in 27247463Scael.Bx 4.2 . 273