version 2, including all changes.
.
Rev |
Author |
# |
Line |
1 |
perry |
1 |
MKE2FS |
|
|
2 |
!!!MKE2FS |
|
|
3 |
NAME |
|
|
4 |
SYNOPSIS |
|
|
5 |
DESCRIPTION |
|
|
6 |
OPTIONS |
|
|
7 |
AUTHOR |
|
|
8 |
BUGS |
|
|
9 |
AVAILABILITY |
|
|
10 |
SEE ALSO |
|
|
11 |
---- |
|
|
12 |
!!NAME |
|
|
13 |
|
|
|
14 |
|
|
|
15 |
mke2fs - create a Linux second extended file system |
|
|
16 |
!!SYNOPSIS |
|
|
17 |
|
|
|
18 |
|
|
|
19 |
__mke2fs__ [[ __-c__ | __-l__ ''filename'' ] [[ |
|
|
20 |
__-b__ ''block-size'' ] [[ __-f__ |
|
|
21 |
''fragment-size'' ] [[ __-i__ ''bytes-per-inode'' ] |
|
|
22 |
[[ __-j__ ] [[ __-J__ ''journal-options'' ] [[ |
|
|
23 |
__-N__ ''number-of-inodes'' ] [[ __-n__ ] [[ |
|
|
24 |
__-m__ ''reserved-blocks-percentage'' ] [[ __-o__ |
|
|
25 |
''creator-os'' ] [[ __-O__ ''feature''[[,...] ] [[ |
|
|
26 |
__-q__ ] [[ __-r__ ''fs-revision-level'' ] [[ |
|
|
27 |
__-R__ ''raid-options'' ] [[ __-v__ ] [[ __-F__ ] |
|
|
28 |
[[ __-L__ ''volume-label'' ] [[ __-M__ |
|
|
29 |
''last-mounted-directory'' ] [[ __-S__ ] [[ __-T__ |
|
|
30 |
''filesystem-type'' ] [[ __-V__ ] ''device'' [[ |
|
|
31 |
''blocks-count'' ] |
|
|
32 |
|
|
|
33 |
|
|
|
34 |
__mke2fs -O journal_dev__ [[ __-b__ ''block-size'' ] |
|
|
35 |
[[ __-L__ ''volume-label'' ] [[ __-n__ ] [[ __-q__ |
|
|
36 |
] [[ __-v__ ] ''external-journal'' [[ |
|
|
37 |
''blocks-count'' ] |
|
|
38 |
!!DESCRIPTION |
|
|
39 |
|
|
|
40 |
|
|
|
41 |
__mke2fs__ is used to create a Linux second extended file |
|
|
42 |
system on a device (usually a disk partition). ''device'' |
|
|
43 |
is the special file corresponding to the device (e.g |
|
|
44 |
''/dev/hdXX''). ''blocks-count'' is the number of |
|
|
45 |
blocks on the device. If omitted, __mke2fs__ |
|
|
46 |
automagically figures the file system size. If called as |
|
|
47 |
__mkfs.ext3__ a journal is created as if the __-j__ |
|
|
48 |
option was specified. |
|
|
49 |
!!OPTIONS |
|
|
50 |
|
|
|
51 |
|
|
|
52 |
__-b__ ''block-size'' |
|
|
53 |
|
|
|
54 |
|
|
|
55 |
Specify the size of blocks in bytes. Valid block size vales |
|
|
56 |
are 1024, 2048 and 4096 bytes per block. If omitted, |
|
|
57 |
__mke2fs__ block-size is determined by the file system |
|
|
58 |
size and the expected usage of the filesystem (see the |
|
|
59 |
__-T__ option). |
|
|
60 |
|
|
|
61 |
|
|
|
62 |
__-c__ |
|
|
63 |
|
|
|
64 |
|
|
|
65 |
Check the device for bad blocks before creating the file |
|
|
66 |
system. If this option is specified twice, then a slower, |
|
|
67 |
destructive, read-write test is used instead of a fast |
|
|
68 |
read-only test. |
|
|
69 |
|
|
|
70 |
|
|
|
71 |
__-f__ ''fragment-size'' |
|
|
72 |
|
|
|
73 |
|
|
|
74 |
Specify the size of fragments in bytes. |
|
|
75 |
|
|
|
76 |
|
|
|
77 |
__-F__ |
|
|
78 |
|
|
|
79 |
|
|
|
80 |
Force __mke2fs__ to run, even if the specified device is |
|
|
81 |
not a block special device, or appears to be |
|
|
82 |
mounted. |
|
|
83 |
|
|
|
84 |
|
|
|
85 |
__-i__ ''bytes-per-inode'' |
|
|
86 |
|
|
|
87 |
|
|
|
88 |
Specify the bytes/inode ratio. __mke2fs__ creates an |
|
|
89 |
inode for every ''bytes-per-inode'' bytes of space on the |
|
|
90 |
disk. The larger the ''bytes-per-inode'' ratio, the fewer |
|
|
91 |
inodes will be created. This value generally shouldn't be |
|
|
92 |
smaller than the blocksize of the filesystem, since then too |
|
|
93 |
many inodes will be made. Be warned that is not possible to |
|
|
94 |
expand the number of inodes on a filesystem after it is |
|
|
95 |
created, so be careful deciding the correct value for this |
|
|
96 |
parameter. |
|
|
97 |
|
|
|
98 |
|
|
|
99 |
__-j__ |
|
|
100 |
|
|
|
101 |
|
|
|
102 |
Create the filesystem with an ext3 journal. If the __-J__ |
|
|
103 |
option is not specified, the default journal parameters will |
|
|
104 |
be used to create an appropriately sized journal (given the |
|
|
105 |
size of the filesystem) stored within the filesystem. Note |
|
|
106 |
that you must be using a kernel which has ext3 support in |
|
|
107 |
order to actually make use of the journal. |
|
|
108 |
|
|
|
109 |
|
|
|
110 |
__-J__ ''journal-options'' |
|
|
111 |
|
|
|
112 |
|
|
|
113 |
Create the ext3 journal using options specified on the |
|
|
114 |
command-line. Journal options are comma separated, and may |
|
|
115 |
take an argument using the equals ('=') sign. The following |
|
|
116 |
journal options are supported: |
|
|
117 |
|
|
|
118 |
|
|
|
119 |
__size=__''journal-size'' |
|
|
120 |
|
|
|
121 |
|
|
|
122 |
Create a journal stored in the filesystem of size |
|
|
123 |
''journal-size'' megabytes. The size of the journal must |
|
|
124 |
be at least 1024 filesystem blocks (i.e., 1MB if using 1k |
|
|
125 |
blocks, 4MB if using 4k blocks, etc.) and may be no more |
|
|
126 |
than 102,400 filesystem blocks. The journal must fit within |
|
|
127 |
the newly created filesystem. |
|
|
128 |
|
|
|
129 |
|
|
|
130 |
__device=__''external-journal'' |
|
|
131 |
|
|
|
132 |
|
|
|
133 |
Attach the filesystem to the journal block device located on |
|
|
134 |
''external-journal''. The external journal must already |
|
|
135 |
have been created using the command |
|
|
136 |
|
|
|
137 |
|
|
|
138 |
__mke2fs -O journal_dev__ |
|
|
139 |
''external-journal'' |
|
|
140 |
|
|
|
141 |
|
|
|
142 |
Note that ''external-journal'' must have been created |
|
|
143 |
with the same block size as the new filesystem. |
|
|
144 |
|
|
|
145 |
|
|
|
146 |
Instead of specifying a device name directly, |
|
|
147 |
''external-journal'' can also be specified by either |
|
|
148 |
__LABEL=__''label'' or __UUID=__''UUID'' to |
|
|
149 |
locate the external journal by either the volume label or |
|
|
150 |
UUID stored in the ext2 superblock at the start of the |
2 |
perry |
151 |
journal. Use dumpe2fs(8) to display a journal |
1 |
perry |
152 |
device's volume label and UUID. See also the __-L__ |
2 |
perry |
153 |
option of tune2fs(8). |
1 |
perry |
154 |
|
|
|
155 |
|
|
|
156 |
Only one of the __size__ or __device__ options can be |
|
|
157 |
given for a filesystem. |
|
|
158 |
|
|
|
159 |
|
|
|
160 |
__-l__ ''filename'' |
|
|
161 |
|
|
|
162 |
|
|
|
163 |
Read the bad blocks list from ''filename''. Note that the |
|
|
164 |
block numbers in the bad block list must be generated using |
|
|
165 |
the same block size as used by mke2fs. As a result, the |
|
|
166 |
__-c__ option to __mke2fs__ is a much simpler and less |
|
|
167 |
error-prone method of checking a disk for bad blocks before |
|
|
168 |
formatting it, as __mke2fs__ will automatically pass the |
|
|
169 |
correct parameters to the __badblocks__ |
|
|
170 |
program. |
|
|
171 |
|
|
|
172 |
|
|
|
173 |
__-L__ |
|
|
174 |
|
|
|
175 |
|
|
|
176 |
Set the volume label for the filesystem. |
|
|
177 |
|
|
|
178 |
|
|
|
179 |
__-m__ ''reserved-blocks-percentage'' |
|
|
180 |
|
|
|
181 |
|
|
|
182 |
Specify the percentage of the filesystem blocks reserved for |
|
|
183 |
the super-user. This value defaults to 5%. |
|
|
184 |
|
|
|
185 |
|
|
|
186 |
__-M__ |
|
|
187 |
|
|
|
188 |
|
|
|
189 |
Set the last mounted directory for the filesystem. This |
|
|
190 |
might be useful for the sake of utilities that key off of |
|
|
191 |
the last mounted directory to determine where the filesytem |
|
|
192 |
should be mounted. |
|
|
193 |
|
|
|
194 |
|
|
|
195 |
__-n__ |
|
|
196 |
|
|
|
197 |
|
|
|
198 |
causes mke2fs to not actually create a filesystem, but |
|
|
199 |
display what it would do if it were to create a |
|
|
200 |
filesystem. |
|
|
201 |
|
|
|
202 |
|
|
|
203 |
__-N__ ''number-of-inodes'' |
|
|
204 |
|
|
|
205 |
|
|
|
206 |
overrides the default calculation of the number of inodes |
|
|
207 |
that should be reserved for the filesystem (which is based |
|
|
208 |
on the number of blocks and the ''bytes-per-inode'' |
|
|
209 |
ratio). This allows the user to specify the number of |
|
|
210 |
desired inodes directly. |
|
|
211 |
|
|
|
212 |
|
|
|
213 |
__-o__ ''creator-os'' |
|
|
214 |
|
|
|
215 |
|
|
|
216 |
Manually override the default value of the |
|
|
217 |
mke2fs__ |
|
|
218 |
executable. |
|
|
219 |
|
|
|
220 |
|
|
|
221 |
__-O__ ''feature''[[,...] |
|
|
222 |
|
|
|
223 |
|
|
|
224 |
Create filesystem with given features (filesystem options). |
|
|
225 |
Currently, the __sparse_super__ and __filetype__ |
|
|
226 |
features are turned on by default unless __mke2fs__ is |
|
|
227 |
run on a system with a pre-2.2 Linux kernel. Filesystems |
|
|
228 |
that may need to mounted on pre-2.2 kernels should be |
|
|
229 |
created with __-O none__ (or __-r 0__ for 1.2 kernels) |
|
|
230 |
which will disable these features, even if __mke2fs__ is |
|
|
231 |
run on a system which can support them. |
|
|
232 |
|
|
|
233 |
|
|
|
234 |
The following filesystem options are supported: |
|
|
235 |
|
|
|
236 |
|
|
|
237 |
__sparse_super__ |
|
|
238 |
|
|
|
239 |
|
|
|
240 |
Create a filesystem with fewer superblock backup copies |
|
|
241 |
(saves space on large filesystems). |
|
|
242 |
|
|
|
243 |
|
|
|
244 |
__filetype__ |
|
|
245 |
|
|
|
246 |
|
|
|
247 |
Store file type information in directory |
|
|
248 |
entries. |
|
|
249 |
|
|
|
250 |
|
|
|
251 |
__has_journal__ |
|
|
252 |
|
|
|
253 |
|
|
|
254 |
Create an ext3 journal (as if using the __-j__ |
|
|
255 |
option). |
|
|
256 |
|
|
|
257 |
|
|
|
258 |
__journal_dev__ |
|
|
259 |
|
|
|
260 |
|
|
|
261 |
Create an external ext3 journal on the given device instead |
|
|
262 |
of a regular ext2 filesystem. Note that |
|
|
263 |
''external-journal'' must be created with the same block |
|
|
264 |
size as the filesystems that will be using it. |
|
|
265 |
|
|
|
266 |
|
|
|
267 |
__-q__ |
|
|
268 |
|
|
|
269 |
|
|
|
270 |
Quiet execution. Useful if __mke2fs__ is run in a |
|
|
271 |
script. |
|
|
272 |
|
|
|
273 |
|
|
|
274 |
__-r__ ''revision'' |
|
|
275 |
|
|
|
276 |
|
|
|
277 |
Set the filesystem revision for the new filesystem. Note |
|
|
278 |
that 1.2 kernels only support revision 0 filesystems. The |
|
|
279 |
default is to create revision 1 filesystems. |
|
|
280 |
|
|
|
281 |
|
|
|
282 |
__-R__ ''raid-options'' |
|
|
283 |
|
|
|
284 |
|
|
|
285 |
Set raid-related options for the filesystem. Raid options |
|
|
286 |
are comma separated, and may take an argument using the |
|
|
287 |
equals ('=') sign. The following options are |
|
|
288 |
supported: |
|
|
289 |
|
|
|
290 |
|
|
|
291 |
__stride=__''stripe-size'' |
|
|
292 |
|
|
|
293 |
|
|
|
294 |
Configure the filesystem for a RAID array with |
|
|
295 |
''stripe-size'' filesystem blocks per |
|
|
296 |
stripe. |
|
|
297 |
|
|
|
298 |
|
|
|
299 |
__-S__ |
|
|
300 |
|
|
|
301 |
|
|
|
302 |
Write superblock and group descriptors only. This is useful |
|
|
303 |
if all of the superblock and backup superblocks are |
|
|
304 |
corrupted, and a last-ditch recovery method is desired. It |
|
|
305 |
causes __mke2fs__ to reinitialize the superblock and |
|
|
306 |
group descriptors, while not touching the inode table and |
|
|
307 |
the block and inode bitmaps. The __e2fsck__ program |
|
|
308 |
should be run immediately after this option is used, and |
|
|
309 |
there is no guarantee that any data will be salvageable. It |
|
|
310 |
is critical to specify the correct filesystem blocksize when |
|
|
311 |
using this option, or there is no chance of |
|
|
312 |
recovery. |
|
|
313 |
|
|
|
314 |
|
|
|
315 |
__-T__ ''fs-type'' |
|
|
316 |
|
|
|
317 |
|
|
|
318 |
Specify how the filesystem is going to be used, so that |
|
|
319 |
mke2fs can chose optimal filesystem parameters for that use. |
|
|
320 |
The supported filesystem types are: |
|
|
321 |
|
|
|
322 |
|
|
|
323 |
news |
|
|
324 |
|
|
|
325 |
|
|
|
326 |
one inode per 4kb block |
|
|
327 |
|
|
|
328 |
|
|
|
329 |
largefile |
|
|
330 |
|
|
|
331 |
|
|
|
332 |
one inode per megabyte |
|
|
333 |
|
|
|
334 |
|
|
|
335 |
largefile4 |
|
|
336 |
|
|
|
337 |
|
|
|
338 |
one inode per 4 megabytes |
|
|
339 |
|
|
|
340 |
|
|
|
341 |
__-v__ |
|
|
342 |
|
|
|
343 |
|
|
|
344 |
Verbose execution. |
|
|
345 |
|
|
|
346 |
|
|
|
347 |
__-V__ |
|
|
348 |
|
|
|
349 |
|
|
|
350 |
Print the version number of __mke2fs__ and |
|
|
351 |
exit. |
|
|
352 |
!!AUTHOR |
|
|
353 |
|
|
|
354 |
|
|
|
355 |
This version of __mke2fs__ has been written by Theodore |
|
|
356 |
Ts'o __ |
|
|
357 |
!!BUGS |
|
|
358 |
|
|
|
359 |
|
|
|
360 |
__mke2fs__ accepts the __-f__ option but currently |
|
|
361 |
ignores it because the second extended file system does not |
|
|
362 |
support fragments yet. |
|
|
363 |
There may be other ones. Please, report them to the |
|
|
364 |
author. |
|
|
365 |
!!AVAILABILITY |
|
|
366 |
|
|
|
367 |
|
|
|
368 |
__mke2fs__ is part of the e2fsprogs package and is |
|
|
369 |
available from |
|
|
370 |
http://e2fsprogs.sourceforge.net. |
|
|
371 |
!!SEE ALSO |
|
|
372 |
|
|
|
373 |
|
2 |
perry |
374 |
badblocks(8), dumpe2fs(8), __e2fsck__(8), |
|
|
375 |
tune2fs(8) |
1 |
perry |
376 |
---- |