Whamcloud - gitweb
Many files:
[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 journal-device 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 journal-device
118 .SH DESCRIPTION
119 .B mke2fs
120 is used to create a Linux second extended file system on a device (usually
121 a disk partition).
122 .I device
123 is the special file corresponding to the device (e.g 
124 .IR /dev/hdXX ).
125 .I blocks-count
126 is the number of blocks on the device.  If omitted,
127 .B mke2fs
128 automagically figures the file system size.
129 .SH OPTIONS
130 .TP
131 .BI \-b " block-size"
132 Specify the size of blocks in bytes.  Valid block size vales are 1024, 
133 2048 and 4096 bytes per block.  If omitted,
134 .B mke2fs
135 block-size is determined by the file system size and the expected usage
136 of the filesystem (see the
137 .B \-T
138 option).
139 .TP
140 .B \-c
141 Check the device for bad blocks before creating the file system, using a
142 fast read-only test.
143 .TP
144 .BI \-f " fragment-size"
145 Specify the size of fragments in bytes.
146 .TP
147 .B \-F
148 Force 
149 .B mke2fs
150 to run, even if the specified device is not a 
151 block special device, or appears to be mounted.
152 .TP
153 .BI \-i " bytes-per-inode"
154 Specify the bytes/inode ratio. 
155 .B mke2fs
156 creates an inode for every
157 .I bytes-per-inode
158 bytes of space on the disk.  The larger the 
159 .I bytes-per-inode
160 ratio, the fewer inodes will be created.  This value generally shouldn't
161 be smaller than the blocksize of the filesystem, since then too many
162 inodes will be made.  Be warned that is not possible to expand the number 
163 of inodes on a filesystem after it is created, so be careful deciding the
164 correct value for this parameter. 
165 .TP 
166 .B \-j
167 Create the filesystem with an ext3 journal.  If the
168 .B \-J
169 option is not specified, the default journal parameters will be used to
170 create an appropriately sized journal (given the size of the filesystem) 
171 stored within the filesystem.  Note that you must be using a kernel
172 which has ext3 support in order to actually make use of the journal.
173 .TP
174 .BI \-J " journal-options"
175 Create the ext3 journal using options specified on the command-line.
176 Journal options are comma
177 separated, and may take an argument using the equals ('=')  sign.
178 The following journal options are supported:
179 .RS 1.2i
180 .TP
181 .BI size= journal-size
182 Create a journal stored in the filesystem of size
183 .IR journal-size .
184 The size of the journal must be at least 1024 filesystem blocks 
185 (i.e., 1MB if using 1k blocks, 4MB if using 4k blocks, etc.) 
186 and may be no more than 10,240 filesystem blocks.  
187 The journal must fit within the newly created filesystem.  
188 @JDEV@.TP
189 @JDEV@.BI device= external-journal
190 @JDEV@Add an external journal found on a block device named by 
191 @JDEV@.I external-journal 
192 @JDEV@to the filesystem.  The external 
193 @JDEV@journal must have been already created using the command
194 @JDEV@.sp
195 @JDEV@.B mke2fs \-O journal-dev 
196 @JDEV@.IR journal\-device
197 @JDEV@.sp
198 @JDEV@Only one of the
199 @JDEV@.BR size " or " device
200 @JDEV@options can be given for a filesystem.
201 .RE
202 .TP
203 .BI \-l " filename"
204 Read the bad blocks list from
205 .IR filename .
206 .TP
207 .B \-L
208 Set the volume label for the filesystem.
209 .TP
210 .BI \-m " reserved-blocks-percentage"
211 Specify the percentage of the filesystem blocks reserved for 
212 the super-user.  This value defaults to 5%.
213 .\" .TP
214 .\" .BI \-t " test"
215 .\" Check the device for bad blocks before creating the file system
216 .\" using the specified test.
217 .TP
218 .B \-M
219 Set the last mounted directory for the filesystem.  This might be useful 
220 for the sake of utilities that key off of the last mounted directory to 
221 determine where the filesytem should be mounted.
222 .TP
223 .B \-n
224 causes mke2fs to not actually create a filesystem, but display what it 
225 would do if it were to create a filesystem.
226 .TP
227 .BI \-N " number-of-inodes"
228 overrides the default calculation of the number of inodes that should be 
229 reserved for the filesystem (which is based on the number of blocks and 
230 the 
231 .I bytes-per-inode
232 ratio).  This allows the user to specify the number 
233 of desired inodes directly.
234 .TP
235 .BI \-o " creator-os"
236 Manually override the default value of the "creator os" field of the 
237 filesystem.  Normally the creator field is set by default to the native OS
238 of the
239 .B mke2fs
240 executable.
241 .TP
242 .B \-O "\fIfeature\fR[,...]"
243 Create filesystem with given features (filesystem options).
244 Currently, the
245 .B sparse_super
246 and
247 .B filetype
248 features are turned on by default unless 
249 .B mke2fs
250 is run on a system with a pre-2.2 Linux kernel.
251 .sp
252 .B Warning:
253 Linux kernels before 2.0.39 and many 2.1 series kernels do not support
254 filesystems that use any of these features.  Filesystems that
255 may need to mounted on pre-2.2 kernels should be created with the
256 .B "\-O none"
257 (or
258 .B "\-r 0"
259 for 1.2 kernels) which will disable these features, even if 
260 .B mke2fs 
261 is run on a system which can support them.
262 .sp
263 The following filesystem options are supported:
264 .RS 1.2i
265 .TP
266 .B sparse_super
267 Create a filesystem with fewer superblock backup copies
268 (saves space on large filesystems).
269 .TP
270 .B filetype
271 Store file type information in directory entries.
272 .TP
273 .B has_journal
274 Create an ext3 journal (as if using the
275 .B \-j
276 option).
277 @JDEV@.TP
278 @JDEV@.B journal-dev
279 @JDEV@Create an external ext3 journal on the given device
280 @JDEV@instead of a regular ext2 filesystem.  The external ext3
281 @JDEV@journal can be shared by multiple ext2 filesystems.
282 .RE
283 .TP
284 .BI \-r " revision"
285 Set the filesystem revision for the new filesystem.  Note that 1.2
286 kernels only support revision 0 filesystems.  The default is to 
287 create revision 1 filesystems.
288 .TP
289 .BI \-R " raid-options"
290 Set raid-related options for the filesystem.  Raid options are comma
291 separated, and may take an argument using the equals ('=')  sign.  The 
292 following options are supported:
293 .RS 1.2i
294 .TP
295 .BI stride= stripe-size
296 Configure the filesystem for a RAID array with
297 .I strip-size
298 filesystem blocks per stripe.
299 .RE
300 .TP
301 .B \-q
302 Quiet execution.  Useful if 
303 .B mke2fs
304 is run in a script.
305 .TP
306 .B \-S
307 Write superblock and group descriptors only.  This is useful if all of
308 the superblock and backup superblocks are corrupted, and a last-ditch
309 recovery method is desired.  It causes 
310 .B mke2fs
311 to reinitialize the 
312 superblock and group descriptors, while not touching the inode table
313 and the block and inode bitmaps.  The
314 .B e2fsck
315 program should be run immediately after this option is used, and there
316 is no guarantee that any data will be salvageable.  It is critical to
317 specify the correct filesystem blocksize when using this option,
318 or there is no chance of recovery.
319 .TP
320 .BI \-T " fs-type"
321 Specify how the filesystem is going to be used, so that mke2fs can 
322 chose optimal filesystem parameters for that use.  The supported
323 filesystem types are:
324 .RS 1.2i
325 .TP 1.2i
326 news
327 one inode per 4kb block
328 .TP
329 largefile
330 one inode per megabyte
331 .TP
332 largefile4
333 one inode per 4 megabytes
334 .RE
335 .TP
336 .B \-v
337 Verbose execution.
338 .TP
339 .B \-V
340 Print the version number of 
341 .B mke2fs
342 and exit.
343 .SH AUTHOR
344 This version of
345 .B mke2fs
346 has been written by Theodore Ts'o <tytso@mit.edu>.
347 .SH BUGS
348 .B mke2fs
349 accepts the
350 .B \-f
351 option but currently ignores it because the second
352 extended file system does not support fragments yet.
353 .br
354 There may be other ones.  Please, report them to the author.
355 .SH AVAILABILITY
356 .B mke2fs
357 is part of the e2fsprogs package and is available from 
358 http://e2fsprogs.sourceforge.net.
359 .SH SEE ALSO
360 .BR badblocks (8),
361 .BR dumpe2fs (8),
362 .BR e2fsck (8),
363 .BR tune2fs (8)