Whamcloud - gitweb
In mke2fs and e2fsck, specifying the -c option twice will now do
[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 a Linux second extended file system
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 \-i
26 .I bytes-per-inode
27 ]
28 [
29 .B \-j
30 ]
31 [
32 .B \-J
33 .I journal-options
34 ]
35 [
36 .B \-N
37 .I number-of-inodes
38 ]
39 [
40 .B -n
41 ]
42 [
43 .B \-m
44 .I reserved-blocks-percentage
45 ]
46 [
47 .B \-o
48 .I creator-os
49 ]
50 [
51 .B \-O 
52 .IR feature [,...]
53 ]
54 [
55 .B \-q
56 ]
57 [
58 .B \-r
59 .I fs-revision-level
60 ]
61 [
62 .B \-R
63 .I raid-options
64 ]
65 [
66 .B \-v
67 ]
68 [
69 .B \-F
70 ]
71 [
72 .B \-L
73 .I volume-label
74 ]
75 [
76 .B \-M
77 .I last-mounted-directory
78 ]
79 [
80 .B \-S
81 ]
82 [
83 .B \-T
84 .I filesystem-type
85 ]
86 [
87 .B \-V
88 ]
89 .I device
90 [
91 .I blocks-count
92 ]
93 @JDEV@.sp
94 @JDEV@.B "mke2fs \-O journal_dev"
95 @JDEV@[
96 @JDEV@.B \-b
97 @JDEV@.I block-size
98 @JDEV@]
99 .\" No external-journal specific journal options yet (size is ignored)
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@]
117 @JDEV@.I external-journal
118 @JDEV@[
119 @JDEV@.I blocks-count
120 @JDEV@]
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).
125 .I device
126 is the special file corresponding to the device (e.g 
127 .IR /dev/hdXX ).
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
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,
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).
142 .TP
143 .B \-c
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.
147 .TP
148 .BI \-f " fragment-size"
149 Specify the size of fragments in bytes.
150 .TP
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
157 .BI \-i " bytes-per-inode"
158 Specify the bytes/inode ratio. 
159 .B mke2fs
160 creates an inode for every
161 .I bytes-per-inode
162 bytes of space on the disk.  The larger the 
163 .I bytes-per-inode
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. 
169 .TP 
170 .B \-j
171 Create the filesystem with an ext3 journal.  If the
172 .B \-J
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.
177 .TP
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:
183 .RS 1.2i
184 .TP
185 .BI size= journal-size
186 Create a journal stored in the filesystem of size
187 .I journal-size 
188 megabytes.
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.  
193 @JDEV@.TP
194 @JDEV@.BI device= external-journal
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
200 @JDEV@.B mke2fs -O journal_dev
201 @JDEV@.I external-journal
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.
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).
221 .RE
222 @JDEV@.IP
223 @JDEV@Only one of the
224 @JDEV@.BR size " or " device
225 @JDEV@options can be given for a filesystem.
226 .TP
227 .BI \-l " filename"
228 Read the bad blocks list from
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.
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%.
248 .TP
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.
253 .TP
254 .B \-n
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
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 
261 the 
262 .I bytes-per-inode
263 ratio).  This allows the user to specify the number 
264 of desired inodes directly.
265 .TP
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
269 of the
270 .B mke2fs
271 executable.
272 .TP
273 .B "\-O \fIfeature\fR[,...]"
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 
280 .B mke2fs
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 
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
292 .TP
293 .B sparse_super
294 Create a filesystem with fewer superblock backup copies
295 (saves space on large filesystems).
296 .TP
297 .B filetype
298 Store file type information in directory entries.
299 .TP
300 .B has_journal
301 Create an ext3 journal (as if using the
302 .B \-j
303 option).
304 @JDEV@.TP
305 @JDEV@.B journal_dev
306 @JDEV@Create an external ext3 journal on the given device
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.
312 .RE
313 .TP
314 .B \-q
315 Quiet execution.  Useful if 
316 .B mke2fs
317 is run in a script.
318 .TP
319 .BI \-r " revision"
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.
323 .TP
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:
328 .RS 1.2i
329 .TP
330 .BI stride= stripe-size
331 Configure the filesystem for a RAID array with
332 .I stripe-size
333 filesystem blocks per stripe.
334 .RE
335 .TP
336 .B \-S
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 
340 .B mke2fs
341 to reinitialize the 
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
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.
349 .\" .TP
350 .\" .BI \-t " test"
351 .\" Check the device for bad blocks before creating the file system
352 .\" using the specified test.
353 .TP
354 .BI \-T " fs-type"
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:
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.
372 .TP
373 .B \-V
374 Print the version number of 
375 .B mke2fs
376 and exit.
377 .SH AUTHOR
378 This version of
379 .B mke2fs
380 has been written by Theodore Ts'o <tytso@mit.edu>.
381 .SH BUGS
382 .B mke2fs
383 accepts the
384 .B \-f
385 option but currently ignores it because the second
386 extended file system does not support fragments yet.
387 .br
388 There may be other ones.  Please, report them to the author.
389 .SH AVAILABILITY
390 .B mke2fs
391 is part of the e2fsprogs package and is available from 
392 http://e2fsprogs.sourceforge.net.
393 .SH SEE ALSO
394 .BR badblocks (8),
395 .BR dumpe2fs (8),
396 .BR e2fsck (8),
397 .BR tune2fs (8)