]>
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 TT |
6 | .SH NAME |
7 | mke2fs \- create a Linux second extended file system | |
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 | |
123 | is used to create a Linux second extended file system on a device (usually | |
124 | a disk partition). | |
3839e657 | 125 | .I device |
caf8ce4c TT |
126 | is the special file corresponding to the device (e.g |
127 | .IR /dev/hdXX ). | |
3839e657 TT |
128 | .I blocks-count |
129 | is the number of blocks on the device. If omitted, | |
130 | .B mke2fs | |
131 | automagically figures the file system size. | |
132 | .SH OPTIONS | |
133 | .TP | |
caf8ce4c | 134 | .BI \-b " block-size" |
2740156b | 135 | Specify the size of blocks in bytes. Valid block size vales are 1024, |
06968e7e TT |
136 | 2048 and 4096 bytes per block. If omitted, |
137 | .B mke2fs | |
138 | block-size is determined by the file system size and the expected usage | |
139 | of the filesystem (see the | |
140 | .B \-T | |
141 | option). | |
3839e657 | 142 | .TP |
caf8ce4c | 143 | .B \-c |
3ed57c27 TT |
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. | |
3839e657 | 147 | .TP |
caf8ce4c | 148 | .BI \-f " fragment-size" |
3839e657 TT |
149 | Specify the size of fragments in bytes. |
150 | .TP | |
48015ced TT |
151 | .B \-F |
152 | Force | |
153 | .B mke2fs | |
154 | to run, even if the specified device is not a | |
155 | block special device, or appears to be mounted. | |
156 | .TP | |
caf8ce4c | 157 | .BI \-i " bytes-per-inode" |
3839e657 TT |
158 | Specify the bytes/inode ratio. |
159 | .B mke2fs | |
160 | creates an inode for every | |
161 | .I bytes-per-inode | |
48015ced | 162 | bytes of space on the disk. The larger the |
caf8ce4c | 163 | .I bytes-per-inode |
48015ced TT |
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. | |
dc2ec525 | 169 | .TP |
48015ced TT |
170 | .B \-j |
171 | Create the filesystem with an ext3 journal. If the | |
dc2ec525 | 172 | .B \-J |
48015ced TT |
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. | |
dc2ec525 | 177 | .TP |
48015ced | 178 | .BI \-J " journal-options" |
dc2ec525 | 179 | Create the ext3 journal using options specified on the command-line. |
8ddaa66b TT |
180 | Journal options are comma |
181 | separated, and may take an argument using the equals ('=') sign. | |
48015ced TT |
182 | The following journal options are supported: |
183 | .RS 1.2i | |
dc2ec525 | 184 | .TP |
48015ced | 185 | .BI size= journal-size |
dc2ec525 | 186 | Create a journal stored in the filesystem of size |
8d641749 TT |
187 | .I journal-size |
188 | megabytes. | |
2537b6d0 TT |
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.) | |
8d641749 | 191 | and may be no more than 102,400 filesystem blocks. |
2537b6d0 | 192 | The journal must fit within the newly created filesystem. |
48015ced TT |
193 | @JDEV@.TP |
194 | @JDEV@.BI device= external-journal | |
8d641749 TT |
195 | @JDEV@Attach the filesystem to the journal block device located on |
196 | @JDEV@.IR external-journal . | |
197 | @JDEV@The external | |
198 | @JDEV@journal must already have been created using the command | |
199 | @JDEV@.IP | |
2d15576d AD |
200 | @JDEV@.B mke2fs -O journal_dev |
201 | @JDEV@.I external-journal | |
8d641749 TT |
202 | @JDEV@.IP |
203 | @JDEV@Note that | |
204 | @JDEV@.I external-journal | |
205 | @JDEV@must have been created with the | |
206 | @JDEV@same block size as the new filesystem. | |
2d15576d AD |
207 | @JDEV@.IP |
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 | |
212 | @JDEV@or | |
213 | @JDEV@.BI UUID= UUID | |
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 | |
218 | @JDEV@.B -L | |
219 | @JDEV@option of | |
220 | @JDEV@.BR tune2fs (8). | |
8d641749 TT |
221 | .RE |
222 | @JDEV@.IP | |
48015ced TT |
223 | @JDEV@Only one of the |
224 | @JDEV@.BR size " or " device | |
225 | @JDEV@options can be given for a filesystem. | |
48015ced TT |
226 | .TP |
227 | .BI \-l " filename" | |
228 | Read the bad blocks list from | |
3ed57c27 TT |
229 | .IR filename . |
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 | |
232 | .B \-c | |
233 | option to | |
234 | .B mke2fs | |
235 | is a much simpler and less error-prone method of checking a disk for bad | |
236 | blocks before formatting it, as | |
237 | .B mke2fs | |
238 | will automatically pass the correct parameters to the | |
239 | .B badblocks | |
240 | program. | |
48015ced TT |
241 | .TP |
242 | .B \-L | |
243 | Set the volume label for the filesystem. | |
244 | .TP | |
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%. | |
dc2ec525 | 248 | .TP |
48015ced TT |
249 | .B \-M |
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. | |
85ef4ae8 | 253 | .TP |
caf8ce4c | 254 | .B \-n |
2740156b TT |
255 | causes mke2fs to not actually create a filesystem, but display what it |
256 | would do if it were to create a filesystem. | |
257 | .TP | |
caf8ce4c | 258 | .BI \-N " number-of-inodes" |
5515e6b4 TT |
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 | |
caf8ce4c TT |
261 | the |
262 | .I bytes-per-inode | |
263 | ratio). This allows the user to specify the number | |
5515e6b4 TT |
264 | of desired inodes directly. |
265 | .TP | |
48015ced | 266 | .BI \-o " creator-os" |
1e3472c5 TT |
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 | |
583ccdc3 TT |
269 | of the |
270 | .B mke2fs | |
271 | executable. | |
1e3472c5 | 272 | .TP |
8d641749 | 273 | .B "\-O \fIfeature\fR[,...]" |
48015ced TT |
274 | Create filesystem with given features (filesystem options). |
275 | Currently, the | |
276 | .B sparse_super | |
277 | and | |
278 | .B filetype | |
279 | features are turned on by default unless | |
583ccdc3 | 280 | .B mke2fs |
085b02cb | 281 | is run on a system with a pre-2.2 Linux kernel. Filesystems that |
8d641749 | 282 | may need to mounted on pre-2.2 kernels should be created with |
48015ced TT |
283 | .B "\-O none" |
284 | (or | |
285 | .B "\-r 0" | |
286 | for 1.2 kernels) which will disable these features, even if | |
287 | .B mke2fs | |
288 | is run on a system which can support them. | |
289 | .sp | |
290 | The following filesystem options are supported: | |
291 | .RS 1.2i | |
7f88b043 | 292 | .TP |
48015ced TT |
293 | .B sparse_super |
294 | Create a filesystem with fewer superblock backup copies | |
295 | (saves space on large filesystems). | |
f3db3566 | 296 | .TP |
48015ced TT |
297 | .B filetype |
298 | Store file type information in directory entries. | |
1e3472c5 | 299 | .TP |
48015ced TT |
300 | .B has_journal |
301 | Create an ext3 journal (as if using the | |
302 | .B \-j | |
303 | option). | |
304 | @JDEV@.TP | |
8d641749 | 305 | @JDEV@.B journal_dev |
48015ced | 306 | @JDEV@Create an external ext3 journal on the given device |
8d641749 TT |
307 | @JDEV@instead of a regular ext2 filesystem. |
308 | @JDEV@Note that | |
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. | |
48015ced | 312 | .RE |
1e3472c5 | 313 | .TP |
8d641749 TT |
314 | .B \-q |
315 | Quiet execution. Useful if | |
316 | .B mke2fs | |
317 | is run in a script. | |
318 | .TP | |
48015ced | 319 | .BI \-r " revision" |
a29f4d30 | 320 | Set the filesystem revision for the new filesystem. Note that 1.2 |
48015ced TT |
321 | kernels only support revision 0 filesystems. The default is to |
322 | create revision 1 filesystems. | |
a29f4d30 | 323 | .TP |
48015ced | 324 | .BI \-R " raid-options" |
cb620174 | 325 | Set raid-related options for the filesystem. Raid options are comma |
8d641749 | 326 | separated, and may take an argument using the equals ('=') sign. The |
48015ced TT |
327 | following options are supported: |
328 | .RS 1.2i | |
329 | .TP | |
330 | .BI stride= stripe-size | |
331 | Configure the filesystem for a RAID array with | |
8d641749 | 332 | .I stripe-size |
48015ced TT |
333 | filesystem blocks per stripe. |
334 | .RE | |
335 | .TP | |
caf8ce4c | 336 | .B \-S |
f3db3566 TT |
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 | |
583ccdc3 TT |
339 | recovery method is desired. It causes |
340 | .B mke2fs | |
341 | to reinitialize the | |
f3db3566 TT |
342 | superblock and group descriptors, while not touching the inode table |
343 | and the block and inode bitmaps. The | |
344 | .B e2fsck | |
345 | program should be run immediately after this option is used, and there | |
48015ced TT |
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. | |
8d641749 TT |
349 | .\" .TP |
350 | .\" .BI \-t " test" | |
351 | .\" Check the device for bad blocks before creating the file system | |
352 | .\" using the specified test. | |
818180cd | 353 | .TP |
caf8ce4c | 354 | .BI \-T " fs-type" |
50787ea2 | 355 | Specify how the filesystem is going to be used, so that mke2fs can |
48015ced TT |
356 | chose optimal filesystem parameters for that use. The supported |
357 | filesystem types are: | |
358 | .RS 1.2i | |
359 | .TP 1.2i | |
360 | news | |
361 | one inode per 4kb block | |
362 | .TP | |
363 | largefile | |
364 | one inode per megabyte | |
365 | .TP | |
366 | largefile4 | |
367 | one inode per 4 megabytes | |
368 | .RE | |
369 | .TP | |
370 | .B \-v | |
371 | Verbose execution. | |
50787ea2 | 372 | .TP |
caf8ce4c | 373 | .B \-V |
50787ea2 | 374 | Print the version number of |
818180cd TT |
375 | .B mke2fs |
376 | and exit. | |
3839e657 TT |
377 | .SH AUTHOR |
378 | This version of | |
379 | .B mke2fs | |
a418d3ad | 380 | has been written by Theodore Ts'o <tytso@mit.edu>. |
3839e657 TT |
381 | .SH BUGS |
382 | .B mke2fs | |
caf8ce4c TT |
383 | accepts the |
384 | .B \-f | |
385 | option but currently ignores it because the second | |
3839e657 TT |
386 | extended file system does not support fragments yet. |
387 | .br | |
48015ced | 388 | There may be other ones. Please, report them to the author. |
3839e657 TT |
389 | .SH AVAILABILITY |
390 | .B mke2fs | |
12da49c9 | 391 | is part of the e2fsprogs package and is available from |
348e43dc | 392 | http://e2fsprogs.sourceforge.net. |
3839e657 | 393 | .SH SEE ALSO |
e72a9ba3 | 394 | .BR badblocks (8), |
3839e657 TT |
395 | .BR dumpe2fs (8), |
396 | .BR e2fsck (8), | |
397 | .BR tune2fs (8) |