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