1 .\" Copyright (c) 1983, 1987, 1991, 1993, 1994
2 .\" The Regents of the University of California. All rights reserved.
4 .\" Redistribution and use in source and binary forms, with or without
5 .\" modification, are permitted provided that the following conditions
7 .\" 1. Redistributions of source code must retain the above copyright
8 .\" notice, this list of conditions and the following disclaimer.
9 .\" 2. Redistributions in binary form must reproduce the above copyright
10 .\" notice, this list of conditions and the following disclaimer in the
11 .\" documentation and/or other materials provided with the distribution.
12 .\" 3. All advertising materials mentioning features or use of this software
13 .\" must display the following acknowledgement:
14 .\" This product includes software developed by the University of
15 .\" California, Berkeley and its contributors.
16 .\" 4. Neither the name of the University nor the names of its contributors
17 .\" may be used to endorse or promote products derived from this software
18 .\" without specific prior written permission.
20 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
21 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
24 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32 .\" @(#)newfs.8 8.6 (Berkeley) 5/3/95
41 .Nd construct a new file system
45 .Op Fl S Ar sector-size
48 .Op Fl b Ar block-size
55 .Op Fl l Ar interleave
56 .Op Fl m Ar free space
57 .Op Fl n Ar rotational positions
58 .Op Fl o Ar optimization
60 .Op Fl r Ar revolutions
72 .Op Fl b Ar block-size
78 .Op Fl m Ar free space
79 .Op Fl n Ar rotational positions
91 is used to initialize and clear filesystems before first use.
96 the disk must be labeled using
99 builds a file system on the specified special file.
100 (We often refer to the
104 although the special file need not be a physical disk.
105 In fact, it need not even be special.)
106 Typically the defaults are reasonable, however
108 has numerous options to allow the defaults to be selectively overridden.
111 is used to build a file system in virtual memory and then mount it
114 exits and the contents of the file system are lost
115 when the file system is unmounted.
118 is sent a signal while running,
119 for example during system shutdown,
120 it will attempt to unmount its
121 corresponding file system.
124 are the same as those to
128 flag is specified (see below), the special file is unused.
129 Otherwise, it is only used to read the disk label which provides
130 a set of configuration parameters for the memory based file system.
131 The special file is typically that of the primary swap area,
132 since that is where the file system will be backed up when
133 free memory gets low and the memory supporting
134 the file system has to be paged.
136 The following options define the general layout policies:
137 .Bl -tag -width indent
139 For backward compatibility and for
143 will use this file for the image of the filesystem. When
145 exits, this file will be left behind.
147 Cause the file system parameters to be printed out
148 without really creating the file system.
153 This options is primarily used to build root filesystems
154 that can be understood by older boot ROMs.
156 Use information for the specified disk from
158 instead of trying to get the information from a disklabel.
160 Enables soft updates on the new filesystem.
161 .It Fl a Ar maxcontig
162 Specify the maximum number of contiguous blocks that will be
163 laid out before forcing a rotational delay (see the
166 The default value is 1.
169 for more details on how to set this option.
170 .It Fl b Ar block-size
171 The block size of the file system, in bytes. It must be a power of 2. The
172 default size is 8192 bytes, and the smallest allowable size is 4096 bytes.
173 .It Fl c Ar #cylinders/group
174 The number of cylinders per cylinder group in a file system. The default value
175 is 22. The maximum value is dependent on a number of other parameters, in
176 particular the block size. The best way to find the maximum value for a
177 specific file system is to attempt to specify a value which is far too large:
179 will print out the maximum value.
181 This parameter once specified the minimum time in milliseconds required to
182 initiate another disk transfer on the same cylinder. It was used in determining
183 the rotationally optimal layout for disk blocks within a file. Modern disks
184 with read/write-behind achieve higher performance with this feature disabled, so
185 this value should be left at the default value of 0 milliseconds. See
187 for more details on how to set this option.
189 Indicate the maximum number of blocks any single file can
190 allocate out of a cylinder group before it is forced to begin
191 allocating blocks from another cylinder group.
192 The default is about one quarter of the total blocks in a cylinder group.
195 for more details on how to set this option.
196 .It Fl f Ar frag-size
197 The fragment size of the file system in bytes. It must be a power of two
198 ranging in value between
202 The default is 1024 bytes.
203 .It Fl i Ar number of bytes per inode
204 Specify the density of inodes in the file system.
205 The default is to create an inode for every
208 If fewer inodes are desired, a larger number should be used;
209 to create more inodes a smaller number should be given.
210 One inode is required for each distinct file, so this value effectively
211 specifies the average file size on the file system.
212 .It Fl m Ar free space \&%
213 The percentage of space reserved from normal users; the minimum free
215 The default value used is
219 .Aq Pa ufs/ffs/fs.h ,
223 for more details on how to set this option.
224 .It Fl n Ar number of distinguished rotational positions
225 UFS has the ability to keep track of the availability of blocks at different
226 rotational positions, so that it could lay out the data to be picked up with
227 minimum rotational latency. This parameter specifies the default number of
228 rotational positions to distinguish.
230 Nowadays this value should be set to 1 (which essentially disables the
231 rotational position table) because modern drives with read-ahead and
232 write-behind do better without the rotational position table.
233 .It Fl o Ar optimization\ preference
234 .Pq Ar space No or Ar time .
235 The file system can either be instructed to try to minimize the time spent
236 allocating blocks, or to try to minimize the space fragmentation on the disk.
237 If the value of minfree (see above) is less than 8%,
238 the default is to optimize for
240 if the value of minfree is greater than or equal to 8%,
241 the default is to optimize for
245 for more details on how to set this option.
247 The size of the file system in sectors. This value defaults to the size of the
248 raw partition specified in
252 will use the entire partition for the file system).
254 Specify that the disk does not contain any partitions, and that
256 should build a file system on the whole disk.
257 This option is useful for synthetic disks such as
261 The following options override the standard sizes for the disk geometry.
262 Their default values are taken from the disk label.
263 Changing these defaults is useful only when using
265 to build a file system whose raw image will eventually be used on a
266 different type of disk than the one on which it is initially created
267 (for example on a write-once disk).
268 Note that changing any of these values from their defaults will make
271 to find the alternate superblocks if the standard superblock is lost.
272 .Bl -tag -width indent
273 .It Fl S Ar sector-size
274 The size of a sector in bytes (almost never anything but 512).
275 .It Fl k Ar sector \&0 skew , per track
276 Used to describe perturbations in the media format to compensate for
278 Track skew is the offset of sector 0 on track N relative to sector 0
279 on track N-1 on the same cylinder.
280 This option is of historical importance only; modern controllers are always fast
281 enough to handle operations back-to-back.
282 .It Fl l Ar hardware sector interleave
283 Used to describe perturbations in the media format to compensate for
285 Interleave is physical sector interleave on each track,
286 specified as the denominator of the ratio:
287 .Dl sectors read/sectors passed over
288 Thus an interleave of 1/1 implies contiguous layout, while 1/2 implies
289 logical sector 0 is separated by one sector from logical sector 1.
290 This option is of historical importance only; the physical sector layout of
291 modern disks is not visible from outside.
292 .It Fl p Ar spare sectors per track
293 Spare sectors (bad sector replacements) are physical sectors that occupy
294 space at the end of each track.
295 They are not counted as part of the sectors/track
297 since they are not available to the file system for data allocation.
298 This option is of historical importance only. Modern disks perform their own
299 bad sector allocation.
300 .It Fl r Ar revolutions/minute
301 The speed of the disk in revolutions per minute. This value is no longer of
302 interest, since all the parameters which depend on it are usually disabled.
303 .It Fl t Ar #tracks/cylinder
304 The number of tracks/cylinder available for data allocation by the file
307 If zero is specified, the value from the disklabel will be used.
308 .It Fl u Ar sectors/track
309 The number of sectors per track available for data allocation by the file
312 If zero is specified, the value from the disklabel will be used.
313 This does not include sectors reserved at the end of each track for bad
314 block replacement (see the
317 .It Fl x Ar spare sectors per cylinder
318 Spare sectors (bad sector replacements) are physical sectors that occupy
319 space at the end of the last track in the cylinder.
320 They are deducted from the sectors/track
322 of the last track of each cylinder since they are not available to the file
323 system for data allocation.
324 This option is of historical importance only. Modern disks perform their own
325 bad sector allocation.
330 command are as described for the
332 command, except for the
336 That option is as follows:
337 .Bl -tag -width indent
339 Options are specified with a
341 flag followed by a comma separated string of options.
344 man page for possible options and their meanings.
348 .Dl newfs -b 16384 -f 4096 -c 100 /dev/ad3s1a
350 Creates a new ufs file system on
353 will use a block size of 16384 bytes, a fragement size of 4096 bytes
354 and have 100 cylinders per cylinder group rather than the defaults.
355 These values are tend to produce better performance than the defaults
356 for file systems larger than about 5 gigabytes.
358 .Dl mount_mfs -s 131072 -o nosuid,nodev /dev/da0s1b /tmp
360 Mount a 64 MB large memory file system on
385 .%T A Fast File System for UNIX
386 .%J ACM Transactions on Computer Systems 2
390 .%O (reprinted in the BSD System Manager's Manual)