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
33 .\" $FreeBSD: src/sbin/newfs/newfs.8,v 1.26.2.15 2003/05/13 12:16:08 joerg Exp $
34 .\" $DragonFly: src/sbin/newfs/newfs.8,v 1.7 2007/05/20 19:29:21 dillon Exp $
42 .Nd construct a new file system
46 .Op Fl S Ar sector-size
49 .Op Fl b Ar block-size
54 .Op Fl g Ar avgfilesize
58 .Op Fl l Ar interleave
59 .Op Fl m Ar free space
60 .Op Fl n Ar rotational positions
61 .Op Fl o Ar optimization
63 .Op Fl r Ar revolutions
75 .Op Fl b Ar block-size
81 .Op Fl m Ar free space
82 .Op Fl n Ar rotational positions
89 is used to initialize and clear filesystems before first use.
94 the disk must be labeled using
97 builds a file system on the specified special file.
98 (We often refer to the
102 although the special file need not be a physical disk.
103 In fact, it need not even be special.)
104 Typically the defaults are reasonable, however
106 has numerous options to allow the defaults to be selectively overridden.
109 is used to build a file system in virtual memory and then mount it
112 exits and the contents of the file system are lost
113 when the file system is unmounted.
116 is sent a signal while running,
117 for example during system shutdown,
118 it will attempt to unmount its
119 corresponding file system.
122 are the same as those to
126 flag is specified (see below), the special file is unused.
127 Otherwise, it is only used to read the disk label which provides
128 a set of configuration parameters for the memory based file system.
129 The special file is typically that of the primary swap area,
130 since that is where the file system will be backed up when
131 free memory gets low and the memory supporting
132 the file system has to be paged.
135 creates the raw character device
137 to represent the backing store while the mount is active. This device may
138 be read but not written and allows swap-based MFS filesystems to be dumped
141 The following options define the general layout policies:
142 .Bl -tag -width indent
144 For backward compatibility and for
148 will use this file for the image of the filesystem. When
150 exits, this file will be left behind.
154 to copy the underlying filesystem into the MFS mount being created
157 Cause the file system parameters to be printed out
158 without really creating the file system.
163 This options is primarily used to build root filesystems
164 that can be understood by older boot ROMs.
166 Use information for the specified disk from
168 instead of trying to get geometry information from the
171 Enables soft updates on the new filesystem.
172 .It Fl a Ar maxcontig
173 Specify the maximum number of contiguous blocks that will be
174 laid out before forcing a rotational delay (see the
177 The default value is 1.
180 for more details on how to set this option.
181 .It Fl b Ar block-size
182 The block size of the file system, in bytes. It must be a power of 2. The
183 default size is 16384 bytes, and the smallest allowable size is 4096 bytes.
184 The optimal block:fragment ratio is 8:1.
185 Other ratios are possible, but are not recommended,
186 and may produce unpredictable results.
187 .It Fl c Ar #cylinders/group
188 The number of cylinders per cylinder group in a file system. The default
189 is to compute the maximum allowed by the other parameters. This value is
190 dependent on a number of other parameters, in particular the block size
191 and the number of bytes per inode.
193 This parameter once specified the minimum time in milliseconds required to
194 initiate another disk transfer on the same cylinder. It was used in determining
195 the rotationally optimal layout for disk blocks within a file. Modern disks
196 with read/write-behind achieve higher performance with this feature disabled, so
197 this value should be left at the default value of 0 milliseconds. See
199 for more details on how to set this option.
201 Indicate the maximum number of blocks any single file can
202 allocate out of a cylinder group before it is forced to begin
203 allocating blocks from another cylinder group.
204 The default is about one quarter of the total blocks in a cylinder group.
207 for more details on how to set this option.
208 .It Fl f Ar frag-size
209 The fragment size of the file system in bytes. It must be a power of two
210 ranging in value between
214 The default is 2048 bytes.
215 .It Fl g Ar avgfilesize
216 The expected average file size for the file system.
218 The expected average number of files per directory on the file system.
219 .It Fl i Ar number of bytes per inode
220 Specify the density of inodes in the file system.
221 The default is to create an inode for every
224 If fewer inodes are desired, a larger number should be used;
225 to create more inodes a smaller number should be given.
226 One inode is required for each distinct file, so this value effectively
227 specifies the average file size on the file system.
228 .It Fl m Ar free space \&%
229 The percentage of space reserved from normal users; the minimum free
231 The default value used is
239 for more details on how to set this option.
240 .It Fl n Ar number of distinguished rotational positions
242 has the ability to keep track of the availability of blocks at different
243 rotational positions, so that it could lay out the data to be picked up with
244 minimum rotational latency. This parameter specifies the default number of
245 rotational positions to distinguish.
247 Nowadays this value should be set to 1 (which essentially disables the
248 rotational position table) because modern drives with read-ahead and
249 write-behind do better without the rotational position table.
250 .It Fl o Ar optimization\ preference
251 .Pq Ar space No or Ar time .
252 The file system can either be instructed to try to minimize the time spent
253 allocating blocks, or to try to minimize the space fragmentation on the disk.
254 If the value of minfree (see above) is less than 8%,
255 the default is to optimize for
257 if the value of minfree is greater than or equal to 8%,
258 the default is to optimize for
262 for more details on how to set this option.
264 The size of the file system in sectors. This value defaults to the size of the
265 raw partition specified in
269 will use the entire partition for the file system).
271 Specify that the disk does not contain any partitions, and that
273 should build a file system on the whole disk.
274 This option is useful for synthetic disks such as
276 It may also be used to allow
278 to operate on regular files.
279 When operating on a regular file,
281 will synthesize a reasonable geometry for the filesystem.
284 The following options override the standard sizes for the disk geometry.
285 Their default values are taken from the disk label.
286 Changing these defaults is useful only when using
288 to build a file system whose raw image will eventually be used on a
289 different type of disk than the one on which it is initially created
290 (for example on a write-once disk).
291 Note that changing any of these values from their defaults will make
294 to find the alternate superblocks if the standard superblock is lost.
295 .Bl -tag -width indent
296 .It Fl S Ar sector-size
297 The size of a sector in bytes (almost never anything but 512).
298 .It Fl k Ar sector \&0 skew , per track
299 Used to describe perturbations in the media format to compensate for
301 Track skew is the offset of sector 0 on track N relative to sector 0
302 on track N-1 on the same cylinder.
303 This option is of historical importance only; modern controllers are always fast
304 enough to handle operations back-to-back.
305 .It Fl l Ar hardware sector interleave
306 Used to describe perturbations in the media format to compensate for
308 Interleave is physical sector interleave on each track,
309 specified as the denominator of the ratio:
310 .Dl sectors read/sectors passed over
311 Thus an interleave of 1/1 implies contiguous layout, while 1/2 implies
312 logical sector 0 is separated by one sector from logical sector 1.
313 This option is of historical importance only; the physical sector layout of
314 modern disks is not visible from outside.
315 .It Fl p Ar spare sectors per track
316 Spare sectors (bad sector replacements) are physical sectors that occupy
317 space at the end of each track.
318 They are not counted as part of the sectors/track
320 since they are not available to the file system for data allocation.
321 This option is of historical importance only. Modern disks perform their own
322 bad sector allocation.
323 .It Fl r Ar revolutions/minute
324 The speed of the disk in revolutions per minute. This value is no longer of
325 interest, since all the parameters which depend on it are usually disabled.
326 .It Fl t Ar #tracks/cylinder
327 The number of tracks/cylinder available for data allocation by the file
330 If zero is specified, the value from the device geometry will be used.
331 .It Fl u Ar sectors/track
332 The number of sectors per track available for data allocation by the file
335 If zero is specified, the value from the device geometry will be used.
336 This does not include sectors reserved at the end of each track for bad
337 block replacement (see the
340 .It Fl x Ar spare sectors per cylinder
341 Spare sectors (bad sector replacements) are physical sectors that occupy
342 space at the end of the last track in the cylinder.
343 They are deducted from the sectors/track
345 of the last track of each cylinder since they are not available to the file
346 system for data allocation.
347 This option is of historical importance only. Modern disks perform their own
348 bad sector allocation.
353 command are as described for the
355 command, except for the
359 That option is as follows:
360 .Bl -tag -width indent
362 Options are specified with a
364 flag followed by a comma separated string of options.
367 man page for possible options and their meanings.
370 .Dl newfs /dev/ad3s1a
377 will use a block size of 16384 bytes, a fragment size of 2048 bytes
378 and the largest possible number of cylinders per group.
379 These values tend to produce better performance for most applications
380 than the historical defaults
381 (8192 byte block size and 1024 byte fragment size).
382 This large fragment size
383 may lead to large amounts of wasted space
384 on filesystems that contain a large number of small files.
386 .Dl mount_mfs -s 131072 -o nosuid,nodev,nosymfollow /dev/da0s1b /tmp
388 Mount a 64 MB large memory file system on
413 .%T A Fast File System for UNIX
414 .%J ACM Transactions on Computer Systems 2
418 .%O (reprinted in the BSD System Manager's Manual)