modern syntax for asgops and inits; sccs keywords
[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.\"
d069d05b 5.\" @(#)newfs.8 6.5 (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%.
4d8369df 50.TP 10
96099622
KM
51.B \-o optimization preference (``space'' or ``time'')
52The file system can either be instructed to try to minimize the time spent
53allocating blocks, or to try to minimize the space fragmentation on the disk.
54If the value of minfree (see above) is less than 10%,
55the default is to optimize for space;
56if the value of minfree greater than or equal to 10%,
57the default is to optimize for time.
58.TP 10
4d8369df
KM
59.B \-i number of bytes per inode
60This specifies the density of inodes in the file system.
61The default is to create an inode for each 2048 bytes of data space.
62If fewer inodes are desired, a larger number should be used;
63to create more inodes a smaller number should be given.
d024f4bd
KM
64.TP 10
65.B \-c #cylinders/group
66The number of cylinders per cylinder group in a file system.
67The default value used is 16.
68.TP 10
69.B \-s size
70The size of the file system in sectors.
71.PP
72The following options override the standard sizes for the disk geometry.
73Their default values are taken from the disk label.
74Changing these defaults is useful only when using
75.I newfs
76to build a file system whose raw image will eventually be used
77on a different type of disk than the one on which it is initially
78created (for example on a write-once disk).
d069d05b
KM
79Note that changing any of these values from their
80defaults will make it impossible for
81.I fsck
82to find the alternate superblocks if the standard super block is lost.
d024f4bd
KM
83.TP 10
84.B \-r revolutions/minute
85The speed of the disk in revolutions per minute.
86.TP 10
87.B \-S sector-size
88The size of a sector in bytes (almost never anything but 512).
89.TP 10
90.B \-d sectors/track
91The number of sectors/track available for data
92allocation by the file system.
93This does not include sectors reserved at the end of each track for
94bad block replacement (see \fB\-p\fP below).
95.TP 10
96.B \-t #tracks/cylinder
97The number of tracks/cylinder available for data
98allocation by the file system.
99.TP 10
100.B \-p spare sectors per track
101Spare sectors (bad sector replacements) are physical sectors
102that occupy space at the end of each track.
103They are not counted as part of the sectors/track (\fB\-d\fP)
104since they are not available to the file system for data allocation.
105.TP 10
106.B \-a spare sectors per cylinder
107Spare sectors (bad sector replacements) are physical sectors
108that occupy space at the end of the last track in the cylinder.
109They are deducted from the sectors/track (\fB\-d\fP)
110of the last track of each cylinder
111since they are not available to the file system for data allocation.
112.TP 10
113.B \-l hardware sector interleave
114Used to describe perturbations in the media format to
115compensate for a slow controller.
116Interleave is physical sector interleave on each track,
117specified as the denominator of the ratio:
118.nf
119 sectors read / sectors passed over
120.fi
121Thus an interleave of 1/1 implies contiguous layout, while 1/2
122implies logical sector 0 is separated by one sector from logical
123sector 1.
124.TP 10
125.B \-k sector 0 skew, per track
126Used to describe perturbations in the media format to
127compensate for a slow controller.
128Track skew is the offset of sector 0 on track N
129relative to sector 0 on track N-1 on the same cylinder.
4d8369df
KM
130.SH "SEE ALSO"
131disktab(5),
132fs(5),
d024f4bd 133disklabel(8),
4d8369df
KM
134diskpart(8),
135fsck(8),
136format(8),
4d8369df
KM
137tunefs(8)
138.PP
96099622
KM
139M. McKusick, W. Joy, S. Leffler, R. Fabry,
140``A Fast File System for UNIX'',
141\fIACM Transactions on Computer Systems 2\fP, 3.
142pp 181-197, August 1984.
2c6735dc 143(reprinted in the System Manager's Manual, SMM:14)