1TUNE2FS(8) System Manager's Manual TUNE2FS(8)
2
3
4
6 tune2fs - adjust tunable file system parameters on ext2/ext3/ext4 file
7 systems
8
10 tune2fs [ -l ] [ -c max-mount-counts ] [ -e errors-behavior ] [ -f ] [
11 -i interval-between-checks ] [ -I new_inode_size ] [ -j ] [ -J journal-
12 options ] [ -m reserved-blocks-percentage ] [ -o [^]mount-options[,...]
13 ] [ -r reserved-blocks-count ] [ -u user ] [ -g group ] [ -C mount-
14 count ] [ -E extended-options ] [ -L volume-label ] [ -M last-mounted-
15 directory ] [ -O [^]feature[,...] ] [ -Q quota-options ] [ -T time-
16 last-checked ] [ -U UUID ] [ -z undo_file ] device
17
19 tune2fs allows the system administrator to adjust various tunable file
20 system parameters on Linux ext2, ext3, or ext4 file systems. The cur‐
21 rent values of these options can be displayed by using the -l option to
22 tune2fs(8) program, or by using the dumpe2fs(8) program.
23
24 The device specifier can either be a filename (i.e., /dev/sda1), or a
25 LABEL or UUID specifier: "LABEL=volume-label" or "UUID=uuid". (i.e.,
26 LABEL=home or UUID=e40486c6-84d5-4f2f-b99c-032281799c9d).
27
29 -c max-mount-counts
30 Adjust the number of mounts after which the file system will be
31 checked by e2fsck(8). If max-mount-counts is the string "ran‐
32 dom", tune2fs will use a random value between 20 and 40. If
33 max-mount-counts is 0 or -1, the number of times the file system
34 is mounted will be disregarded by e2fsck(8) and the kernel.
35
36 Staggering the mount-counts at which file systems are forcibly
37 checked will avoid all file systems being checked at one time
38 when using journaled file systems.
39
40 Mount-count-dependent checking is disabled by default to avoid
41 unanticipated long reboots while e2fsck does its work. If you
42 are concerned about file system corruptions caused by potential
43 hardware problems of kernel bugs, a better solution than mount-
44 count-dependent checking is to use the e2scrub(8) program. This
45 does require placing the file system on an LVM volume, however.
46
47 -C mount-count
48 Set the number of times the file system has been mounted. If
49 set to a greater value than the max-mount-counts parameter set
50 by the -c option, e2fsck(8) will check the file system at the
51 next reboot.
52
53 -e error-behavior
54 Change the behavior of the kernel code when errors are detected.
55 In all cases, a file system error will cause e2fsck(8) to check
56 the file system on the next boot. error-behavior can be one of
57 the following:
58
59 continue Continue normal execution.
60
61 remount-ro Remount file system read-only.
62
63 panic Cause a kernel panic.
64
65 -E extended-options
66 Set extended options for the file system. Extended options are
67 comma separated, and may take an argument using the equals ('=')
68 sign. The following extended options are supported:
69
70 clear_mmp
71 Reset the MMP block (if any) back to the clean
72 state. Use only if absolutely certain the device is
73 not currently mounted or being fscked, or major file
74 system corruption can result. Needs '-f'.
75
76 mmp_update_interval=interval
77 Adjust the initial MMP update interval to interval
78 seconds. Specifying an interval of 0 means to use
79 the default interval. The specified interval must
80 be less than 300 seconds. Requires that the mmp
81 feature be enabled.
82
83 stride=stride-size
84 Configure the file system for a RAID array with
85 stride-size file system blocks. This is the number
86 of blocks read or written to disk before moving to
87 next disk. This mostly affects placement of file
88 system metadata like bitmaps at mke2fs(2) time to
89 avoid placing them on a single disk, which can hurt
90 the performance. It may also be used by block allo‐
91 cator.
92
93 stripe_width=stripe-width
94 Configure the file system for a RAID array with
95 stripe-width file system blocks per stripe. This is
96 typically be stride-size * N, where N is the number
97 of data disks in the RAID (e.g. RAID 5 N+1, RAID 6
98 N+2). This allows the block allocator to prevent
99 read-modify-write of the parity in a RAID stripe if
100 possible when the data is written.
101
102 hash_alg=hash-alg
103 Set the default hash algorithm used for file systems
104 with hashed b-tree directories. Valid algorithms
105 accepted are: legacy, half_md4, and tea.
106
107 encoding=encoding-name
108 Enable the casefold feature in the super block and
109 set encoding-name as the encoding to be used. If
110 encoding-name is not specified, utf8 is used. The
111 encoding cannot be altered if casefold was previ‐
112 ously enabled.
113
114 encoding_flags=encoding-flags
115 Define parameters for file name character encoding
116 operations. If a flag is not changed using this pa‐
117 rameter, its default value is used. encoding-flags
118 should be a comma-separated lists of flags to be en‐
119 abled. The flags cannot be altered if casefold was
120 previously enabled.
121
122 The only flag that can be set right now is strict
123 which means that invalid strings should be rejected
124 by the file system. In the default configuration,
125 the strict flag is disabled.
126
127 mount_opts=mount_option_string
128 Set a set of default mount options which will be
129 used when the file system is mounted. Unlike the
130 bitmask-based default mount options which can be
131 specified with the -o option, mount_option_string is
132 an arbitrary string with a maximum length of 63
133 bytes, which is stored in the superblock.
134
135 The ext4 file system driver will first apply the
136 bitmask-based default options, and then parse the
137 mount_option_string, before parsing the mount op‐
138 tions passed from the mount(8) program.
139
140 This superblock setting is only honored in 2.6.35+
141 kernels; and not at all by the ext2 and ext3 file
142 system drivers.
143
144 orphan_file_size=size
145 Set size of the file for tracking unlinked but still
146 open inodes and inodes with truncate in progress.
147 Larger file allows for better scalability, reserving
148 a few blocks per cpu is ideal.
149
150 force_fsck
151 Set a flag in the file system superblock indicating
152 that errors have been found. This will force fsck
153 to run at the next mount.
154
155 test_fs
156 Set a flag in the file system superblock indicating
157 that it may be mounted using experimental kernel
158 code, such as the ext4dev file system.
159
160 ^test_fs
161 Clear the test_fs flag, indicating the file system
162 should only be mounted using production-level file
163 system code.
164
165 -f Force the tune2fs operation to complete even in the face of er‐
166 rors. This option is useful when removing the has_journal file
167 system feature from a file system which has an external journal
168 (or is corrupted such that it appears to have an external jour‐
169 nal), but that external journal is not available. If the file
170 system appears to require journal replay, the -f flag must be
171 specified twice to proceed.
172
173 WARNING: Removing an external journal from a file system which
174 was not cleanly unmounted without first replaying the external
175 journal can result in severe data loss and file system corrup‐
176 tion.
177
178 -g group
179 Set the group which can use the reserved file system blocks.
180 The group parameter can be a numerical gid or a group name. If
181 a group name is given, it is converted to a numerical gid before
182 it is stored in the superblock.
183
184 -i interval-between-checks[d|m|w]
185 Adjust the maximal time between two file system checks. No suf‐
186 fix or d will interpret the number interval-between-checks as
187 days, m as months, and w as weeks. A value of zero will disable
188 the time-dependent checking.
189
190 There are pros and cons to disabling these periodic checks; see
191 the discussion under the -c (mount-count-dependent check) option
192 for details.
193
194 -I Change the inode size used by the file system. This requires
195 rewriting the inode table, so it requires that the file system
196 is checked for consistency first using e2fsck(8). This opera‐
197 tion can also take a while and the file system can be corrupted
198 and data lost if it is interrupted while in the middle of con‐
199 verting the file system. Backing up the file system before
200 changing inode size is recommended.
201
202 File systems with an inode size of 128 bytes do not support
203 timestamps beyond January 19, 2038. Inodes which are 256 bytes
204 or larger will support extended timestamps, project id's, and
205 the ability to store some extended attributes in the inode table
206 for improved performance.
207
208 -j Add an ext3 journal to the file system. If the -J option is not
209 specified, the default journal parameters will be used to create
210 an appropriately sized journal (given the size of the file sys‐
211 tem) stored within the file system. Note that you must be using
212 a kernel which has ext3 support in order to actually make use of
213 the journal.
214
215 If this option is used to create a journal on a mounted file
216 system, an immutable file, .journal, will be created in the top-
217 level directory of the file system, as it is the only safe way
218 to create the journal inode while the file system is mounted.
219 While the ext3 journal is visible, it is not safe to delete it,
220 or modify it while the file system is mounted; for this reason
221 the file is marked immutable. While checking unmounted file
222 systems, e2fsck(8) will automatically move .journal files to the
223 invisible, reserved journal inode. For all file systems except
224 for the root file system, this should happen automatically and
225 naturally during the next reboot cycle. Since the root file
226 system is mounted read-only, e2fsck(8) must be run from a rescue
227 floppy in order to effect this transition.
228
229 On some distributions, such as Debian, if an initial ramdisk is
230 used, the initrd scripts will automatically convert an ext2 root
231 file system to ext3 if the /etc/fstab file specifies the ext3
232 file system for the root file system in order to avoid requiring
233 the use of a rescue floppy to add an ext3 journal to the root
234 file system.
235
236 -J journal-options
237 Override the default ext3 journal parameters. Journal options
238 are comma separated, and may take an argument using the equals
239 ('=') sign. The following journal options are supported:
240
241 size=journal-size
242 Create a journal stored in the file system of size
243 journal-size megabytes. The size of the journal
244 must be at least 1024 file system blocks (i.e., 1MB
245 if using 1k blocks, 4MB if using 4k blocks, etc.)
246 and may be no more than 10,240,000 file system
247 blocks. There must be enough free space in the file
248 system to create a journal of that size.
249
250 fast_commit_size=fast-commit-size
251 Create an additional fast commit journal area of
252 size fast-commit-size kilobytes. This option is
253 only valid if fast_commit feature is enabled on the
254 file system. If this option is not specified and if
255 fast_commit feature is turned on, fast commit area
256 size defaults to journal-size / 64 megabytes. The
257 total size of the journal with fast_commit feature
258 set is journal-size + ( fast-commit-size * 1024)
259 megabytes. The total journal size may be no more
260 than 10,240,000 file system blocks or half the total
261 file system size (whichever is smaller).
262
263 location=journal-location
264 Specify the location of the journal. The argument
265 journal-location can either be specified as a block
266 number, or if the number has a units suffix (e.g.,
267 'M', 'G', etc.) interpret it as the offset from the
268 beginning of the file system.
269
270 device=external-journal
271 Attach the file system to the journal block device
272 located on external-journal. The external journal
273 must have been already created using the command
274
275 mke2fs -O journal_dev external-journal
276
277 Note that external-journal must be formatted with
278 the same block size as file systems which will be
279 using it. In addition, while there is support for
280 attaching multiple file systems to a single external
281 journal, the Linux kernel and e2fsck(8) do not cur‐
282 rently support shared external journals yet.
283
284 Instead of specifying a device name directly, exter‐
285 nal-journal can also be specified by either LA‐
286 BEL=label or UUID=UUID to locate the external jour‐
287 nal by either the volume label or UUID stored in the
288 ext2 superblock at the start of the journal. Use
289 dumpe2fs(8) to display a journal device's volume la‐
290 bel and UUID. See also the -L option of tune2fs(8).
291
292 Only one of the size or device options can be given for a file
293 system.
294
295 -l List the contents of the file system superblock, including the
296 current values of the parameters that can be set via this pro‐
297 gram.
298
299 -L volume-label
300 Set the volume label of the file system. Ext2 file system la‐
301 bels can be at most 16 characters long; if volume-label is
302 longer than 16 characters, tune2fs will truncate it and print a
303 warning. For other file systems that support online label ma‐
304 nipulation and are mounted tune2fs will work as well, but it
305 will not attempt to truncate the volume-label at all. The vol‐
306 ume label can be used by mount(8), fsck(8), and /etc/fstab(5)
307 (and possibly others) by specifying LABEL=volume-label instead
308 of a block special device name like /dev/hda5.
309
310 -m reserved-blocks-percentage
311 Set the percentage of the file system which may only be allo‐
312 cated by privileged processes. Reserving some number of file
313 system blocks for use by privileged processes is done to avoid
314 file system fragmentation, and to allow system daemons, such as
315 syslogd(8), to continue to function correctly after non-privi‐
316 leged processes are prevented from writing to the file system.
317 Normally, the default percentage of reserved blocks is 5%.
318
319 -M last-mounted-directory
320 Set the last-mounted directory for the file system.
321
322 -o [^]mount-option[,...]
323 Set or clear the indicated default mount options in the file
324 system. Default mount options can be overridden by mount op‐
325 tions specified either in /etc/fstab(5) or on the command line
326 arguments to mount(8). Older kernels may not support this fea‐
327 ture; in particular, kernels which predate 2.4.20 will almost
328 certainly ignore the default mount options field in the su‐
329 perblock.
330
331 More than one mount option can be cleared or set by separating
332 features with commas. Mount options prefixed with a caret char‐
333 acter ('^') will be cleared in the file system's superblock;
334 mount options without a prefix character or prefixed with a plus
335 character ('+') will be added to the file system.
336
337 The following mount options can be set or cleared using tune2fs:
338
339 debug Enable debugging code for this file system.
340
341 bsdgroups
342 Emulate BSD behavior when creating new files: they
343 will take the group-id of the directory in which
344 they were created. The standard System V behavior
345 is the default, where newly created files take on
346 the fsgid of the current process, unless the direc‐
347 tory has the setgid bit set, in which case it takes
348 the gid from the parent directory, and also gets the
349 setgid bit set if it is a directory itself.
350
351 user_xattr
352 Enable user-specified extended attributes.
353
354 acl Enable Posix Access Control Lists.
355
356 uid16 Disables 32-bit UIDs and GIDs. This is for interop‐
357 erability with older kernels which only store and
358 expect 16-bit values.
359
360 journal_data
361 When the file system is mounted with journaling en‐
362 abled, all data (not just metadata) is committed
363 into the journal prior to being written into the
364 main file system.
365
366 journal_data_ordered
367 When the file system is mounted with journaling en‐
368 abled, all data is forced directly out to the main
369 file system prior to its metadata being committed to
370 the journal.
371
372 journal_data_writeback
373 When the file system is mounted with journaling en‐
374 abled, data may be written into the main file system
375 after its metadata has been committed to the jour‐
376 nal. This may increase throughput, however, it may
377 allow old data to appear in files after a crash and
378 journal recovery.
379
380 nobarrier
381 The file system will be mounted with barrier opera‐
382 tions in the journal disabled. (This option is cur‐
383 rently only supported by the ext4 file system driver
384 in 2.6.35+ kernels.)
385
386 block_validity
387 The file system will be mounted with the block_va‐
388 lidity option enabled, which causes extra checks to
389 be performed after reading or writing from the file
390 system. This prevents corrupted metadata blocks
391 from causing file system damage by overwriting parts
392 of the inode table or block group descriptors. This
393 comes at the cost of increased memory and CPU over‐
394 head, so it is enabled only for debugging purposes.
395 (This option is currently only supported by the ext4
396 file system driver in 2.6.35+ kernels.)
397
398 discard
399 The file system will be mounted with the discard
400 mount option. This will cause the file system
401 driver to attempt to use the trim/discard feature of
402 some storage devices (such as SSD's and thin-provi‐
403 sioned drives available in some enterprise storage
404 arrays) to inform the storage device that blocks be‐
405 longing to deleted files can be reused for other
406 purposes. (This option is currently only supported
407 by the ext4 file system driver in 2.6.35+ kernels.)
408
409 nodelalloc
410 The file system will be mounted with the nodelalloc
411 mount option. This will disable the delayed alloca‐
412 tion feature. (This option is currently only sup‐
413 ported by the ext4 file system driver in 2.6.35+
414 kernels.)
415
416 -O [^]feature[,...]
417 Set or clear the indicated file system features (options) in the
418 file system. More than one file system feature can be cleared
419 or set by separating features with commas. File System features
420 prefixed with a caret character ('^') will be cleared in the
421 file system's superblock; file system features without a prefix
422 character or prefixed with a plus character ('+') will be added
423 to the file system. For a detailed description of the file sys‐
424 tem features, please see the man page ext4(5).
425
426 The following file system features can be set or cleared using
427 tune2fs:
428
429 64bit Enable the file system to be larger than 2^32
430 blocks.
431
432 casefold
433 Enable support for file system level casefolding.
434 The option can be cleared only if filesystem has no
435 directories with F attribute.
436
437 dir_index
438 Use hashed b-trees to speed up lookups for large di‐
439 rectories.
440
441 dir_nlink
442 Allow more than 65000 subdirectories per directory.
443
444 ea_inode
445 Allow the value of each extended attribute to be
446 placed in the data blocks of a separate inode if
447 necessary, increasing the limit on the size and num‐
448 ber of extended attributes per file. Tune2fs cur‐
449 rently only supports setting this file system fea‐
450 ture.
451
452 encrypt
453 Enable support for file system level encryption.
454 Tune2fs currently only supports setting this file
455 system feature.
456
457 extent Enable the use of extent trees to store the location
458 of data blocks in inodes. Tune2fs currently only
459 supports setting this file system feature.
460
461 extra_isize
462 Enable the extended inode fields used by ext4.
463
464 filetype
465 Store file type information in directory entries.
466
467 flex_bg
468 Allow bitmaps and inode tables for a block group to
469 be placed anywhere on the storage media. Tune2fs
470 will not reorganize the location of the inode tables
471 and allocation bitmaps, as mke2fs(8) will do when it
472 creates a freshly formatted file system with flex_bg
473 enabled.
474
475 has_journal
476 Use a journal to ensure file system consistency even
477 across unclean shutdowns. Setting the file system
478 feature is equivalent to using the -j option.
479
480
481 fast_commit
482 Enable fast commit journaling feature to improve
483 fsync latency.
484
485 large_dir
486 Increase the limit on the number of files per direc‐
487 tory. Tune2fs currently only supports setting this
488 file system feature.
489
490 huge_file
491 Support files larger than 2 terabytes in size.
492
493 large_file
494 File System can contain files that are greater than
495 2GB.
496
497 metadata_csum
498 Store a checksum to protect the contents in each
499 metadata block.
500
501 metadata_csum_seed
502 Allow the file system to store the metadata checksum
503 seed in the superblock, enabling the administrator
504 to change the UUID of a file system using the meta‐
505 data_csum feature while it is mounted.
506
507 mmp Enable or disable multiple mount protection (MMP)
508 feature.
509
510 project
511 Enable project ID tracking. This is used for
512 project quota tracking.
513
514 quota Enable internal file system quota inodes.
515
516 read-only
517 Force the kernel to mount the file system read-only.
518
519 resize_inode
520 Reserve space so the block group descriptor table
521 may grow in the future. Tune2fs only supports
522 clearing this file system feature.
523
524 sparse_super
525 Limit the number of backup superblocks to save space
526 on large file systems. Tune2fs currently only sup‐
527 ports setting this file system feature.
528
529 stable_inodes
530 Prevent the file system from being shrunk or having
531 its UUID changed, in order to allow the use of spe‐
532 cialized encryption settings that make use of the
533 inode numbers and UUID. Tune2fs currently only sup‐
534 ports setting this file system feature.
535
536 uninit_bg
537 Allow the kernel to initialize bitmaps and inode ta‐
538 bles lazily, and to keep a high watermark for the
539 unused inodes in a file system, to reduce e2fsck(8)
540 time. The first e2fsck run after enabling this fea‐
541 ture will take the full time, but subsequent e2fsck
542 runs will take only a fraction of the original time,
543 depending on how full the file system is.
544
545 verity Enable support for verity protected files. Tune2fs
546 currently only supports setting this file system
547 feature.
548
549 After setting or clearing sparse_super, uninit_bg, filetype, or
550 resize_inode file system features, the file system may require
551 being checked using e2fsck(8) to return the file system to a
552 consistent state. Tune2fs will print a message requesting that
553 the system administrator run e2fsck(8) if necessary. After set‐
554 ting the dir_index feature, e2fsck -D can be run to convert ex‐
555 isting directories to the hashed B-tree format. Enabling cer‐
556 tain file system features may prevent the file system from being
557 mounted by kernels which do not support those features. In par‐
558 ticular, the uninit_bg and flex_bg features are only supported
559 by the ext4 file system.
560
561 -r reserved-blocks-count
562 Set the number of reserved file system blocks.
563
564 -Q quota-options
565 Sets 'quota' feature on the superblock and works on the quota
566 files for the given quota type. Quota options could be one or
567 more of the following:
568
569 [^]usrquota
570 Sets/clears user quota inode in the superblock.
571
572 [^]grpquota
573 Sets/clears group quota inode in the superblock.
574
575 [^]prjquota
576 Sets/clears project quota inode in the superblock.
577
578 -T time-last-checked
579 Set the time the file system was last checked using e2fsck. The
580 time is interpreted using the current (local) timezone. This
581 can be useful in scripts which use a Logical Volume Manager to
582 make a consistent snapshot of a file system, and then check the
583 file system during off hours to make sure it hasn't been cor‐
584 rupted due to hardware problems, etc. If the file system was
585 clean, then this option can be used to set the last checked time
586 on the original file system. The format of time-last-checked is
587 the international date format, with an optional time specifier,
588 i.e. YYYYMMDD[HH[MM[SS]]]. The keyword now is also accepted,
589 in which case the last checked time will be set to the current
590 time.
591
592 -u user
593 Set the user who can use the reserved file system blocks. user
594 can be a numerical uid or a user name. If a user name is given,
595 it is converted to a numerical uid before it is stored in the
596 superblock.
597
598 -U UUID
599 Set the universally unique identifier (UUID) of the file system
600 to UUID. The format of the UUID is a series of hex digits sepa‐
601 rated by hyphens, like this:
602 "c1b9d5a2-f162-11cf-9ece-0020afc76f16". The UUID parameter may
603 also be one of the following:
604
605 clear clear the file system UUID
606
607 random generate a new randomly-generated UUID
608
609 time generate a new time-based UUID
610
611 The UUID may be used by mount(8), fsck(8), and /etc/fstab(5)
612 (and possibly others) by specifying UUID=uuid instead of a block
613 special device name like /dev/hda1.
614
615 See uuidgen(8) for more information. If the system does not
616 have a good random number generator such as /dev/random or
617 /dev/urandom, tune2fs will automatically use a time-based UUID
618 instead of a randomly-generated UUID.
619
620 -z undo_file
621 Before overwriting a file system block, write the old contents
622 of the block to an undo file. This undo file can be used with
623 e2undo(8) to restore the old contents of the file system should
624 something go wrong. If the empty string is passed as the
625 undo_file argument, the undo file will be written to a file
626 named tune2fs-device.e2undo in the directory specified via the
627 E2FSPROGS_UNDO_DIR environment variable.
628
629 WARNING: The undo file cannot be used to recover from a power or
630 system crash.
631
633 We haven't found any bugs yet. That doesn't mean there aren't any...
634
636 tune2fs was written by Remy Card <Remy.Card@linux.org>. It is cur‐
637 rently being maintained by Theodore Ts'o <tytso@alum.mit.edu>. tune2fs
638 uses the ext2fs library written by Theodore Ts'o <tytso@mit.edu>. This
639 manual page was written by Christian Kuhtz <chk@data-hh.Hanse.DE>.
640 Time-dependent checking was added by Uwe Ohse <uwe@tirka.gun.de>.
641
643 tune2fs is part of the e2fsprogs package and is available from
644 http://e2fsprogs.sourceforge.net.
645
647 debugfs(8), dumpe2fs(8), e2fsck(8), mke2fs(8), ext4(5)
648
649
650
651E2fsprogs version 1.47.0 February 2023 TUNE2FS(8)