OSDN Git Service

Code drop from //branches/cupcake/...@124589
[android-x86/external-e2fsprogs.git] / misc / tune2fs.8.in
1 .\" Revision 1.0 93/06/3 23:00  chk
2 .\" Initial revision
3 .\"
4 .\"
5 .TH TUNE2FS 8 "@E2FSPROGS_MONTH@ @E2FSPROGS_YEAR@" "E2fsprogs version @E2FSPROGS_VERSION@"
6 .SH NAME
7 tune2fs \- adjust tunable filesystem parameters on ext2/ext3 filesystems
8 .SH SYNOPSIS
9 .B tune2fs
10 [
11 .B \-l
12 ]
13 [
14 .B \-c
15 .I max-mount-counts
16 ]
17 [
18 .B \-e
19 .I errors-behavior
20 ]
21 [
22 .B \-f
23 ]
24 [
25 .B \-i
26 .I interval-between-checks
27 ]
28 [
29 .B \-j
30 ]
31 [
32 .B \-J
33 .I journal-options
34 ]
35 [
36 .B \-m
37 .I reserved-blocks-percentage
38 ]
39 [
40 .B \-o
41 .RI [^]mount-options [,...]
42 ]
43 [
44 .B \-r
45 .I reserved-blocks-count
46 ]
47 [
48 .B \-s
49 .I sparse-super-flag
50 ]
51 [
52 .B \-u
53 .I user
54 ]
55 [
56 .B \-g
57 .I group
58 ]
59 [
60 .B \-C
61 .I mount-count
62 ]
63 [
64 .B \-E
65 .I extended-options
66 ]
67 [
68 .B \-L
69 .I volume-name
70 ]
71 [
72 .B \-M
73 .I last-mounted-directory
74 ]
75 [
76 .B \-O 
77 .RI [^] feature [,...]
78 ]
79 [
80 .B \-T
81 .I time-last-checked
82 ]
83 [
84 .B \-U
85 .I UUID
86 ]
87 device
88 .SH DESCRIPTION
89 .BI tune2fs
90 allows the system administrator to adjust various tunable filesystem 
91 parameters on Linux ext2/ext3 filesystems.
92 .SH OPTIONS
93 .TP
94 .BI \-c " max-mount-counts"
95 Adjust the number of mounts after which the filesystem will be checked by 
96 .BR e2fsck (8).  
97 If
98 .I max-mount-counts
99 is 0 or \-1, the number of times the filesystem is mounted will be disregarded 
100 by
101 .BR e2fsck (8)
102 and the kernel.
103 .sp
104 Staggering the mount-counts at which filesystems are forcibly
105 checked will avoid all filesystems being checked at one time
106 when using journaled filesystems.
107 .sp
108 You should strongly consider the consequences of disabling
109 mount-count-dependent checking entirely.  Bad disk drives, cables,
110 memory, and kernel bugs could all corrupt a filesystem without
111 marking the filesystem dirty or in error.  If you are using
112 journaling on your filesystem, your filesystem will
113 .B never
114 be marked dirty, so it will not normally be checked.  A
115 filesystem error detected by the kernel will still force
116 an fsck on the next reboot, but it may already be too late
117 to prevent data loss at that point.
118 .sp
119 See also the
120 .B \-i
121 option for time-dependent checking.
122 .TP
123 .BI \-C " mount-count"
124 Set the number of times the filesystem has been mounted.
125 If set to a greater value than the max-mount-counts parameter
126 set by the 
127 .B \-c
128 option,
129 .BR e2fsck (8) 
130 will check the filesystem at the next reboot.
131 .TP
132 .BI \-e " error-behavior"
133 Change the behavior of the kernel code when errors are detected.
134 In all cases, a filesystem error will cause
135 .BR e2fsck (8)
136 to check the filesystem on the next boot.
137 .I error-behavior
138 can be one of the following:
139 .RS 1.2i
140 .TP 1.2i
141 .B continue
142 Continue normal execution.
143 .TP
144 .B remount-ro
145 Remount filesystem read-only.
146 .TP
147 .B panic
148 Cause a kernel panic.
149 .RE
150 .TP
151 .BI \-E " extended-options"
152 Set extended options for the filesystem.  Extended options are comma
153 separated, and may take an argument using the equals ('=') sign.
154 The following extended options are supported:
155 .RS 1.2i
156 .TP
157 .BI stride= stride-size
158 Configure the filesystem for a RAID array with
159 .I stride-size
160 filesystem blocks. This is the number of blocks read or written to disk
161 before moving to next disk. This mostly affects placement of filesystem
162 metadata like bitmaps at
163 .BR mke2fs (2)
164 time to avoid placing them on a single disk, which can hurt the performanace.
165 It may also be used by block allocator.
166 .TP
167 .BI stripe-width= stripe-width
168 Configure the filesystem for a RAID array with
169 .I stripe-width
170 filesystem blocks per stripe. This is typically be stride-size * N, where
171 N is the number of data disks in the RAID (e.g. RAID 5 N+1, RAID 6 N+2).
172 This allows the block allocator to prevent read-modify-write of the
173 parity in a RAID stripe if possible when the data is written.
174 .TP
175 .B test_fs
176 Set a flag in the filesystem superblock indicating that it may be
177 mounted using experimental kernel code, such as the ext4dev filesystem.
178 .TP
179 .B ^test_fs
180 Clear the test_fs flag, indicating the filesystem should only be mounted
181 using production-level filesystem code.
182 .RE
183 .TP
184 .B \-f
185 Force the tune2fs operation to complete even in the face of errors.  This 
186 option is useful when removing the 
187 .B has_journal
188 filesystem feature from a filesystem which has 
189 an external journal (or is corrupted
190 such that it appears to have an external journal), but that 
191 external journal is not available.   
192 .sp
193 .B WARNING:
194 Removing an external journal from a filesystem which was not cleanly unmounted
195 without first replaying the external journal can result in
196 severe data loss and filesystem corruption.
197 .TP
198 .BI \-g " group"
199 Set the group which can use the reserved filesystem blocks.
200 The 
201 .I group
202 parameter can be a numerical gid or a group name.  If a group name is given,
203 it is converted to a numerical gid before it is stored in the superblock.
204 .TP
205 .B \-i " \fIinterval-between-checks\fR[\fBd\fR|\fBm\fR|\fBw\fR]"
206 Adjust the maximal time between two filesystem checks. 
207 No postfix or
208 .B d
209 result in days,
210 .B m
211 in months, and
212 .B w
213 in weeks.  A value of zero will disable the time-dependent checking.
214 .sp
215 It is strongly recommended that either
216 .B \-c
217 (mount-count-dependent) or
218 .B \-i
219 (time-dependent) checking be enabled to force periodic full
220 .BR e2fsck (8)
221 checking of the filesystem.  Failure to do so may lead to filesystem
222 corruption (due to bad disks, cables, memory, or kernel bugs) going
223 unnoticed, ultimately resulting in data loss or corruption.
224 .TP
225 .B \-j
226 Add an ext3 journal to the filesystem.  If the 
227 .B \-J
228 option is not specified, the default journal parameters will be used to create
229 an appropriately sized journal (given the size of the filesystem) 
230 stored within the filesystem.  Note that you must be using a kernel
231 which has ext3 support in order to actually make use of the journal.
232 .IP
233 If this option is used to create a journal on a mounted filesystem, an
234 immutable file,
235 .BR .journal ,
236 will be created in the top-level directory of the filesystem, as it is
237 the only safe way to create the journal inode while the filesystem is
238 mounted.  While the ext3 journal is visible, it is not safe to
239 delete it, or modify it while the filesystem is mounted; for this
240 reason the file is marked immutable.
241 While checking unmounted filesystems, 
242 .BR e2fsck (8)
243 will automatically move 
244 .B .journal
245 files to the invisible, reserved journal inode.  For all filesystems
246 except for the root filesystem,  this should happen automatically and
247 naturally during the next reboot cycle.  Since the root filesystem is
248 mounted read-only,
249 .BR e2fsck (8)
250 must be run from a rescue floppy in order to effect this transition.
251 .IP
252 On some distributions, such as Debian, if an initial ramdisk is used,
253 the initrd scripts will automatically convert an ext2 root filesystem
254 to ext3 if the  
255 .BR /etc/fstab
256 file specifies the ext3 filesystem for the root filesystem in order to
257 avoid requiring the use of a rescue floppy to add an ext3 journal to
258 the root filesystem.
259 .TP
260 .BR \-J " journal-options"
261 Override the default ext3 journal parameters. Journal options are comma
262 separated, and may take an argument using the equals ('=')  sign.
263 The following journal options are supported:
264 .RS 1.2i
265 .TP
266 .BI size= journal-size
267 Create a journal stored in the filesystem of size
268 .I journal-size
269 megabytes.   The size of the journal must be at least 1024 filesystem blocks
270 (i.e., 1MB if using 1k blocks, 4MB if using 4k blocks, etc.)
271 and may be no more than 102,400 filesystem blocks.
272 There must be enough free space in the filesystem to create a journal of
273 that size.
274 @JDEV@.TP
275 @JDEV@.BI device= external-journal
276 @JDEV@Attach the filesystem to the journal block device located on
277 @JDEV@.IR external-journal .
278 @JDEV@The external 
279 @JDEV@journal must have been already created using the command
280 @JDEV@.IP
281 @JDEV@.B mke2fs -O journal_dev 
282 @JDEV@.I external-journal
283 @JDEV@.IP
284 @JDEV@Note that
285 @JDEV@.I external-journal
286 @JDEV@must be formatted with the same block
287 @JDEV@size as filesystems which will be using it.
288 @JDEV@In addition, while there is support for attaching
289 @JDEV@multiple filesystems to a single external journal,
290 @JDEV@the Linux kernel and 
291 @JDEV@.BR e2fsck (8)
292 @JDEV@do not currently support shared external journals yet.
293 @JDEV@.IP
294 @JDEV@Instead of specifying a device name directly,
295 @JDEV@.I external-journal
296 @JDEV@can also be specified by either
297 @JDEV@.BI LABEL= label
298 @JDEV@or
299 @JDEV@.BI UUID= UUID
300 @JDEV@to locate the external journal by either the volume label or UUID
301 @JDEV@stored in the ext2 superblock at the start of the journal.  Use
302 @JDEV@.BR dumpe2fs (8)
303 @JDEV@to display a journal device's volume label and UUID.  See also the
304 @JDEV@.B -L
305 @JDEV@option of
306 @JDEV@.BR tune2fs (8).
307 .RE
308 @JDEV@.IP
309 @JDEV@Only one of the
310 @JDEV@.BR size " or " device
311 @JDEV@options can be given for a filesystem.
312 .TP
313 .B \-l
314 List the contents of the filesystem superblock.
315 .TP
316 .BI \-L " volume-label"
317 Set the volume label of the filesystem.  
318 Ext2 filesystem labels can be at most 16 characters long; if
319 .I volume-label 
320 is longer than 16 characters, 
321 .B tune2fs
322 will truncate it and print a warning.  The volume label can be used
323 by
324 .BR mount (8),
325 .BR fsck (8),
326 and
327 .BR /etc/fstab (5)
328 (and possibly others) by specifying
329 .BI LABEL= volume_label
330 instead of a block special device name like
331 .BR /dev/hda5 .
332 .TP
333 .BI \-m " reserved-blocks-percentage"
334 Set the percentage of the filesystem which may only be allocated
335 by privileged processes.   Reserving some number of filesystem blocks 
336 for use by privileged processes is done 
337 to avoid filesystem fragmentation, and to allow system
338 daemons, such as 
339 .BR syslogd (8),
340 to continue to function correctly after non-privileged processes are 
341 prevented from writing to the filesystem.  Normally, the default percentage 
342 of reserved blocks is 5%.
343 .TP
344 .BI \-M " last-mounted-directory"
345 Set the last-mounted directory for the filesystem.
346 .TP
347 .BR \-o " [^]\fImount-option\fR[,...]"
348 Set or clear the indicated default mount options in the filesystem.
349 Default mount options can be overridden by mount options specified 
350 either in 
351 .BR /etc/fstab (5)
352 or on the command line arguments to
353 .BR mount (8).   
354 Older kernels may not support this feature; in particular,
355 kernels which predate 2.4.20 will almost certainly ignore the
356 default mount options field in the superblock.
357 .IP
358 More than one mount option can be cleared or set by separating
359 features with commas.  Mount options prefixed with a 
360 caret character ('^') will be cleared in the filesystem's superblock; 
361 mount options without a prefix character or prefixed with a plus 
362 character ('+') will be added to the filesystem.
363 .IP
364 The following mount options can be set or cleared using
365 .BR tune2fs :
366 .RS 1.2i
367 .TP
368 .B debug
369 Enable debugging code for this filesystem.
370 .TP
371 .B bsdgroups
372 Emulate BSD behaviour when creating new files: they will take the group-id
373 of the directory in which they were created.  The standard System V behaviour
374 is the default, where newly created files take on the fsgid of the current
375 process, unless the directory has the setgid bit set, in which case it takes 
376 the gid from the parent directory, and also gets the setgid bit set if it is 
377 a directory itself.
378 .TP
379 .B user_xattr
380 Enable user-specified extended attributes.
381 .TP
382 .B acl
383 Enable Posix Access Control Lists.
384 .TP
385 .B uid16
386 Disables 32-bit UIDs and GIDs.  This is for interoperability with
387 older kernels which only store and expect 16-bit values.
388 .TP
389 .B journal_data
390 When the filesystem is mounted with journalling enabled, all data
391 (not just metadata) is committed into the journal prior to being written
392 into the main filesystem.
393 .TP
394 .B journal_data_ordered
395 When the filesystem is mounted with journalling enabled, all data is forced
396 directly out to the main file system prior to its metadata being committed 
397 to the journal.
398 .TP
399 .B journal_data_writeback
400 When the filesystem is mounted with journalling enabled, data may be
401 written into the main filesystem after its metadata has been committed
402 to the journal.  This may increase throughput, however, it may allow old
403 data to appear in files after a crash and journal recovery.
404 .RE
405 .TP
406 .BR \-O " [^]\fIfeature\fR[,...]"
407 Set or clear the indicated filesystem features (options) in the filesystem.
408 More than one filesystem feature can be cleared or set by separating
409 features with commas.  Filesystem features prefixed with a 
410 caret character ('^') will be cleared in the filesystem's superblock; 
411 filesystem features without a prefix character or prefixed with a plus 
412 character ('+') will be added to the filesystem.
413 .IP
414 The following filesystem features can be set or cleared using
415 .BR tune2fs :
416 .RS 1.2i
417 .TP
418 .B large_file
419 Filesystem can contain files that are greater than 2GB.  (Modern kernels
420 set this feature automatically when a file > 2GB is created.)
421 .TP
422 .B dir_index
423 Use hashed b-trees to speed up lookups in large directories.
424 .TP
425 .B filetype
426 Store file type information in directory entries.
427 .TP
428 .B has_journal
429 Use a journal to ensure filesystem consistency even across unclean shutdowns.
430 Setting the filesystem feature is equivalent to using the 
431 .B \-j
432 option.
433 .TP
434 .B sparse_super
435 Limit the number of backup superblocks to save space on large filesystems.
436 .TP
437 .B resize_inode
438 Reserve space so the block group descriptor table may grow in the
439 future.
440 .B Tune2fs 
441 only supports clearing this filesystem feature.
442 .RE
443 .IP
444 After setting or clearing 
445 .BR sparse_super ,
446 .BR filetype ,
447 or
448 .B resize_inode
449 filesystem features,
450 .BR e2fsck (8)
451 must be run on the filesystem to return the filesystem to a consistent state.
452 .B Tune2fs
453 will print a message requesting that the system administrator run
454 .BR e2fsck (8)
455 if necessary.  After setting the 
456 .B dir_index
457 feature, 
458 .B e2fsck -D
459 can be run to convert existing directories to the hashed B-tree format.
460 .TP
461 .BI \-r " reserved-blocks-count"
462 Set the number of reserved filesystem blocks.
463 .TP
464 .BI \-T " time-last-checked"
465 Set the time the filesystem was last checked using
466 .BR  e2fsck .
467 This can be useful in scripts which use a Logical Volume Manager to make
468 a consistent snapshot of a filesystem, and then check the filesystem 
469 during off hours to make sure it hasn't been corrupted due to 
470 hardware problems, etc.  If the filesystem was clean, then this option can 
471 be used to set the last checked time on the original filesystem.  The format 
472 of 
473 .I time-last-checked
474 is the international date format, with an optional time specifier, i.e.
475 YYYYMMDD[HH[MM[SS]]].   The keyword 
476 .B now
477 is also accepted, in which case the last checked time will be set to the 
478 current time.
479 .TP
480 .BI \-u " user"
481 Set the user who can use the reserved filesystem blocks.
482 .I user
483 can be a numerical uid or a user name.  If a user name is given, it 
484 is converted to a numerical uid before it is stored in the superblock.
485 .TP
486 .BI \-U " UUID"
487 Set the universally unique identifier (UUID) of the filesystem to
488 .IR UUID .
489 The format of the UUID is a series of hex digits separated by hyphens, 
490 like this: 
491 "c1b9d5a2-f162-11cf-9ece-0020afc76f16".  
492 The 
493 .I UUID
494 parameter may also be one of the following:
495 .RS 1.2i
496 .TP
497 .I clear
498 clear the filesystem UUID
499 .TP
500 .I random
501 generate a new randomly-generated UUID
502 .TP
503 .I time
504 generate a new time-based UUID
505 .RE
506 .IP
507 The UUID may be used by
508 .BR mount (8),
509 .BR fsck (8),
510 and
511 .BR /etc/fstab (5)
512 (and possibly others) by specifying
513 .BI UUID= uuid
514 instead of a block special device name like
515 .BR /dev/hda1 .
516 .IP
517 See
518 .BR uuidgen (8)
519 for more information.
520 If the system does not have a good random number generator such as
521 .I /dev/random
522 or
523 .IR /dev/urandom ,
524 .B tune2fs
525 will automatically use a time-based UUID instead of a randomly-generated UUID.
526 .SH BUGS
527 We haven't found any bugs yet.  That doesn't mean there aren't any...
528 .SH AUTHOR
529 .B tune2fs 
530 was written by Remy Card <Remy.Card@linux.org>.  It is currently being
531 maintained by Theodore Ts'o <tytso@alum.mit.edu>.
532 .B tune2fs
533 uses the ext2fs library written by Theodore Ts'o <tytso@mit.edu>.
534 This manual page was written by Christian Kuhtz <chk@data-hh.Hanse.DE>.
535 Time-dependent checking was added by Uwe Ohse <uwe@tirka.gun.de>.
536 .SH AVAILABILITY
537 .B tune2fs
538 is part of the e2fsprogs package and is available from 
539 http://e2fsprogs.sourceforge.net.
540 .SH SEE ALSO
541 .BR debugfs (8),
542 .BR dumpe2fs (8),
543 .BR e2fsck (8),
544 .BR mke2fs (8)