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 "@E2FSPROGS_MONTH@ @E2FSPROGS_YEAR@" "E2fsprogs version @E2FSPROGS_VERSION@"
7 mke2fs \- create a Linux second extended file system
44 .I reserved-blocks-percentage
77 .I last-mounted-directory
94 @JDEV@.B "mke2fs \-O journal_dev"
99 .\" No external-journal specific journal options yet (size is ignored)
102 .\" @JDEV@.I journal-options
106 @JDEV@.I volume-label
117 @JDEV@.I external-journal
119 @JDEV@.I blocks-count
123 is used to create a Linux second extended file system on a device (usually
126 is the special file corresponding to the device (e.g
129 is the number of blocks on the device. If omitted,
131 automagically figures the file system size.
134 .BI \-b " block-size"
135 Specify the size of blocks in bytes. Valid block size vales are 1024,
136 2048 and 4096 bytes per block. If omitted,
138 block-size is determined by the file system size and the expected usage
139 of the filesystem (see the
144 Check the device for bad blocks before creating the file system. If
145 this option is specified twice, then a slower, destructive, read-write
146 test is used instead of a fast read-only test.
148 .BI \-f " fragment-size"
149 Specify the size of fragments in bytes.
154 to run, even if the specified device is not a
155 block special device, or appears to be mounted.
157 .BI \-i " bytes-per-inode"
158 Specify the bytes/inode ratio.
160 creates an inode for every
162 bytes of space on the disk. The larger the
164 ratio, the fewer inodes will be created. This value generally shouldn't
165 be smaller than the blocksize of the filesystem, since then too many
166 inodes will be made. Be warned that is not possible to expand the number
167 of inodes on a filesystem after it is created, so be careful deciding the
168 correct value for this parameter.
171 Create the filesystem with an ext3 journal. If the
173 option is not specified, the default journal parameters will be used to
174 create an appropriately sized journal (given the size of the filesystem)
175 stored within the filesystem. Note that you must be using a kernel
176 which has ext3 support in order to actually make use of the journal.
178 .BI \-J " journal-options"
179 Create the ext3 journal using options specified on the command-line.
180 Journal options are comma
181 separated, and may take an argument using the equals ('=') sign.
182 The following journal options are supported:
185 .BI size= journal-size
186 Create a journal stored in the filesystem of size
189 The size of the journal must be at least 1024 filesystem blocks
190 (i.e., 1MB if using 1k blocks, 4MB if using 4k blocks, etc.)
191 and may be no more than 102,400 filesystem blocks.
192 The journal must fit within the newly created filesystem.
194 @JDEV@.BI device= external-journal
195 @JDEV@Attach the filesystem to the journal block device located on
196 @JDEV@.IR external-journal .
198 @JDEV@journal must already have been created using the command
200 @JDEV@.B mke2fs -O journal_dev
201 @JDEV@.I external-journal
204 @JDEV@.I external-journal
205 @JDEV@must have been created with the
206 @JDEV@same block size as the new filesystem.
208 @JDEV@Instead of specifying a device name directly,
209 @JDEV@.I external-journal
210 @JDEV@can also be specified by either
211 @JDEV@.BI LABEL= label
214 @JDEV@to locate the external journal by either the volume label or UUID
215 @JDEV@stored in the ext2 superblock at the start of the journal. Use
216 @JDEV@.BR dumpe2fs (8)
217 @JDEV@to display a journal device's volume label and UUID. See also the
220 @JDEV@.BR tune2fs (8).
223 @JDEV@Only one of the
224 @JDEV@.BR size " or " device
225 @JDEV@options can be given for a filesystem.
228 Read the bad blocks list from
230 Note that the block numbers in the bad block list must be generated
231 using the same block size as used by mke2fs. As a result, the
235 is a much simpler and less error-prone method of checking a disk for bad
236 blocks before formatting it, as
238 will automatically pass the correct parameters to the
243 Set the volume label for the filesystem.
245 .BI \-m " reserved-blocks-percentage"
246 Specify the percentage of the filesystem blocks reserved for
247 the super-user. This value defaults to 5%.
250 Set the last mounted directory for the filesystem. This might be useful
251 for the sake of utilities that key off of the last mounted directory to
252 determine where the filesytem should be mounted.
255 causes mke2fs to not actually create a filesystem, but display what it
256 would do if it were to create a filesystem.
258 .BI \-N " number-of-inodes"
259 overrides the default calculation of the number of inodes that should be
260 reserved for the filesystem (which is based on the number of blocks and
263 ratio). This allows the user to specify the number
264 of desired inodes directly.
266 .BI \-o " creator-os"
267 Manually override the default value of the "creator os" field of the
268 filesystem. Normally the creator field is set by default to the native OS
273 .B "\-O \fIfeature\fR[,...]"
274 Create filesystem with given features (filesystem options).
279 features are turned on by default unless
281 is run on a system with a pre-2.2 Linux kernel. Filesystems that
282 may need to mounted on pre-2.2 kernels should be created with
286 for 1.2 kernels) which will disable these features, even if
288 is run on a system which can support them.
290 The following filesystem options are supported:
294 Create a filesystem with fewer superblock backup copies
295 (saves space on large filesystems).
298 Store file type information in directory entries.
301 Create an ext3 journal (as if using the
306 @JDEV@Create an external ext3 journal on the given device
307 @JDEV@instead of a regular ext2 filesystem.
309 @JDEV@.I external-journal
310 @JDEV@must be created with the same
311 @JDEV@block size as the filesystems that will be using it.
315 Quiet execution. Useful if
320 Set the filesystem revision for the new filesystem. Note that 1.2
321 kernels only support revision 0 filesystems. The default is to
322 create revision 1 filesystems.
324 .BI \-R " raid-options"
325 Set raid-related options for the filesystem. Raid options are comma
326 separated, and may take an argument using the equals ('=') sign. The
327 following options are supported:
330 .BI stride= stripe-size
331 Configure the filesystem for a RAID array with
333 filesystem blocks per stripe.
337 Write superblock and group descriptors only. This is useful if all of
338 the superblock and backup superblocks are corrupted, and a last-ditch
339 recovery method is desired. It causes
342 superblock and group descriptors, while not touching the inode table
343 and the block and inode bitmaps. The
345 program should be run immediately after this option is used, and there
346 is no guarantee that any data will be salvageable. It is critical to
347 specify the correct filesystem blocksize when using this option,
348 or there is no chance of recovery.
351 .\" Check the device for bad blocks before creating the file system
352 .\" using the specified test.
355 Specify how the filesystem is going to be used, so that mke2fs can
356 chose optimal filesystem parameters for that use. The supported
357 filesystem types are:
361 one inode per 4kb block
364 one inode per megabyte
367 one inode per 4 megabytes
374 Print the version number of
380 has been written by Theodore Ts'o <tytso@mit.edu>.
385 option but currently ignores it because the second
386 extended file system does not support fragments yet.
388 There may be other ones. Please, report them to the author.
391 is part of the e2fsprogs package and is available from
392 http://e2fsprogs.sourceforge.net.