1 .\" $NetBSD: newfs.8,v 1.74 2009/07/01 02:43:34 uwe Exp $
3 .\" Copyright (c) 1983, 1987, 1991, 1993, 1994
4 .\" The Regents of the University of California. All rights reserved.
6 .\" Redistribution and use in source and binary forms, with or without
7 .\" modification, are permitted provided that the following conditions
9 .\" 1. Redistributions of source code must retain the above copyright
10 .\" notice, this list of conditions and the following disclaimer.
11 .\" 2. Redistributions in binary form must reproduce the above copyright
12 .\" notice, this list of conditions and the following disclaimer in the
13 .\" documentation and/or other materials provided with the distribution.
14 .\" 3. Neither the name of the University nor the names of its contributors
15 .\" may be used to endorse or promote products derived from this software
16 .\" without specific prior written permission.
18 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
19 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
22 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
24 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
25 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
26 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
27 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30 .\" @(#)newfs.8 8.6 (Berkeley) 5/3/95
37 .Nd construct a new file system
42 .Op Fl B Ar byte-order
43 .Op Fl b Ar block-size
47 .Op Fl g Ar avgfilesize
49 .Op Fl i Ar bytes-per-inode
50 .Op Fl m Ar free-space
52 .Op Fl O Ar filesystem-format
53 .Op Fl o Ar optimization
54 .Op Fl S Ar sector-size
62 is used to initialize and clear file systems before first use.
65 the disk must be labeled using
68 builds a file system on the specified special device
69 basing its defaults on the information in the disk label.
70 Typically the defaults are reasonable, however
72 has numerous options to allow the defaults to be selectively overridden.
74 Options with numeric arguments may contain an optional (case-insensitive)
76 .Bl -tag -width 3n -offset indent -compact
78 Bytes; causes no modification.
81 Kilo; multiply the argument by 1024
83 Mega; multiply the argument by 1048576
85 Giga; multiply the argument by 1073741824
87 Tera; multiply the argument by 1099511627776
90 The following options define the general layout policies.
93 This sets the obsolete maxcontig parameter.
94 .It Fl B Ar byte-order
95 Specify the metadata byte order of the file system to be created.
100 If no byte order is specified, the file system is created in host
102 .It Fl b Ar block-size
103 The block size of the file system, in bytes.
104 It must be a power of two.
105 The smallest allowable size is 4096 bytes.
106 The default size depends upon the size of the file system:
108 .Bl -tag -width "file system size" -compact -offset indent
109 .It Sy "file system size"
119 Set the maximum extent size to
122 This indicates the maximum number of blocks any single file can
123 allocate out of a cylinder group before it is forced to begin
124 allocating blocks from another cylinder group.
125 The default is about one quarter of the total blocks in a cylinder group.
128 for more details on how to set this option.
130 Create a file system image in
132 The file system size needs to be specified with
134 No attempts to use or update the disk label will be made.
135 .It Fl f Ar frag-size
136 The fragment size of the file system in bytes.
137 It must be a power of two ranging in value between
142 .Ar block-size : Ns Ar frag-size
144 Other ratios are possible, but are not recommended,
145 and may produce unpredictable results.
146 The default size depends upon the size of the file system:
148 .Bl -tag -width "file system size" -compact -offset indent
149 .It Sy "file system size"
158 .It Fl g Ar avgfilesize
159 The expected average file size for the file system.
161 The expected average number of files per directory on the file system.
163 Do not require that the file system type listed in the disk label is
167 .It Fl i Ar bytes-per-inode
168 This specifies the density of inodes in the file system.
169 If fewer inodes are desired, a larger number should be used;
170 to create more inodes a smaller number should be given.
171 The default is to create an inode for every
175 .Bl -tag -width "file system size" -compact -offset indent
176 .It Sy "file system size"
185 .It Fl m Ar free-space
186 The percentage of space reserved from normal users; the minimum free
188 The default value used is 5%.
191 for more details on how to set this option.
193 Causes the file system parameters to be printed out
194 without really creating the file system.
196 This specifies the number of inodes for the filesystem.
204 .It Fl O Ar filesystem-format
205 Select the filesystem-format
206 .Bl -tag -width 3n -offset indent -compact
208 4.3BSD; This option is primarily used to build root file systems that can be
209 understood by older boot ROMs.
211 FFSv1; normal fast-filesystem (default).
212 This is also known as
218 FFSv2; enhanced fast-filesystem (suited for more than 1 Terabyte capacity,
219 access control lists).
220 This is also known as
223 To create an LFS filesystem see
225 To create a Linux Ext2 filesystem see
227 .It Fl o Ar optimization
228 Optimization preference; either
232 The file system can either be instructed to try to minimize the time spent
233 allocating blocks, or to try to minimize the space fragmentation on the disk.
234 If the value of minfree (see above) is less than 5%,
235 the default is to optimize for space;
236 if the value of minfree is greater than or equal to 5%,
237 the default is to optimize for time.
240 for more details on how to set this option.
242 The size of the file system in sectors.
245 suffix will be interpreted as the number of sectors (the default).
246 All other suffixes are interpreted as per other numeric arguments,
247 except that the number is converted into sectors by dividing by the
248 sector size (as specified by
250 after suffix interpretation.
254 is specified then the filesystem size defaults to that of the partition, or,
257 is specified, the existing file.
261 is negative the specified size is subtracted from the default size
262 (reserving space at the end of the partition).
263 .It Fl T Ar disk-type
264 Uses information for the specified disk from
266 instead of trying to get the information from the disk label.
268 This specifies that an Apple UFS filesystem should be created
269 with the given volume name.
271 This controls the amount of information written to stdout:
272 .Bl -tag -width 3n -offset indent -compact
276 Overall size and cylinder group details.
278 A progress bar (dots ending at right hand margin).
280 The first few super-block backup sector numbers are displayed before the
283 All the super-block backup sector numbers are displayed (no progress bar).
290 stops before outputting the progress bar.
292 Pre-zeros the file system image created with
294 This is necessary if the image is to be used by
296 (which doesn't support file systems with
300 The following option overrides the standard sizes for the disk geometry.
301 The default value is taken from the disk label.
302 Changing this default is useful only when using
304 to build a file system whose raw image will eventually be used on a
305 different type of disk than the one on which it is initially created
306 (for example on a write-once disk).
307 Note that changing this value from its default will make
310 to find the alternative superblocks if the standard superblock is lost.
312 .It Fl S Ar sector-size
313 The size of a sector in bytes (almost never anything but 512).
317 The file system is created with
319 inode generation numbers to improve NFS security.
321 The owner and group ids of the root node of the new file system
322 are set to the effective uid and gid of the user initializing
328 the disk label should first be updated such that the fstype field for the
339 To create and populate a filesystem image within a file use the
343 The partition size is found using
345 not by inspecting the disklabel.
346 The block size and fragment size will be written back to the disklabel
347 only if the last character of
349 references the same partition as the minor device number.
355 must be a raw device.
356 This means that for example
360 must be specified instead of
384 .%T A Fast File System for UNIX ,
385 .%J ACM Transactions on Computer Systems 2
389 .%O (reprinted in the BSD System Manager's Manual)
393 .%T Enhancements to the fast filesystem to support multi-terabyte storage systems
394 .%J Proceedings of the BSD Conference 2003