]>
Commit | Line | Data |
---|---|---|
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 | 7 | mke2fs \- 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 | 123 | is used to create an ext2/ext3 filesystem (usually in a disk partition). |
3839e657 | 124 | .I device |
caf8ce4c TT |
125 | is the special file corresponding to the device (e.g |
126 | .IR /dev/hdXX ). | |
3839e657 TT |
127 | .I blocks-count |
128 | is the number of blocks on the device. If omitted, | |
129 | .B mke2fs | |
0072f8de AD |
130 | automagically figures the file system size. If called as |
131 | .B mkfs.ext3 | |
132 | a journal is created as if the | |
133 | .B \-j | |
134 | option was specified. | |
3839e657 TT |
135 | .SH OPTIONS |
136 | .TP | |
caf8ce4c | 137 | .BI \-b " block-size" |
2740156b | 138 | Specify the size of blocks in bytes. Valid block size vales are 1024, |
06968e7e TT |
139 | 2048 and 4096 bytes per block. If omitted, |
140 | .B mke2fs | |
141 | block-size is determined by the file system size and the expected usage | |
142 | of the filesystem (see the | |
143 | .B \-T | |
144 | option). | |
3839e657 | 145 | .TP |
caf8ce4c | 146 | .B \-c |
3ed57c27 TT |
147 | Check the device for bad blocks before creating the file system. If |
148 | this option is specified twice, then a slower, destructive, read-write | |
149 | test is used instead of a fast read-only test. | |
3839e657 | 150 | .TP |
caf8ce4c | 151 | .BI \-f " fragment-size" |
3839e657 TT |
152 | Specify the size of fragments in bytes. |
153 | .TP | |
48015ced TT |
154 | .B \-F |
155 | Force | |
156 | .B mke2fs | |
157 | to run, even if the specified device is not a | |
158 | block special device, or appears to be mounted. | |
159 | .TP | |
caf8ce4c | 160 | .BI \-i " bytes-per-inode" |
3839e657 TT |
161 | Specify the bytes/inode ratio. |
162 | .B mke2fs | |
163 | creates an inode for every | |
164 | .I bytes-per-inode | |
48015ced | 165 | bytes of space on the disk. The larger the |
caf8ce4c | 166 | .I bytes-per-inode |
48015ced TT |
167 | ratio, the fewer inodes will be created. This value generally shouldn't |
168 | be smaller than the blocksize of the filesystem, since then too many | |
169 | inodes will be made. Be warned that is not possible to expand the number | |
170 | of inodes on a filesystem after it is created, so be careful deciding the | |
171 | correct value for this parameter. | |
dc2ec525 | 172 | .TP |
48015ced TT |
173 | .B \-j |
174 | Create the filesystem with an ext3 journal. If the | |
dc2ec525 | 175 | .B \-J |
48015ced TT |
176 | option is not specified, the default journal parameters will be used to |
177 | create an appropriately sized journal (given the size of the filesystem) | |
178 | stored within the filesystem. Note that you must be using a kernel | |
179 | which has ext3 support in order to actually make use of the journal. | |
dc2ec525 | 180 | .TP |
48015ced | 181 | .BI \-J " journal-options" |
dc2ec525 | 182 | Create the ext3 journal using options specified on the command-line. |
8ddaa66b TT |
183 | Journal options are comma |
184 | separated, and may take an argument using the equals ('=') sign. | |
48015ced TT |
185 | The following journal options are supported: |
186 | .RS 1.2i | |
dc2ec525 | 187 | .TP |
48015ced | 188 | .BI size= journal-size |
f0865ce4 | 189 | Create an internal journal (i.e., stored inside the filesystem) of size |
8d641749 TT |
190 | .I journal-size |
191 | megabytes. | |
2537b6d0 TT |
192 | The 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 | 194 | and 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" | |
230 | Read the bad blocks list from | |
3ed57c27 TT |
231 | .IR filename . |
232 | Note that the block numbers in the bad block list must be generated | |
233 | using the same block size as used by mke2fs. As a result, the | |
234 | .B \-c | |
235 | option to | |
236 | .B mke2fs | |
237 | is a much simpler and less error-prone method of checking a disk for bad | |
238 | blocks before formatting it, as | |
239 | .B mke2fs | |
240 | will automatically pass the correct parameters to the | |
241 | .B badblocks | |
242 | program. | |
48015ced TT |
243 | .TP |
244 | .B \-L | |
245 | Set the volume label for the filesystem. | |
246 | .TP | |
247 | .BI \-m " reserved-blocks-percentage" | |
248 | Specify the percentage of the filesystem blocks reserved for | |
249 | the super-user. This value defaults to 5%. | |
dc2ec525 | 250 | .TP |
48015ced TT |
251 | .B \-M |
252 | Set the last mounted directory for the filesystem. This might be useful | |
253 | for the sake of utilities that key off of the last mounted directory to | |
254 | determine where the filesytem should be mounted. | |
85ef4ae8 | 255 | .TP |
caf8ce4c | 256 | .B \-n |
1f22ce34 TT |
257 | causes mke2fs to not actually create a filesystem, but display what it |
258 | would do if it were to create a filesystem. This can be used to | |
259 | determine the location of the backup superblocks for a particular | |
260 | filesystem, so long as the mke2fs parameters that were passed when the | |
261 | filesystem was originally created are used again. (With the | |
262 | .B \-n | |
263 | option added, of course!) | |
2740156b | 264 | .TP |
caf8ce4c | 265 | .BI \-N " number-of-inodes" |
5515e6b4 TT |
266 | overrides the default calculation of the number of inodes that should be |
267 | reserved for the filesystem (which is based on the number of blocks and | |
caf8ce4c TT |
268 | the |
269 | .I bytes-per-inode | |
270 | ratio). This allows the user to specify the number | |
5515e6b4 TT |
271 | of desired inodes directly. |
272 | .TP | |
48015ced | 273 | .BI \-o " creator-os" |
1e3472c5 TT |
274 | Manually override the default value of the "creator os" field of the |
275 | filesystem. Normally the creator field is set by default to the native OS | |
583ccdc3 TT |
276 | of the |
277 | .B mke2fs | |
278 | executable. | |
1e3472c5 | 279 | .TP |
8d641749 | 280 | .B "\-O \fIfeature\fR[,...]" |
82b39c9f TT |
281 | Create filesystem with given features (filesystem options). Features |
282 | which are normally turned on by default may be disabled by prefixing the | |
283 | feature with a caret ('^') symbol. | |
48015ced TT |
284 | Currently, the |
285 | .B sparse_super | |
286 | and | |
287 | .B filetype | |
f0865ce4 | 288 | features are turned on by default when |
583ccdc3 | 289 | .B mke2fs |
f0865ce4 TT |
290 | is run on a system with Linux 2.2 or later (unless creator-os is set to |
291 | the Hurd). Filesystems that may need to be mounted on pre-2.2 Linux or | |
292 | other kernels should be created with | |
48015ced TT |
293 | .B "\-O none" |
294 | (or | |
295 | .B "\-r 0" | |
f0865ce4 | 296 | for Linux 1.2) which will disable these features, even if |
48015ced TT |
297 | .B mke2fs |
298 | is run on a system which can support them. | |
299 | .sp | |
300 | The following filesystem options are supported: | |
301 | .RS 1.2i | |
7f88b043 | 302 | .TP |
ccbed85a TT |
303 | .B dir_index |
304 | Use hashed b-trees to speed up lookups in large directories. | |
f3db3566 | 305 | .TP |
48015ced TT |
306 | .B filetype |
307 | Store file type information in directory entries. | |
1e3472c5 | 308 | .TP |
48015ced TT |
309 | .B has_journal |
310 | Create an ext3 journal (as if using the | |
311 | .B \-j | |
312 | option). | |
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 | |
323 | Create a filesystem with fewer superblock backup copies | |
324 | (saves space on large filesystems). | |
48015ced | 325 | .RE |
1e3472c5 | 326 | .TP |
8d641749 TT |
327 | .B \-q |
328 | Quiet execution. Useful if | |
329 | .B mke2fs | |
330 | is run in a script. | |
331 | .TP | |
48015ced | 332 | .BI \-r " revision" |
a29f4d30 | 333 | Set the filesystem revision for the new filesystem. Note that 1.2 |
48015ced TT |
334 | kernels only support revision 0 filesystems. The default is to |
335 | create revision 1 filesystems. | |
a29f4d30 | 336 | .TP |
48015ced | 337 | .BI \-R " raid-options" |
cb620174 | 338 | Set raid-related options for the filesystem. Raid options are comma |
8d641749 | 339 | separated, and may take an argument using the equals ('=') sign. The |
48015ced TT |
340 | following options are supported: |
341 | .RS 1.2i | |
342 | .TP | |
343 | .BI stride= stripe-size | |
344 | Configure the filesystem for a RAID array with | |
8d641749 | 345 | .I stripe-size |
48015ced TT |
346 | filesystem blocks per stripe. |
347 | .RE | |
348 | .TP | |
caf8ce4c | 349 | .B \-S |
f3db3566 TT |
350 | Write superblock and group descriptors only. This is useful if all of |
351 | the superblock and backup superblocks are corrupted, and a last-ditch | |
583ccdc3 TT |
352 | recovery method is desired. It causes |
353 | .B mke2fs | |
354 | to reinitialize the | |
f3db3566 TT |
355 | superblock and group descriptors, while not touching the inode table |
356 | and the block and inode bitmaps. The | |
357 | .B e2fsck | |
358 | program should be run immediately after this option is used, and there | |
48015ced TT |
359 | is no guarantee that any data will be salvageable. It is critical to |
360 | specify the correct filesystem blocksize when using this option, | |
361 | or 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 | 368 | Specify how the filesystem is going to be used, so that mke2fs can |
48015ced TT |
369 | chose optimal filesystem parameters for that use. The supported |
370 | filesystem types are: | |
371 | .RS 1.2i | |
372 | .TP 1.2i | |
373 | news | |
374 | one inode per 4kb block | |
375 | .TP | |
376 | largefile | |
377 | one inode per megabyte | |
378 | .TP | |
379 | largefile4 | |
380 | one inode per 4 megabytes | |
381 | .RE | |
382 | .TP | |
383 | .B \-v | |
384 | Verbose execution. | |
50787ea2 | 385 | .TP |
caf8ce4c | 386 | .B \-V |
50787ea2 | 387 | Print the version number of |
818180cd TT |
388 | .B mke2fs |
389 | and exit. | |
3839e657 TT |
390 | .SH AUTHOR |
391 | This version of | |
392 | .B mke2fs | |
a418d3ad | 393 | has been written by Theodore Ts'o <tytso@mit.edu>. |
3839e657 TT |
394 | .SH BUGS |
395 | .B mke2fs | |
caf8ce4c TT |
396 | accepts the |
397 | .B \-f | |
398 | option but currently ignores it because the second | |
3839e657 TT |
399 | extended file system does not support fragments yet. |
400 | .br | |
48015ced | 401 | There may be other ones. Please, report them to the author. |
3839e657 TT |
402 | .SH AVAILABILITY |
403 | .B mke2fs | |
12da49c9 | 404 | is part of the e2fsprogs package and is available from |
348e43dc | 405 | http://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) |