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