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