cleanups, add manual page
[unix-history] / usr / src / sbin / newfs / newfs.8
CommitLineData
d069d05b 1.\" Copyright (c) 1983, 1987 Regents of the University of California.
4d8369df
KM
2.\" All rights reserved. The Berkeley software License Agreement
3.\" specifies the terms and conditions for redistribution.
4.\"
39970f0e 5.\" @(#)newfs.8 6.6 (Berkeley) %G%
4d8369df 6.\"
1ad9b5f3 7.TH NEWFS 8 ""
4d8369df
KM
8.UC 5
9.SH NAME
10newfs \- construct a new file system
11.SH SYNOPSIS
12.B /etc/newfs
13[
96099622
KM
14.B \-N
15] [
4d8369df
KM
16.B mkfs-options
17]
d024f4bd 18.B special
4d8369df
KM
19.SH DESCRIPTION
20.I Newfs
d024f4bd 21replaces the more obtuse
4d8369df
KM
22.IR mkfs (8)
23program.
d024f4bd
KM
24Before running
25.IR newfs ,
26the disk must be labeled using
27.IR disklabel (8).
4d8369df 28.I Newfs
d024f4bd
KM
29builds a file system on the specified special device
30basing its defaults on the information in the disk label.
31Typically the defaults are reasonable, however
32.I newfs
33has numerous options to allow the defaults to be selectively overridden.
96099622
KM
34The
35.B \-N
36option causes the file system parameters to be printed out
d069d05b 37without really creating the file system.
4d8369df 38.PP
d024f4bd 39The following options define the general layout policies.
4d8369df
KM
40.TP 10
41.B \-b block-size
42The block size of the file system in bytes.
43.TP 10
44.B \-f frag-size
45The fragment size of the file system in bytes.
46.TP 10
4d8369df
KM
47.B \-m free space %
48The percentage of space reserved from normal users; the minimum
d069d05b 49free space threshold. The default value used is 10%.
39970f0e
KM
50See
51.IR tunefs (8)
52for more details on how to set this option.
4d8369df 53.TP 10
96099622
KM
54.B \-o optimization preference (``space'' or ``time'')
55The file system can either be instructed to try to minimize the time spent
56allocating blocks, or to try to minimize the space fragmentation on the disk.
57If the value of minfree (see above) is less than 10%,
58the default is to optimize for space;
59if the value of minfree greater than or equal to 10%,
60the default is to optimize for time.
39970f0e
KM
61See
62.IR tunefs (8)
63for more details on how to set this option.
64.TP 10
65.B \-a maxcontig
66This specifies the maximum number of contiguous blocks that will
67be laid out before forcing a rotational delay (see \-d below).
68The default value is one.
69See
70.IR tunefs (8)
71for more details on how to set this option.
72.TP 10
73.B \-d rotdelay
74This specifies the expected time (in milliseconds)
75to service a transfer completion
76interrupt and initiate a new transfer on the same disk.
77The default is 4 milliseconds.
78See
79.IR tunefs (8)
80for more details on how to set this option.
81.TP 10
82.B \-e maxbpg
83This indicates the maximum number of blocks any single file can
84allocate out of a cylinder group before it is forced to begin
85allocating blocks from another cylinder group.
86The default is about one quarter of the total blocks in a cylinder group.
87See
88.IR tunefs (8)
89for more details on how to set this option.
96099622 90.TP 10
4d8369df
KM
91.B \-i number of bytes per inode
92This specifies the density of inodes in the file system.
93The default is to create an inode for each 2048 bytes of data space.
94If fewer inodes are desired, a larger number should be used;
95to create more inodes a smaller number should be given.
d024f4bd
KM
96.TP 10
97.B \-c #cylinders/group
98The number of cylinders per cylinder group in a file system.
99The default value used is 16.
100.TP 10
101.B \-s size
102The size of the file system in sectors.
103.PP
104The following options override the standard sizes for the disk geometry.
105Their default values are taken from the disk label.
106Changing these defaults is useful only when using
107.I newfs
108to build a file system whose raw image will eventually be used
109on a different type of disk than the one on which it is initially
110created (for example on a write-once disk).
d069d05b
KM
111Note that changing any of these values from their
112defaults will make it impossible for
113.I fsck
114to find the alternate superblocks if the standard super block is lost.
d024f4bd
KM
115.TP 10
116.B \-r revolutions/minute
117The speed of the disk in revolutions per minute.
118.TP 10
119.B \-S sector-size
120The size of a sector in bytes (almost never anything but 512).
121.TP 10
39970f0e 122.B \-u sectors/track
d024f4bd
KM
123The number of sectors/track available for data
124allocation by the file system.
125This does not include sectors reserved at the end of each track for
126bad block replacement (see \fB\-p\fP below).
127.TP 10
128.B \-t #tracks/cylinder
129The number of tracks/cylinder available for data
130allocation by the file system.
131.TP 10
132.B \-p spare sectors per track
133Spare sectors (bad sector replacements) are physical sectors
134that occupy space at the end of each track.
39970f0e 135They are not counted as part of the sectors/track (\fB\-u\fP)
d024f4bd
KM
136since they are not available to the file system for data allocation.
137.TP 10
39970f0e 138.B \-x spare sectors per cylinder
d024f4bd
KM
139Spare sectors (bad sector replacements) are physical sectors
140that occupy space at the end of the last track in the cylinder.
39970f0e 141They are deducted from the sectors/track (\fB\-u\fP)
d024f4bd
KM
142of the last track of each cylinder
143since they are not available to the file system for data allocation.
144.TP 10
145.B \-l hardware sector interleave
146Used to describe perturbations in the media format to
147compensate for a slow controller.
148Interleave is physical sector interleave on each track,
149specified as the denominator of the ratio:
150.nf
151 sectors read / sectors passed over
152.fi
153Thus an interleave of 1/1 implies contiguous layout, while 1/2
154implies logical sector 0 is separated by one sector from logical
155sector 1.
156.TP 10
157.B \-k sector 0 skew, per track
158Used to describe perturbations in the media format to
159compensate for a slow controller.
160Track skew is the offset of sector 0 on track N
161relative to sector 0 on track N-1 on the same cylinder.
4d8369df
KM
162.SH "SEE ALSO"
163disktab(5),
164fs(5),
d024f4bd 165disklabel(8),
4d8369df
KM
166diskpart(8),
167fsck(8),
168format(8),
4d8369df
KM
169tunefs(8)
170.PP
96099622
KM
171M. McKusick, W. Joy, S. Leffler, R. Fabry,
172``A Fast File System for UNIX'',
173\fIACM Transactions on Computer Systems 2\fP, 3.
174pp 181-197, August 1984.
2c6735dc 175(reprinted in the System Manager's Manual, SMM:14)