date and time created 92/07/05 14:15:17 by bostic
[unix-history] / usr / src / sbin / newfs / newfs.8
CommitLineData
70567b1c 1.\" Copyright (c) 1983, 1987, 1991 The Regents of the University of California.
48609c27 2.\" All rights reserved.
4d8369df 3.\"
f7c99d97 4.\" %sccs.include.redist.man%
48609c27 5.\"
5a30b417 6.\" @(#)newfs.8 6.11 (Berkeley) %G%
4d8369df 7.\"
70567b1c
CL
8.Dd
9.Dt NEWFS 8
10.Os BSD 4.2
11.Sh NAME
12.Nm newfs ,
13.Nm mfs
14.Nd construct a new file system
15.Sh SYNOPSIS
16.Nm newfs
17.Op Fl N
18.Op Ar newfs-options
19.Ar special
5a30b417 20.Nm mount_mfs
70567b1c
CL
21.Op Fl F Ar mount_flags
22.Op Ar newfs-options
23.Ar special node
24.Sh DESCRIPTION
25.Nm Newfs
d024f4bd 26replaces the more obtuse
70567b1c 27.Xr mkfs 8
4d8369df 28program.
d024f4bd 29Before running
70567b1c 30.Nm newfs
c01742b3 31or
5a30b417 32.Nm mount_mfs ,
d024f4bd 33the disk must be labeled using
70567b1c
CL
34.Xr disklabel 8 .
35.Nm Newfs
d024f4bd
KM
36builds a file system on the specified special device
37basing its defaults on the information in the disk label.
38Typically the defaults are reasonable, however
70567b1c 39.Nm newfs
d024f4bd 40has numerous options to allow the defaults to be selectively overridden.
70567b1c 41.Pp
5a30b417 42.Nm Mount_mfs
c01742b3
KM
43is used to build a file system in virtual memory and then mount it
44on a specified node.
5a30b417 45.Nm Mount_mfs
c01742b3
KM
46exits and the contents of the file system are lost
47when the file system is unmounted.
48If
5a30b417 49.Nm mount_mfs
c01742b3
KM
50is sent a signal while running,
51for example during system shutdown,
52it will attempt to unmount its
53corresponding file system.
54The parameters to
5a30b417 55.Nm mount_mfs
c01742b3 56are the same as those to
70567b1c 57.Nm newfs .
c01742b3
KM
58The special file is only used to read the disk label which provides
59a set of configuration parameters for the memory based file system.
60The special file is typically that of the primary swap area,
61since that is where the file system will be backed up when
62free memory gets low and the memory supporting
63the file system has to be paged.
70567b1c 64.Pp
d024f4bd 65The following options define the general layout policies.
70567b1c
CL
66.Bl -tag -width Fl
67.It Fl N
68Causes the file system parameters to be printed out
69without really creating the file system.
70.It Fl b Ar block-size
4d8369df 71The block size of the file system in bytes.
70567b1c 72.It Fl f Ar frag-size
4d8369df 73The fragment size of the file system in bytes.
70567b1c 74.It Fl m Ar free space \&%
4d8369df 75The percentage of space reserved from normal users; the minimum
d069d05b 76free space threshold. The default value used is 10%.
39970f0e 77See
70567b1c 78.Xr tunefs 8
39970f0e 79for more details on how to set this option.
70567b1c
CL
80.It Fl o Ar optimization\ preference
81.Pq ``space'' or ``time''
96099622
KM
82The file system can either be instructed to try to minimize the time spent
83allocating blocks, or to try to minimize the space fragmentation on the disk.
84If the value of minfree (see above) is less than 10%,
85the default is to optimize for space;
86if the value of minfree greater than or equal to 10%,
87the default is to optimize for time.
39970f0e 88See
70567b1c 89.Xr tunefs 8
39970f0e 90for more details on how to set this option.
70567b1c 91.It Fl a Ar maxcontig
39970f0e 92This specifies the maximum number of contiguous blocks that will
70567b1c
CL
93be laid out before forcing a rotational delay (see
94.Fl d
95below).
39970f0e
KM
96The default value is one.
97See
70567b1c 98.Xr tunefs 8
39970f0e 99for more details on how to set this option.
70567b1c 100.It Fl d Ar rotdelay
39970f0e
KM
101This specifies the expected time (in milliseconds)
102to service a transfer completion
103interrupt and initiate a new transfer on the same disk.
104The default is 4 milliseconds.
105See
70567b1c 106.Xr tunefs 8
39970f0e 107for more details on how to set this option.
70567b1c 108.It Fl e Ar maxbpg
39970f0e
KM
109This indicates the maximum number of blocks any single file can
110allocate out of a cylinder group before it is forced to begin
111allocating blocks from another cylinder group.
112The default is about one quarter of the total blocks in a cylinder group.
113See
70567b1c 114.Xr tunefs 8
39970f0e 115for more details on how to set this option.
70567b1c 116.It Fl i Ar number of bytes per inode
4d8369df
KM
117This specifies the density of inodes in the file system.
118The default is to create an inode for each 2048 bytes of data space.
119If fewer inodes are desired, a larger number should be used;
120to create more inodes a smaller number should be given.
70567b1c 121.It Fl c Ar #cylinders/group
d024f4bd
KM
122The number of cylinders per cylinder group in a file system.
123The default value used is 16.
70567b1c 124.It Fl s Ar size
d024f4bd 125The size of the file system in sectors.
70567b1c 126.Pp
d024f4bd
KM
127The following options override the standard sizes for the disk geometry.
128Their default values are taken from the disk label.
129Changing these defaults is useful only when using
70567b1c 130.Nm newfs
d024f4bd
KM
131to build a file system whose raw image will eventually be used
132on a different type of disk than the one on which it is initially
133created (for example on a write-once disk).
d069d05b
KM
134Note that changing any of these values from their
135defaults will make it impossible for
70567b1c 136.Xr fsck
d069d05b 137to find the alternate superblocks if the standard super block is lost.
70567b1c 138.It Fl r Ar revolutions/minute
d024f4bd 139The speed of the disk in revolutions per minute.
70567b1c 140.It Fl S Ar sector-size
d024f4bd 141The size of a sector in bytes (almost never anything but 512).
70567b1c
CL
142.It Fl u Ar sectors/track
143The number of sectors per track available for data
144allocation by the file system. This does not
145include sectors reserved at the end of each track
146for bad block replacement (see
147.Fl p
148below).
149.It Fl t Ar #tracks/cylinder
d024f4bd
KM
150The number of tracks/cylinder available for data
151allocation by the file system.
70567b1c 152.It Fl p Ar spare sectors per track
d024f4bd
KM
153Spare sectors (bad sector replacements) are physical sectors
154that occupy space at the end of each track.
70567b1c
CL
155They are not counted as part of the sectors/track
156.Pq Fl u
d024f4bd 157since they are not available to the file system for data allocation.
70567b1c 158.It Fl x Ar spare sectors per cylinder
d024f4bd
KM
159Spare sectors (bad sector replacements) are physical sectors
160that occupy space at the end of the last track in the cylinder.
70567b1c
CL
161They are deducted from the sectors/track
162.Pq Fl u
d024f4bd
KM
163of the last track of each cylinder
164since they are not available to the file system for data allocation.
70567b1c 165.It Fl l Ar hardware sector interleave
d024f4bd
KM
166Used to describe perturbations in the media format to
167compensate for a slow controller.
168Interleave is physical sector interleave on each track,
169specified as the denominator of the ratio:
70567b1c 170.Dl sectors read/sectors passed over
d024f4bd
KM
171Thus an interleave of 1/1 implies contiguous layout, while 1/2
172implies logical sector 0 is separated by one sector from logical
173sector 1.
70567b1c 174.It Fl k Ar sector \&0 skew , per track
d024f4bd
KM
175Used to describe perturbations in the media format to
176compensate for a slow controller.
177Track skew is the offset of sector 0 on track N
178relative to sector 0 on track N-1 on the same cylinder.
70567b1c
CL
179.Pp
180.El
c01742b3 181The following option applies only to
5a30b417 182.Nm mount_mfs .
70567b1c
CL
183.Bl -tag -width Fl
184.It Fl F Ar mount flags
c01742b3
KM
185Used to pass in a decimal numeric value to be passed
186as mount flags when running as a memory based file system.
187This option is primarily intended for use when
5a30b417 188.Nm mount_mfs
c01742b3 189is started by the
70567b1c 190.Xr mount 8
c01742b3 191command.
70567b1c
CL
192.El
193.Sh SEE ALSO
194.Xr disktab 5 ,
195.Xr fs 5 ,
196.Xr disklabel 8 ,
197.Xr diskpart 8 ,
198.Xr fsck 8 ,
199.Xr format 8 ,
200.Xr tunefs 8
201.Rs
202.%A M. McKusick
203.%A W. Joy
204.%A S. Leffler
205.%A R. Fabry
206.%T A Fast File System for UNIX ,
207.%J ACM Transactions on Computer Systems 2
208.%V 3
209.%P pp 181-197
210.%D August 1984
211.%O (reprinted in the BSD System Manager's Manual)
212.Re
213.Sh HISTORY
214The
215.Nm
216command appeared in
217.Bx 4.2 .