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