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