1 .\" $NetBSD: newfs_ext2fs.8,v 1.11 2010/02/25 13:09:17 tsutsui 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 ext2 file system
41 .Op Fl b Ar block-size
44 .Op Fl i Ar bytes-per-inode
45 .Op Fl m Ar free-space
47 .Op Fl O Ar filesystem-format
48 .Op Fl S Ar sector-size
55 is used to initialize and clear ext2 file systems before first use.
58 the disk must be labeled using
61 builds a file system on the specified special device
62 basing its defaults on the information in the disk label.
63 Typically the defaults are reasonable, however
65 has numerous options to allow the defaults to be selectively overridden.
67 Options with numeric arguments may contain an optional (case-insensitive)
69 .Bl -tag -width 3n -offset indent -compact
71 Bytes; causes no modification.
74 Kilo; multiply the argument by 1024.
76 Mega; multiply the argument by 1048576.
78 Giga; multiply the argument by 1073741824.
81 The following options define the general layout policies.
83 .It Fl b Ar block-size
84 The block size of the file system, in bytes.
85 It must be a power of two.
86 The smallest allowable size is 1024 bytes.
87 The default size depends upon the size of the file system:
89 .Bl -tag -width "file system size" -compact -offset indent
90 .It Sy "file system size"
99 Defaults to 128, and can also be set to 256 for
100 compatibility with ext4.
102 Create a file system image in
104 The file system size needs to be specified with
106 No attempts to use or update the disk label will be made.
107 .It Fl f Ar frag-size
108 The fragment size of the file system in bytes.
109 It must be the same with blocksize because the current ext2fs
110 implementation doesn't support fragmentation.
112 Do not require that the file system type listed in the disk label is
114 .It Fl i Ar bytes-per-inode
115 This specifies the density of inodes in the file system.
116 If fewer inodes are desired, a larger number should be used;
117 to create more inodes a smaller number should be given.
118 .It Fl m Ar free-space
119 The percentage of space reserved from normal users; the minimum free
121 The default value used is 5%.
123 Causes the file system parameters to be printed out
124 without really creating the file system.
126 This specifies the number of inodes for the file system.
134 The default number of inodes is calculated from a number of blocks in
136 .It Fl O Ar filesystem-format
137 Select the filesystem-format.
138 .Bl -tag -width 3n -offset indent -compact
141 this option is primarily used to build root file systems that can be
142 understood by old or dumb firmwares for bootstrap.
146 various extended (and sometimes incompatible) features are enabled
147 (though not all features are supported on
149 Currently only the following features are supported:
150 .Bl -tag -width "SPARSESUPER" -offset indent -compact
152 Prepare some reserved structures which enable future file system resizing.
154 Store file types in directory entries to improve performance.
156 Prepare superblock backups for the
158 utility on not all but sparse block groups.
160 Enable files larger than 2G bytes.
164 The size of the file system in sectors.
167 suffix will be interpreted as the number of sectors (the default).
168 All other suffixes are interpreted as per other numeric arguments,
169 except that the number is converted into sectors by dividing by the
170 sector size (as specified by
172 after suffix interpretation.
176 is specified then the filesystem size defaults to that of the partition, or,
179 is specified, the existing file.
183 is negative the specified size is subtracted from the default size
184 (reserving space at the end of the partition).
186 This controls the amount of information written to stdout:
187 .Bl -tag -width 3n -offset indent -compact
191 Overall size and cylinder group details.
193 A progress bar (dots ending at right hand margin).
195 The first few super-block backup sector numbers are displayed before the
198 All the super-block backup sector numbers are displayed (no progress bar).
205 stops before outputting the progress bar.
207 This specifies a volume name for the file system.
209 Pre-zeros the file system image created with
211 This is necessary if the image is to be used by
213 (which doesn't support file systems with
217 The following option overrides the standard sizes for the disk geometry.
218 The default value is taken from the disk label.
219 Changing this default is useful only when using
221 to build a file system whose raw image will eventually be used on a
222 different type of disk than the one on which it is initially created
223 (for example on a write-once disk).
224 Note that changing this value from its default will make it impossible for
226 to find the alternative superblocks if the standard superblock is lost.
228 .It Fl S Ar sector-size
229 The size of a sector in bytes (almost never anything but 512).
233 There is no option to specify the metadata byte order on the file system
234 to be created because the native ext2 file system is always little endian
235 even on big endian hosts.
237 The file system is created with
239 inode generation numbers to improve NFS security.
241 The owner and group IDs of the root node and reserved blocks of the new
242 file system are set to the effective UID and GID of the user initializing
248 the disk label should first be updated such that the fstype field for the
257 .\" To create and populate a filesystem image within a file use the
261 The partition size is found using
263 not by inspecting the disk label.
264 The block size and fragment size will be written back to the disk label
265 only if the last character of
267 references the same partition as the minor device number.
286 .%T "Design and Implementation of the Second Extended Filesystem"
287 .%J "The Proceedings of the First Dutch International Symposium on Linux"
288 .%U http://e2fsprogs.sourceforge.net/ext2intro.html
293 command first appeared in
298 command was written by
300 .Aq tsutsui@NetBSD.org .
304 command is still experimental and there are few sanity checks.
308 command doesn't have options to specify each REV1 file system feature
313 command doesn't support the bad block list accounted by the bad blocks inode.
315 Many newer ext2 file system features (especially journaling) are
318 Some features in file systems created by the
320 command might not be recognized properly by the
324 There is no native tool in the
326 distribution for resizing ext2 file systems yet.