]> git.ipfire.org Git - thirdparty/e2fsprogs.git/blame - misc/mke2fs.8.in
Fix bug where mke2fs was incorrectly checking
[thirdparty/e2fsprogs.git] / misc / mke2fs.8.in
CommitLineData
3839e657 1.\" -*- nroff -*-
a418d3ad
TT
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.
4.\"
74becf3c 5.TH MKE2FS 8 "@E2FSPROGS_MONTH@ @E2FSPROGS_YEAR@" "E2fsprogs version @E2FSPROGS_VERSION@"
3839e657 6.SH NAME
f0865ce4 7mke2fs \- create an ext2/3 filesystem
3839e657
TT
8.SH SYNOPSIS
9.B mke2fs
10[
11.B \-c
12|
3839e657 13.B \-l
1e3472c5 14.I filename
3839e657
TT
15]
16[
17.B \-b
1e3472c5 18.I block-size
3839e657
TT
19]
20[
21.B \-f
1e3472c5 22.I fragment-size
3839e657
TT
23]
24[
25.B \-i
1e3472c5 26.I bytes-per-inode
3839e657
TT
27]
28[
85ef4ae8 29.B \-j
dc2ec525
TT
30]
31[
32.B \-J
8ddaa66b 33.I journal-options
85ef4ae8
TT
34]
35[
5515e6b4
TT
36.B \-N
37.I number-of-inodes
38]
39[
2740156b
TT
40.B -n
41]
42[
3839e657 43.B \-m
1e3472c5
TT
44.I reserved-blocks-percentage
45]
46[
47.B \-o
48.I creator-os
3839e657
TT
49]
50[
896938d5
TT
51.B \-O
52.IR feature [,...]
53]
54[
f3db3566
TT
55.B \-q
56]
57[
caf8ce4c
TT
58.B \-r
59.I fs-revision-level
a29f4d30
TT
60]
61[
caf8ce4c 62.B \-R
48015ced 63.I raid-options
521e3685
TT
64]
65[
3839e657
TT
66.B \-v
67]
f3db3566 68[
74becf3c
TT
69.B \-F
70]
71[
1e3472c5
TT
72.B \-L
73.I volume-label
74]
75[
76.B \-M
77.I last-mounted-directory
78]
79[
f3db3566
TT
80.B \-S
81]
818180cd 82[
50787ea2
TT
83.B \-T
84.I filesystem-type
85]
86[
818180cd
TT
87.B \-V
88]
1e3472c5 89.I device
3839e657 90[
1e3472c5 91.I blocks-count
3839e657 92]
48015ced 93@JDEV@.sp
8d641749 94@JDEV@.B "mke2fs \-O journal_dev"
48015ced
TT
95@JDEV@[
96@JDEV@.B \-b
97@JDEV@.I block-size
98@JDEV@]
8d641749 99.\" No external-journal specific journal options yet (size is ignored)
48015ced
TT
100.\" @JDEV@[
101.\" @JDEV@.B \-J
102.\" @JDEV@.I journal-options
103.\" @JDEV@]
104@JDEV@[
105@JDEV@.B \-L
106@JDEV@.I volume-label
107@JDEV@]
108@JDEV@[
109@JDEV@.B \-n
110@JDEV@]
111@JDEV@[
112@JDEV@.B \-q
113@JDEV@]
114@JDEV@[
115@JDEV@.B \-v
116@JDEV@]
8d641749 117@JDEV@.I external-journal
2d15576d
AD
118@JDEV@[
119@JDEV@.I blocks-count
120@JDEV@]
3839e657
TT
121.SH DESCRIPTION
122.B mke2fs
f0865ce4 123is used to create an ext2/ext3 filesystem (usually in a disk partition).
3839e657 124.I device
caf8ce4c
TT
125is the special file corresponding to the device (e.g
126.IR /dev/hdXX ).
3839e657
TT
127.I blocks-count
128is the number of blocks on the device. If omitted,
129.B mke2fs
0072f8de
AD
130automagically figures the file system size. If called as
131.B mkfs.ext3
132a journal is created as if the
133.B \-j
134option was specified.
3839e657
TT
135.SH OPTIONS
136.TP
caf8ce4c 137.BI \-b " block-size"
2740156b 138Specify the size of blocks in bytes. Valid block size vales are 1024,
06968e7e
TT
1392048 and 4096 bytes per block. If omitted,
140.B mke2fs
141block-size is determined by the file system size and the expected usage
142of the filesystem (see the
143.B \-T
144option).
3839e657 145.TP
caf8ce4c 146.B \-c
3ed57c27
TT
147Check the device for bad blocks before creating the file system. If
148this option is specified twice, then a slower, destructive, read-write
149test is used instead of a fast read-only test.
3839e657 150.TP
caf8ce4c 151.BI \-f " fragment-size"
3839e657
TT
152Specify the size of fragments in bytes.
153.TP
48015ced
TT
154.B \-F
155Force
156.B mke2fs
157to run, even if the specified device is not a
158block special device, or appears to be mounted.
159.TP
caf8ce4c 160.BI \-i " bytes-per-inode"
3839e657
TT
161Specify the bytes/inode ratio.
162.B mke2fs
163creates an inode for every
164.I bytes-per-inode
48015ced 165bytes of space on the disk. The larger the
caf8ce4c 166.I bytes-per-inode
48015ced
TT
167ratio, the fewer inodes will be created. This value generally shouldn't
168be smaller than the blocksize of the filesystem, since then too many
169inodes will be made. Be warned that is not possible to expand the number
170of inodes on a filesystem after it is created, so be careful deciding the
171correct value for this parameter.
dc2ec525 172.TP
48015ced
TT
173.B \-j
174Create the filesystem with an ext3 journal. If the
dc2ec525 175.B \-J
48015ced
TT
176option is not specified, the default journal parameters will be used to
177create an appropriately sized journal (given the size of the filesystem)
178stored within the filesystem. Note that you must be using a kernel
179which has ext3 support in order to actually make use of the journal.
dc2ec525 180.TP
48015ced 181.BI \-J " journal-options"
dc2ec525 182Create the ext3 journal using options specified on the command-line.
8ddaa66b
TT
183Journal options are comma
184separated, and may take an argument using the equals ('=') sign.
48015ced
TT
185The following journal options are supported:
186.RS 1.2i
dc2ec525 187.TP
48015ced 188.BI size= journal-size
f0865ce4 189Create an internal journal (i.e., stored inside the filesystem) of size
8d641749
TT
190.I journal-size
191megabytes.
2537b6d0
TT
192The size of the journal must be at least 1024 filesystem blocks
193(i.e., 1MB if using 1k blocks, 4MB if using 4k blocks, etc.)
8d641749 194and may be no more than 102,400 filesystem blocks.
48015ced
TT
195@JDEV@.TP
196@JDEV@.BI device= external-journal
8d641749
TT
197@JDEV@Attach the filesystem to the journal block device located on
198@JDEV@.IR external-journal .
199@JDEV@The external
200@JDEV@journal must already have been created using the command
201@JDEV@.IP
2d15576d
AD
202@JDEV@.B mke2fs -O journal_dev
203@JDEV@.I external-journal
8d641749
TT
204@JDEV@.IP
205@JDEV@Note that
206@JDEV@.I external-journal
207@JDEV@must have been created with the
208@JDEV@same block size as the new filesystem.
2d15576d
AD
209@JDEV@.IP
210@JDEV@Instead of specifying a device name directly,
211@JDEV@.I external-journal
212@JDEV@can also be specified by either
213@JDEV@.BI LABEL= label
214@JDEV@or
215@JDEV@.BI UUID= UUID
216@JDEV@to locate the external journal by either the volume label or UUID
217@JDEV@stored in the ext2 superblock at the start of the journal. Use
218@JDEV@.BR dumpe2fs (8)
219@JDEV@to display a journal device's volume label and UUID. See also the
220@JDEV@.B -L
221@JDEV@option of
222@JDEV@.BR tune2fs (8).
8d641749
TT
223.RE
224@JDEV@.IP
48015ced
TT
225@JDEV@Only one of the
226@JDEV@.BR size " or " device
227@JDEV@options can be given for a filesystem.
48015ced
TT
228.TP
229.BI \-l " filename"
230Read the bad blocks list from
3ed57c27
TT
231.IR filename .
232Note that the block numbers in the bad block list must be generated
233using the same block size as used by mke2fs. As a result, the
234.B \-c
235option to
236.B mke2fs
237is a much simpler and less error-prone method of checking a disk for bad
238blocks before formatting it, as
239.B mke2fs
240will automatically pass the correct parameters to the
241.B badblocks
242program.
48015ced
TT
243.TP
244.B \-L
245Set the volume label for the filesystem.
246.TP
247.BI \-m " reserved-blocks-percentage"
248Specify the percentage of the filesystem blocks reserved for
249the super-user. This value defaults to 5%.
dc2ec525 250.TP
48015ced
TT
251.B \-M
252Set the last mounted directory for the filesystem. This might be useful
253for the sake of utilities that key off of the last mounted directory to
254determine where the filesytem should be mounted.
85ef4ae8 255.TP
caf8ce4c 256.B \-n
1f22ce34
TT
257causes mke2fs to not actually create a filesystem, but display what it
258would do if it were to create a filesystem. This can be used to
259determine the location of the backup superblocks for a particular
260filesystem, so long as the mke2fs parameters that were passed when the
261filesystem was originally created are used again. (With the
262.B \-n
263option added, of course!)
2740156b 264.TP
caf8ce4c 265.BI \-N " number-of-inodes"
5515e6b4
TT
266overrides the default calculation of the number of inodes that should be
267reserved for the filesystem (which is based on the number of blocks and
caf8ce4c
TT
268the
269.I bytes-per-inode
270ratio). This allows the user to specify the number
5515e6b4
TT
271of desired inodes directly.
272.TP
48015ced 273.BI \-o " creator-os"
1e3472c5
TT
274Manually override the default value of the "creator os" field of the
275filesystem. Normally the creator field is set by default to the native OS
583ccdc3
TT
276of the
277.B mke2fs
278executable.
1e3472c5 279.TP
8d641749 280.B "\-O \fIfeature\fR[,...]"
82b39c9f
TT
281Create filesystem with given features (filesystem options). Features
282which are normally turned on by default may be disabled by prefixing the
283feature with a caret ('^') symbol.
48015ced
TT
284Currently, the
285.B sparse_super
286and
287.B filetype
f0865ce4 288features are turned on by default when
583ccdc3 289.B mke2fs
f0865ce4
TT
290is run on a system with Linux 2.2 or later (unless creator-os is set to
291the Hurd). Filesystems that may need to be mounted on pre-2.2 Linux or
292other kernels should be created with
48015ced
TT
293.B "\-O none"
294(or
295.B "\-r 0"
f0865ce4 296for Linux 1.2) which will disable these features, even if
48015ced
TT
297.B mke2fs
298is run on a system which can support them.
299.sp
300The following filesystem options are supported:
301.RS 1.2i
7f88b043 302.TP
ccbed85a
TT
303.B dir_index
304Use hashed b-trees to speed up lookups in large directories.
f3db3566 305.TP
48015ced
TT
306.B filetype
307Store file type information in directory entries.
1e3472c5 308.TP
48015ced
TT
309.B has_journal
310Create an ext3 journal (as if using the
311.B \-j
312option).
313@JDEV@.TP
8d641749 314@JDEV@.B journal_dev
48015ced 315@JDEV@Create an external ext3 journal on the given device
8d641749
TT
316@JDEV@instead of a regular ext2 filesystem.
317@JDEV@Note that
318@JDEV@.I external-journal
319@JDEV@must be created with the same
320@JDEV@block size as the filesystems that will be using it.
ccbed85a
TT
321.TP
322.B sparse_super
323Create a filesystem with fewer superblock backup copies
324(saves space on large filesystems).
48015ced 325.RE
1e3472c5 326.TP
8d641749
TT
327.B \-q
328Quiet execution. Useful if
329.B mke2fs
330is run in a script.
331.TP
48015ced 332.BI \-r " revision"
a29f4d30 333Set the filesystem revision for the new filesystem. Note that 1.2
48015ced
TT
334kernels only support revision 0 filesystems. The default is to
335create revision 1 filesystems.
a29f4d30 336.TP
48015ced 337.BI \-R " raid-options"
cb620174 338Set raid-related options for the filesystem. Raid options are comma
8d641749 339separated, and may take an argument using the equals ('=') sign. The
48015ced
TT
340following options are supported:
341.RS 1.2i
342.TP
343.BI stride= stripe-size
344Configure the filesystem for a RAID array with
8d641749 345.I stripe-size
48015ced
TT
346filesystem blocks per stripe.
347.RE
348.TP
caf8ce4c 349.B \-S
f3db3566
TT
350Write superblock and group descriptors only. This is useful if all of
351the superblock and backup superblocks are corrupted, and a last-ditch
583ccdc3
TT
352recovery method is desired. It causes
353.B mke2fs
354to reinitialize the
f3db3566
TT
355superblock and group descriptors, while not touching the inode table
356and the block and inode bitmaps. The
357.B e2fsck
358program should be run immediately after this option is used, and there
48015ced
TT
359is no guarantee that any data will be salvageable. It is critical to
360specify the correct filesystem blocksize when using this option,
361or there is no chance of recovery.
8d641749
TT
362.\" .TP
363.\" .BI \-t " test"
364.\" Check the device for bad blocks before creating the file system
365.\" using the specified test.
818180cd 366.TP
caf8ce4c 367.BI \-T " fs-type"
50787ea2 368Specify how the filesystem is going to be used, so that mke2fs can
48015ced
TT
369chose optimal filesystem parameters for that use. The supported
370filesystem types are:
371.RS 1.2i
372.TP 1.2i
373news
374one inode per 4kb block
375.TP
376largefile
377one inode per megabyte
378.TP
379largefile4
380one inode per 4 megabytes
381.RE
382.TP
383.B \-v
384Verbose execution.
50787ea2 385.TP
caf8ce4c 386.B \-V
50787ea2 387Print the version number of
818180cd
TT
388.B mke2fs
389and exit.
3839e657
TT
390.SH AUTHOR
391This version of
392.B mke2fs
a418d3ad 393has been written by Theodore Ts'o <tytso@mit.edu>.
3839e657
TT
394.SH BUGS
395.B mke2fs
caf8ce4c
TT
396accepts the
397.B \-f
398option but currently ignores it because the second
3839e657
TT
399extended file system does not support fragments yet.
400.br
48015ced 401There may be other ones. Please, report them to the author.
3839e657
TT
402.SH AVAILABILITY
403.B mke2fs
12da49c9 404is part of the e2fsprogs package and is available from
348e43dc 405http://e2fsprogs.sourceforge.net.
3839e657 406.SH SEE ALSO
e72a9ba3 407.BR badblocks (8),
3839e657
TT
408.BR dumpe2fs (8),
409.BR e2fsck (8),
410.BR tune2fs (8)