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