]> git.ipfire.org Git - thirdparty/e2fsprogs.git/blame - misc/mke2fs.8.in
ChangeLog, mke2fs.c:
[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
TT
6.SH NAME
7mke2fs \- create a Linux second extended file system
8.SH SYNOPSIS
9.B mke2fs
10[
11.B \-c
12|
13.\" .B \-t
caf8ce4c 14.\" .I test
3839e657
TT
15.\" |
16.B \-l
1e3472c5 17.I filename
3839e657
TT
18]
19[
20.B \-b
1e3472c5 21.I block-size
3839e657
TT
22]
23[
24.B \-f
1e3472c5 25.I fragment-size
3839e657
TT
26]
27[
28.B \-i
1e3472c5 29.I bytes-per-inode
3839e657
TT
30]
31[
85ef4ae8 32.B \-j
dc2ec525
TT
33]
34[
35.B \-J
8ddaa66b 36.I journal-options
85ef4ae8
TT
37]
38[
5515e6b4
TT
39.B \-N
40.I number-of-inodes
41]
42[
2740156b
TT
43.B -n
44]
45[
3839e657 46.B \-m
1e3472c5
TT
47.I reserved-blocks-percentage
48]
49[
50.B \-o
51.I creator-os
3839e657
TT
52]
53[
896938d5
TT
54.B \-O
55.IR feature [,...]
56]
57[
f3db3566
TT
58.B \-q
59]
60[
caf8ce4c
TT
61.B \-r
62.I fs-revision-level
a29f4d30
TT
63]
64[
caf8ce4c
TT
65.B \-R
66.I raid_options
a29f4d30
TT
67]
68[
caf8ce4c
TT
69.B \-s
70.I sparse-super-flag
521e3685
TT
71]
72[
3839e657
TT
73.B \-v
74]
f3db3566 75[
74becf3c
TT
76.B \-F
77]
78[
1e3472c5
TT
79.B \-L
80.I volume-label
81]
82[
83.B \-M
84.I last-mounted-directory
85]
86[
f3db3566
TT
87.B \-S
88]
818180cd 89[
50787ea2
TT
90.B \-T
91.I filesystem-type
92]
93[
818180cd
TT
94.B \-V
95]
1e3472c5 96.I device
3839e657 97[
1e3472c5 98.I blocks-count
3839e657
TT
99]
100.SH DESCRIPTION
101.B mke2fs
102is used to create a Linux second extended file system on a device (usually
103a disk partition).
3839e657 104.I device
caf8ce4c
TT
105is the special file corresponding to the device (e.g
106.IR /dev/hdXX ).
3839e657
TT
107.I blocks-count
108is the number of blocks on the device. If omitted,
109.B mke2fs
110automagically figures the file system size.
111.SH OPTIONS
112.TP
caf8ce4c 113.BI \-b " block-size"
2740156b 114Specify the size of blocks in bytes. Valid block size vales are 1024,
06968e7e
TT
1152048 and 4096 bytes per block. If omitted,
116.B mke2fs
117block-size is determined by the file system size and the expected usage
118of the filesystem (see the
119.B \-T
120option).
3839e657 121.TP
caf8ce4c 122.B \-c
3839e657
TT
123Check the device for bad blocks before creating the file system, using a
124fast read-only test.
125.TP
caf8ce4c 126.BI \-f " fragment-size"
3839e657
TT
127Specify the size of fragments in bytes.
128.TP
caf8ce4c 129.BI \-i " bytes-per-inode"
3839e657
TT
130Specify the bytes/inode ratio.
131.B mke2fs
132creates an inode for every
133.I bytes-per-inode
50787ea2 134bytes of space on the disk.
caf8ce4c
TT
135The larger the
136.I bytes-per-inode
137ratio, the fewer inodes will be created.
50787ea2
TT
138This value generally shouldn't be smaller than
139the blocksize of the filesystem, since then too many inodes will be made.
140Be warned that is not possible to expand the number of inodes on a
dc2ec525 141filesystem after it is created, so be careful deciding the correct
50787ea2 142value for this parameter.
dc2ec525
TT
143.TP
144.B -j
85ef4ae8 145Build the ext2 filesystem with the ext3 journaling feature enabled.
dc2ec525
TT
146If the
147.B \-J
148option is not specified, the default journal parameters will used will create
149an appropriately sized journal (given the size of the filesystem)
150stored internally in the filesystem.
151.TP
152.BI \-J " journal options"
153Create the ext3 journal using options specified on the command-line.
8ddaa66b
TT
154Journal options are comma
155separated, and may take an argument using the equals ('=') sign.
dc2ec525 156Currently two (mutually exclusive) options are supported,
8ddaa66b
TT
157.I size
158and
159.IR device .
dc2ec525
TT
160.TP
161.BI "\-J size=" journal-size
162Create a journal stored in the filesystem of size
163.IR journal-size .
2537b6d0
TT
164The size of the journal must be at least 1024 filesystem blocks
165(i.e., 1MB if using 1k blocks, 4MB if using 4k blocks, etc.)
166and may be no more than 10,240 filesystem blocks.
167The journal must fit within the newly created filesystem.
dc2ec525
TT
168.TP
169.BI "\-J device=" external-journal
170Add an external journal found on a block device
171named by
172.I external-journal
173to the filesystem.
174The external
175journal must have been already created using the command
176.B mke2fs -O journal_dev
177.IR journal-device.
85ef4ae8 178.TP
caf8ce4c 179.B \-n
2740156b
TT
180causes mke2fs to not actually create a filesystem, but display what it
181would do if it were to create a filesystem.
182.TP
caf8ce4c 183.BI \-N " number-of-inodes"
5515e6b4
TT
184overrides the default calculation of the number of inodes that should be
185reserved for the filesystem (which is based on the number of blocks and
caf8ce4c
TT
186the
187.I bytes-per-inode
188ratio). This allows the user to specify the number
5515e6b4
TT
189of desired inodes directly.
190.TP
896938d5
TT
191.BI \-O " feature\fR[,...]"
192Create the filesystem with the listed set of features
193(filesystem options). The following features are supported:
6fdc7a32 194.IR sparse_super ,
896938d5
TT
195which cause the filesystem to use sparse superblocks, and
196.IR filetype ,
197which will cause the filesystem to store file type information in
198directory entries. Currently, both features are turned on by default
199unless
200.B mke2fs
201is run on a system with a pre-2.2 Linux kernel.
202.B Warning:
203Pre-2.2 Linux kernels do not properly
204support the filesystems that use either of these two features. Filesystems
205that may need to mounted on pre-2.2 kernels should be created with
206.B -O
207.I none
208which will disable both of these features, even if
209.B mke2fs
210is run on a system which can support these features.
211.TP
caf8ce4c 212.BI \-l " filename"
3839e657 213Read the bad blocks list from
583ccdc3 214.I filename.
3839e657
TT
215\.
216.TP
caf8ce4c 217.BI -m " reserved-blocks-percentage"
3839e657
TT
218Specify the percentage of reserved blocks for the super-user. This value
219defaults to 5%.
220.\" .TP
caf8ce4c 221.\" .BI \-t " test"
3839e657
TT
222.\" Check the device for bad blocks before creating the file system
223.\" using the specified test.
224.TP
caf8ce4c 225.B \-o
1e3472c5
TT
226Manually override the default value of the "creator os" field of the
227filesystem. Normally the creator field is set by default to the native OS
583ccdc3
TT
228of the
229.B mke2fs
230executable.
1e3472c5 231.TP
caf8ce4c 232.B \-q
583ccdc3
TT
233Quiet execution. Useful if
234.B mke2fs
235is run in a script.
f3db3566 236.TP
caf8ce4c
TT
237.BI \-s " sparse-super-flag"
238If
239.I sparse-super-flag
240is 1, then turn on the sparse superblock flag in the superblock.
896938d5
TT
241.B Note:
242This option is deprecated; use the
243.B \-O
244option instead.
521e3685 245.TP
caf8ce4c 246.B \-v
3839e657 247Verbose execution.
7f88b043 248.TP
caf8ce4c 249.B \-F
583ccdc3
TT
250Force
251.B mke2fs
252to run, even if the specified device is not a
ca3c3285 253block special device, or appears to be mounted.
f3db3566 254.TP
caf8ce4c 255.B \-L
1e3472c5
TT
256Set the volume label for the filesystem.
257.TP
caf8ce4c 258.B \-M
1e3472c5
TT
259Set the last mounted directory for the filesystem. This might be useful
260for the sake of utilities that key off of the last mounted directory to
261determine where the filesytem should be mounted.
262.TP
caf8ce4c 263.BI -r " revision"
a29f4d30
TT
264Set the filesystem revision for the new filesystem. Note that 1.2
265kernels only support revision 0 filesystems.
266.TP
caf8ce4c 267.BI \-R " raid_options"
cb620174 268Set raid-related options for the filesystem. Raid options are comma
a29f4d30
TT
269separated, and may take an argument using the equals ('=') sign.
270Currently the only supported argument is
271.I stride
272which takes as its argument the number of blocks in a RAID stripe.
273.TP
caf8ce4c 274.B \-S
f3db3566
TT
275Write superblock and group descriptors only. This is useful if all of
276the superblock and backup superblocks are corrupted, and a last-ditch
583ccdc3
TT
277recovery method is desired. It causes
278.B mke2fs
279to reinitialize the
f3db3566
TT
280superblock and group descriptors, while not touching the inode table
281and the block and inode bitmaps. The
282.B e2fsck
283program should be run immediately after this option is used, and there
7f88b043 284is no guarantee that any data will be salvageable.
818180cd 285.TP
caf8ce4c 286.BI \-T " fs-type"
50787ea2 287Specify how the filesystem is going to be used, so that mke2fs can
44c09c04
TT
288chose optimal filesystem parameters for that use. The only
289currently supported filesystem types are:
290.BR news ,
291which reserves space for one inode per 4kb block,
292.BR largefile
293which allocates one inode per megabyte, and
294.BR largefile4
295which allocates one inode per 4 megabytes.
50787ea2 296.TP
caf8ce4c 297.B \-V
50787ea2 298Print the version number of
818180cd
TT
299.B mke2fs
300and exit.
3839e657
TT
301.SH AUTHOR
302This version of
303.B mke2fs
a418d3ad 304has been written by Theodore Ts'o <tytso@mit.edu>.
3839e657
TT
305.SH BUGS
306.B mke2fs
caf8ce4c
TT
307accepts the
308.B \-f
309option but currently ignores it because the second
3839e657
TT
310extended file system does not support fragments yet.
311.br
312There may be some other ones. Please, report them to the author.
313.SH AVAILABILITY
314.B mke2fs
a789d840
TT
315is part of the e2fsprogs package and is available for anonymous
316ftp from tsx-11.mit.edu in /pub/linux/packages/ext2fs.
3839e657 317.SH SEE ALSO
e72a9ba3 318.BR badblocks (8),
3839e657
TT
319.BR dumpe2fs (8),
320.BR e2fsck (8),
321.BR tune2fs (8)