2 .\" Copyright 1993, 1994, 1995 by Theodore Ts'o. All Rights Reserved.
3 .\" This file may be copied under the terms of the GNU Public License.
5 .TH MKE2FS 8 "May 2006" "E2fsprogs version 1.39"
7 mke2fs \- create an ext2/ext3 filesystem
48 .I reserved-blocks-percentage
81 .I last-mounted-directory
98 .B "mke2fs \-O journal_dev"
103 .\" No external-journal specific journal options yet (size is ignored)
106 .\" .I journal-options
127 is used to create an ext2/ext3 filesystem (usually in a disk partition).
129 is the special file corresponding to the device (e.g
132 is the number of blocks on the device. If omitted,
134 automagically figures the file system size. If called as
136 a journal is created as if the
138 option was specified.
141 .BI \-b " block-size"
142 Specify the size of blocks in bytes. Valid block size vales are 1024,
143 2048 and 4096 bytes per block. If omitted,
145 block-size is heuristically determined by the file system size and
146 the expected usage of the filesystem (see the
152 will use heuristics to determine the
153 appropriate block size, with the constraint that the block size will be
156 bytes. This is useful for certain hardware devices which require that
157 the blocksize be a multiple of 2k.
160 Check the device for bad blocks before creating the file system. If
161 this option is specified twice, then a slower, read-write
162 test is used instead of a fast read-only test.
164 .BI \-E " extended-options"
165 Set extended options for the filesystem. Extended options are comma
166 separated, and may take an argument using the equals ('=') sign. The
170 in earlier versions of
174 option is still accepted for backwards compatibility. The
175 following extended options are supported:
178 .BI stride= stripe-size
179 Configure the filesystem for a RAID array with
181 filesystem blocks per stripe.
183 .BI resize= max-online-resize
184 Reserve enough space so that the block group descriptor table can grow
185 to support a filesystem that has max-online-resize blocks.
188 .BI \-f " fragment-size"
189 Specify the size of fragments in bytes.
194 to run, even if the specified device is not a
195 block special device, or appears to be mounted.
197 .BI \-g " blocks-per-group"
198 Specify the number of blocks in a block group. There is generally no
199 reason the user to ever set this parameter, as the default is optimal
200 for the filesystem. (For administrators who are creating
201 filesystems on RAID arrays, it is preferable to use the
203 RAID parameter as part of the
205 option rather than manipulating the number of blocks per group.)
206 This option is generally used by developers who
207 are developing test cases.
209 .BI \-i " bytes-per-inode"
210 Specify the bytes/inode ratio.
212 creates an inode for every
214 bytes of space on the disk. The larger the
216 ratio, the fewer inodes will be created. This value generally shouldn't
217 be smaller than the blocksize of the filesystem, since then too many
218 inodes will be made. Be warned that is not possible to expand the number
219 of inodes on a filesystem after it is created, so be careful deciding the
220 correct value for this parameter.
223 Create the filesystem with an ext3 journal. If the
225 option is not specified, the default journal parameters will be used to
226 create an appropriately sized journal (given the size of the filesystem)
227 stored within the filesystem. Note that you must be using a kernel
228 which has ext3 support in order to actually make use of the journal.
230 .BI \-J " journal-options"
231 Create the ext3 journal using options specified on the command-line.
232 Journal options are comma
233 separated, and may take an argument using the equals ('=') sign.
234 The following journal options are supported:
237 .BI size= journal-size
238 Create an internal journal (i.e., stored inside the filesystem) of size
241 The size of the journal must be at least 1024 filesystem blocks
242 (i.e., 1MB if using 1k blocks, 4MB if using 4k blocks, etc.)
243 and may be no more than 102,400 filesystem blocks.
245 .BI device= external-journal
246 Attach the filesystem to the journal block device located on
247 .IR external-journal .
249 journal must already have been created using the command
251 .B mke2fs -O journal_dev
256 must have been created with the
257 same block size as the new filesystem.
258 In addition, while there is support for attaching
259 multiple filesystems to a single external journal,
262 do not currently support shared external journals yet.
264 Instead of specifying a device name directly,
266 can also be specified by either
270 to locate the external journal by either the volume label or UUID
271 stored in the ext2 superblock at the start of the journal. Use
273 to display a journal device's volume label and UUID. See also the
280 .BR size " or " device
281 options can be given for a filesystem.
284 Read the bad blocks list from
286 Note that the block numbers in the bad block list must be generated
287 using the same block size as used by mke2fs. As a result, the
291 is a much simpler and less error-prone method of checking a disk for bad
292 blocks before formatting it, as
294 will automatically pass the correct parameters to the
298 .BI \-L " new-volume-label"
299 Set the volume label for the filesystem to
300 .IR new-volume-label .
301 The maximum length of the
302 volume label is 16 bytes.
304 .BI \-m " reserved-blocks-percentage"
305 Specify the percentage of the filesystem blocks reserved for
306 the super-user. This avoids fragmentation, and allows root-owned
309 to continue to function correctly after non-privileged processes are
310 prevented from writing to the filesystem. The default percentage
314 Set the last mounted directory for the filesystem. This might be useful
315 for the sake of utilities that key off of the last mounted directory to
316 determine where the filesystem should be mounted.
319 causes mke2fs to not actually create a filesystem, but display what it
320 would do if it were to create a filesystem. This can be used to
321 determine the location of the backup superblocks for a particular
322 filesystem, so long as the mke2fs parameters that were passed when the
323 filesystem was originally created are used again. (With the
325 option added, of course!)
327 .BI \-N " number-of-inodes"
328 overrides the default calculation of the number of inodes that should be
329 reserved for the filesystem (which is based on the number of blocks and
332 ratio). This allows the user to specify the number
333 of desired inodes directly.
335 .BI \-o " creator-os"
336 Manually override the default value of the "creator os" field of the
337 filesystem. Normally the creator field is set by default to the native OS
342 .B "\-O \fIfeature\fR[,...]"
343 Create filesystem with given features (filesystem options), overriding
344 the default filesystem options. The default features which are
345 enabled by default are specified by the
347 relation, either in the
351 configuration file, or in the subsection of the
353 section for the filesystem type as specified by the
355 option. The filesystem type-specific configuration setting found in
358 section will override the global default found in
361 The filesystem feature set will be further edited
362 using either the feature set specification specified by this option,
363 or if this option is not specified, by the
365 relation for the filesystem type being created, or in the
367 section of the configuration file.
369 The filesystem feature set is comprised of a list of features, separated
370 by commas, that are to be enabled. To disable a feature, simply
371 prefix the feature name with a caret ('^') character. The
372 pseudo-filesystem feature "none" will clear all filesystem features.
376 Use hashed b-trees to speed up lookups in large directories.
379 Store file type information in directory entries.
382 Create an ext3 journal (as if using the
387 Create an external ext3 journal on the given device
388 instead of a regular ext2 filesystem.
391 must be created with the same
392 block size as the filesystems that will be using it.
395 Reserve space so the block group descriptor table may grow in the future.
396 Useful for online resizing using
400 will attempt to reserve enough space so that the
401 filesystem may grow to 1024 times its initial size. This can be changed
407 Create a filesystem with fewer superblock backup copies
408 (saves space on large filesystems).
412 Quiet execution. Useful if
417 Set the filesystem revision for the new filesystem. Note that 1.2
418 kernels only support revision 0 filesystems. The default is to
419 create revision 1 filesystems.
422 Write superblock and group descriptors only. This is useful if all of
423 the superblock and backup superblocks are corrupted, and a last-ditch
424 recovery method is desired. It causes
427 superblock and group descriptors, while not touching the inode table
428 and the block and inode bitmaps. The
430 program should be run immediately after this option is used, and there
431 is no guarantee that any data will be salvageable. It is critical to
432 specify the correct filesystem blocksize when using this option,
433 or there is no chance of recovery.
436 .\" Check the device for bad blocks before creating the file system
437 .\" using the specified test.
440 Specify how the filesystem is going to be used, so that
442 can choose optimal filesystem parameters for that use. The filesystem
443 types that are can be supported are defined in the configuration file
444 .BR /etc/mke2fs.conf (5).
445 The default configuration file contains definitions for the filesystem
446 types: small, floppy, news, largefile, and largefile4.
452 Print the version number of
458 has been written by Theodore Ts'o <tytso@mit.edu>.
463 option but currently ignores it because the second
464 extended file system does not support fragments yet.
466 There may be other ones. Please, report them to the author.
469 is part of the e2fsprogs package and is available from
470 http://e2fsprogs.sourceforge.net.