Whamcloud - gitweb
ChangeLog, mke2fs.c:
[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 \-t
14 .\" .I test
15 .\" |
16 .B \-l
17 .I filename
18 ]
19 [
20 .B \-b
21 .I block-size
22 ]
23 [
24 .B \-f
25 .I fragment-size
26 ]
27 [
28 .B \-i
29 .I bytes-per-inode
30 ]
31 [
32 .B \-j
33 ]
34 [
35 .B \-J
36 .I journal-options
37 ]
38 [
39 .B \-N
40 .I number-of-inodes
41 ]
42 [
43 .B -n
44 ]
45 [
46 .B \-m
47 .I reserved-blocks-percentage
48 ]
49 [
50 .B \-o
51 .I creator-os
52 ]
53 [
54 .B \-O 
55 .IR feature [,...]
56 ]
57 [
58 .B \-q
59 ]
60 [
61 .B \-r
62 .I fs-revision-level
63 ]
64 [
65 .B \-R
66 .I raid_options
67 ]
68 [
69 .B \-s
70 .I sparse-super-flag
71 ]
72 [
73 .B \-v
74 ]
75 [
76 .B \-F
77 ]
78 [
79 .B \-L
80 .I volume-label
81 ]
82 [
83 .B \-M
84 .I last-mounted-directory
85 ]
86 [
87 .B \-S
88 ]
89 [
90 .B \-T
91 .I filesystem-type
92 ]
93 [
94 .B \-V
95 ]
96 .I device
97 [
98 .I blocks-count
99 ]
100 .SH DESCRIPTION
101 .B mke2fs
102 is used to create a Linux second extended file system on a device (usually
103 a disk partition).
104 .I device
105 is the special file corresponding to the device (e.g 
106 .IR /dev/hdXX ).
107 .I blocks-count
108 is the number of blocks on the device.  If omitted,
109 .B mke2fs
110 automagically figures the file system size.
111 .SH OPTIONS
112 .TP
113 .BI \-b " block-size"
114 Specify the size of blocks in bytes.  Valid block size vales are 1024, 
115 2048 and 4096 bytes per block.  If omitted,
116 .B mke2fs
117 block-size is determined by the file system size and the expected usage
118 of the filesystem (see the
119 .B \-T
120 option).
121 .TP
122 .B \-c
123 Check the device for bad blocks before creating the file system, using a
124 fast read-only test.
125 .TP
126 .BI \-f " fragment-size"
127 Specify the size of fragments in bytes.
128 .TP
129 .BI \-i " bytes-per-inode"
130 Specify the bytes/inode ratio. 
131 .B mke2fs
132 creates an inode for every
133 .I bytes-per-inode
134 bytes of space on the disk.  
135 The larger the 
136 .I bytes-per-inode
137 ratio, the fewer inodes will be created.
138 This value generally shouldn't be smaller than
139 the blocksize of the filesystem, since then too many inodes will be made.  
140 Be warned that is not possible to expand the number of inodes on a 
141 filesystem after it is created, so be careful deciding the correct
142 value for this parameter. 
143 .TP 
144 .B -j
145 Build the ext2 filesystem with the ext3 journaling feature enabled.  
146 If the 
147 .B \-J
148 option is not specified, the default journal parameters will used will create
149 an appropriately sized journal (given the size of the filesystem) 
150 stored internally in the filesystem.
151 .TP
152 .BI \-J " journal options"
153 Create the ext3 journal using options specified on the command-line.
154 Journal options are comma
155 separated, and may take an argument using the equals ('=')  sign.
156 Currently two (mutually exclusive) options are supported,
157 .I size
158 and
159 .IR device .
160 .TP
161 .BI "\-J size=" journal-size
162 Create a journal stored in the filesystem of size
163 .IR journal-size .
164 The size of the journal must be at least 1024 filesystem blocks 
165 (i.e., 1MB if using 1k blocks, 4MB if using 4k blocks, etc.) 
166 and may be no more than 10,240 filesystem blocks.  
167 The journal must fit within the newly created filesystem.  
168 .TP
169 .BI "\-J device=" external-journal
170 Add an external journal found on a block device
171 named by 
172 .I external-journal 
173 to the filesystem.
174 The external 
175 journal must have been already created using the command
176 .B mke2fs -O journal_dev 
177 .IR journal-device.
178 .TP
179 .B \-n
180 causes mke2fs to not actually create a filesystem, but display what it 
181 would do if it were to create a filesystem.
182 .TP
183 .BI \-N " number-of-inodes"
184 overrides the default calculation of the number of inodes that should be 
185 reserved for the filesystem (which is based on the number of blocks and 
186 the 
187 .I bytes-per-inode
188 ratio).  This allows the user to specify the number 
189 of desired inodes directly.
190 .TP
191 .BI \-O " feature\fR[,...]"
192 Create the filesystem with the listed set of features 
193 (filesystem options).  The following features are supported: 
194 .IR sparse_super ,
195 which cause the filesystem to use sparse superblocks, and
196 .IR filetype ,
197 which will cause the filesystem to store file type information in 
198 directory entries.   Currently, both features are turned on by default
199 unless 
200 .B mke2fs
201 is run on a system with a pre-2.2 Linux kernel.
202 .B Warning:
203 Pre-2.2 Linux kernels do not properly 
204 support the filesystems that use either of these two features.   Filesystems 
205 that may need to mounted on pre-2.2 kernels should be created with 
206 .B -O
207 .I none
208 which will disable both of these features, even if 
209 .B mke2fs 
210 is run on a system which can support these features.
211 .TP
212 .BI \-l " filename"
213 Read the bad blocks list from
214 .I filename.
215 \.
216 .TP
217 .BI -m " reserved-blocks-percentage"
218 Specify the percentage of reserved blocks for the super-user.  This value
219 defaults to 5%.
220 .\" .TP
221 .\" .BI \-t " test"
222 .\" Check the device for bad blocks before creating the file system
223 .\" using the specified test.
224 .TP
225 .B \-o
226 Manually override the default value of the "creator os" field of the 
227 filesystem.  Normally the creator field is set by default to the native OS
228 of the
229 .B mke2fs
230 executable.
231 .TP
232 .B \-q
233 Quiet execution.  Useful if 
234 .B mke2fs
235 is run in a script.
236 .TP
237 .BI \-s " sparse-super-flag"
238 If 
239 .I sparse-super-flag
240 is 1, then turn on the sparse superblock flag in the superblock.  
241 .B Note:
242 This option is deprecated; use the 
243 .B \-O
244 option instead.
245 .TP
246 .B \-v
247 Verbose execution.
248 .TP
249 .B \-F
250 Force 
251 .B mke2fs
252 to run, even if the specified device is not a 
253 block special device, or appears to be mounted.
254 .TP
255 .B \-L
256 Set the volume label for the filesystem.
257 .TP
258 .B \-M
259 Set the last mounted directory for the filesystem.  This might be useful 
260 for the sake of utilities that key off of the last mounted directory to 
261 determine where the filesytem should be mounted.
262 .TP
263 .BI -r " revision"
264 Set the filesystem revision for the new filesystem.  Note that 1.2
265 kernels only support revision 0 filesystems.
266 .TP
267 .BI \-R " raid_options"
268 Set raid-related options for the filesystem.  Raid options are comma
269 separated, and may take an argument using the equals ('=')  sign.
270 Currently the only supported argument is 
271 .I stride
272 which takes as its argument the number of blocks in a RAID stripe.
273 .TP
274 .B \-S
275 Write superblock and group descriptors only.  This is useful if all of
276 the superblock and backup superblocks are corrupted, and a last-ditch
277 recovery method is desired.  It causes 
278 .B mke2fs
279 to reinitialize the 
280 superblock and group descriptors, while not touching the inode table
281 and the block and inode bitmaps.  The
282 .B e2fsck
283 program should be run immediately after this option is used, and there
284 is no guarantee that any data will be salvageable.
285 .TP
286 .BI \-T " fs-type"
287 Specify how the filesystem is going to be used, so that mke2fs can 
288 chose optimal filesystem parameters for that use.  The only
289 currently supported filesystem types are:
290 .BR news ,
291 which reserves space for  one inode per 4kb block,
292 .BR largefile
293 which allocates one inode per megabyte, and
294 .BR largefile4
295 which allocates one inode per 4 megabytes.  
296 .TP
297 .B \-V
298 Print the version number of 
299 .B mke2fs
300 and exit.
301 .SH AUTHOR
302 This version of
303 .B mke2fs
304 has been written by Theodore Ts'o <tytso@mit.edu>.
305 .SH BUGS
306 .B mke2fs
307 accepts the
308 .B \-f
309 option but currently ignores it because the second
310 extended file system does not support fragments yet.
311 .br
312 There may be some other ones.  Please, report them to the author.
313 .SH AVAILABILITY
314 .B mke2fs
315 is part of the e2fsprogs package and is available for anonymous 
316 ftp from tsx-11.mit.edu in /pub/linux/packages/ext2fs.
317 .SH SEE ALSO
318 .BR badblocks (8),
319 .BR dumpe2fs (8),
320 .BR e2fsck (8),
321 .BR tune2fs (8)