1TUNE2FS(8) System Manager's Manual TUNE2FS(8)
2
3
4
6 tune2fs - adjust tunable filesystem parameters on ext2/ext3/ext4
7 filesystems
8
10 tune2fs [ -l ] [ -c max-mount-counts ] [ -e errors-behavior ] [ -f ] [
11 -i interval-between-checks ] [ -j ] [ -J journal-options ] [ -m
12 reserved-blocks-percentage ] [ -o [^]mount-options[,...] ] [ -r
13 reserved-blocks-count ] [ -s sparse-super-flag ] [ -u user ] [ -g group
14 ] [ -C mount-count ] [ -E extended-options ] [ -L volume-name ] [ -M
15 last-mounted-directory ] [ -O [^]feature[,...] ] [ -Q quota-options ]
16 [ -T time-last-checked ] [ -U UUID ] device
17
19 tune2fs allows the system administrator to adjust various tunable
20 filesystem parameters on Linux ext2, ext3, or ext4 filesystems. The
21 current values of these options can be displayed by using the -l option
22 to 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-name" 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 filesystem will be
31 checked by e2fsck(8). If max-mount-counts is 0 or -1, the num‐
32 ber of times the filesystem is mounted will be disregarded by
33 e2fsck(8) and the kernel.
34
35 Staggering the mount-counts at which filesystems are forcibly
36 checked will avoid all filesystems being checked at one time
37 when using journaled filesystems.
38
39 Mount-count-dependent checking is disabled by default to avoid
40 unanticipated long reboots while e2fsck does its work. However,
41 you may wish to consider the consequences of disabling mount-
42 count-dependent checking entirely. Bad disk drives, cables,
43 memory, and kernel bugs could all corrupt a filesystem without
44 marking the filesystem dirty or in error. If you are using
45 journaling on your filesystem, your filesystem will never be
46 marked dirty, so it will not normally be checked. A filesystem
47 error detected by the kernel will still force an fsck on the
48 next reboot, but it may already be too late to prevent data loss
49 at that point.
50
51 See also the -i option for time-dependent checking.
52
53 -C mount-count
54 Set the number of times the filesystem has been mounted. If set
55 to a greater value than the max-mount-counts parameter set by
56 the -c option, e2fsck(8) will check the filesystem at the next
57 reboot.
58
59 -e error-behavior
60 Change the behavior of the kernel code when errors are detected.
61 In all cases, a filesystem error will cause e2fsck(8) to check
62 the filesystem on the next boot. error-behavior can be one of
63 the following:
64
65 continue Continue normal execution.
66
67 remount-ro Remount filesystem read-only.
68
69 panic Cause a kernel panic.
70
71 -E extended-options
72 Set extended options for the filesystem. Extended options are
73 comma separated, and may take an argument using the equals ('=')
74 sign. The following extended options are supported:
75
76 clear_mmp
77 Reset the MMP block (if any) back to the clean
78 state. Use only if absolutely certain the device is
79 not currently mounted or being fscked, or major
80 filesystem corruption can result. Needs '-f'.
81
82 mmp_update_interval=interval
83 Adjust the initial MMP update interval to interval
84 seconds. Specifying an interval of 0 means to use
85 the default interval. The specified interval must
86 be less than 300 seconds. Requires that the mmp
87 feature be enabled.
88
89 stride=stride-size
90 Configure the filesystem for a RAID array with
91 stride-size filesystem blocks. This is the number of
92 blocks read or written to disk before moving to next
93 disk. This mostly affects placement of filesystem
94 metadata like bitmaps at mke2fs(2) time to avoid
95 placing them on a single disk, which can hurt the
96 performance. It may also be used by block alloca‐
97 tor.
98
99 stripe_width=stripe-width
100 Configure the filesystem for a RAID array with
101 stripe-width filesystem blocks per stripe. This is
102 typically be stride-size * N, where N is the number
103 of data disks in the RAID (e.g. RAID 5 N+1, RAID 6
104 N+2). This allows the block allocator to prevent
105 read-modify-write of the parity in a RAID stripe if
106 possible when the data is written.
107
108 hash_alg=hash-alg
109 Set the default hash algorithm used for filesystems
110 with hashed b-tree directories. Valid algorithms
111 accepted are: legacy, half_md4, and tea.
112
113 mount_opts=mount_option_string
114 Set a set of default mount options which will be
115 used when the file system is mounted. Unlike the
116 bitmask-based default mount options which can be
117 specified with the -o option, mount_option_string is
118 an arbitrary string with a maximum length of 63
119 bytes, which is stored in the superblock.
120
121 The ext4 file system driver will first apply the
122 bitmask-based default options, and then parse the
123 mount_option_string, before parsing the mount
124 options passed from the mount(8) program.
125
126 This superblock setting is only honored in 2.6.35+
127 kernels; and not at all by the ext2 and ext3 file
128 system drivers.
129
130 test_fs
131 Set a flag in the filesystem superblock indicating
132 that it may be mounted using experimental kernel
133 code, such as the ext4dev filesystem.
134
135 ^test_fs
136 Clear the test_fs flag, indicating the filesystem
137 should only be mounted using production-level
138 filesystem code.
139
140 -f Force the tune2fs operation to complete even in the face of
141 errors. This option is useful when removing the has_journal
142 filesystem feature from a filesystem which has an external jour‐
143 nal (or is corrupted such that it appears to have an external
144 journal), but that external journal is not available. If the
145 filesystem appears to require journal replay, the -f flag must
146 be specified twice to proceed.
147
148 WARNING: Removing an external journal from a filesystem which
149 was not cleanly unmounted without first replaying the external
150 journal can result in severe data loss and filesystem corrup‐
151 tion.
152
153 -g group
154 Set the group which can use the reserved filesystem blocks. The
155 group parameter can be a numerical gid or a group name. If a
156 group name is given, it is converted to a numerical gid before
157 it is stored in the superblock.
158
159 -i interval-between-checks[d|m|w]
160 Adjust the maximal time between two filesystem checks. No suf‐
161 fix or d will interpret the number interval-between-checks as
162 days, m as months, and w as weeks. A value of zero will disable
163 the time-dependent checking.
164
165 There are pros and cons to disabling these periodic checks; see
166 the discussion under the -c (mount-count-dependent check) option
167 for details.
168
169 -j Add an ext3 journal to the filesystem. If the -J option is not
170 specified, the default journal parameters will be used to create
171 an appropriately sized journal (given the size of the filesys‐
172 tem) stored within the filesystem. Note that you must be using
173 a kernel which has ext3 support in order to actually make use of
174 the journal.
175
176 If this option is used to create a journal on a mounted filesys‐
177 tem, an immutable file, .journal, will be created in the top-
178 level directory of the filesystem, as it is the only safe way to
179 create the journal inode while the filesystem is mounted. While
180 the ext3 journal is visible, it is not safe to delete it, or
181 modify it while the filesystem is mounted; for this reason the
182 file is marked immutable. While checking unmounted filesystems,
183 e2fsck(8) will automatically move .journal files to the invisi‐
184 ble, reserved journal inode. For all filesystems except for the
185 root filesystem, this should happen automatically and naturally
186 during the next reboot cycle. Since the root filesystem is
187 mounted read-only, e2fsck(8) must be run from a rescue floppy in
188 order to effect this transition.
189
190 On some distributions, such as Debian, if an initial ramdisk is
191 used, the initrd scripts will automatically convert an ext2 root
192 filesystem to ext3 if the /etc/fstab file specifies the ext3
193 filesystem for the root filesystem in order to avoid requiring
194 the use of a rescue floppy to add an ext3 journal to the root
195 filesystem.
196
197 -J journal-options
198 Override the default ext3 journal parameters. Journal options
199 are comma separated, and may take an argument using the equals
200 ('=') sign. The following journal options are supported:
201
202 size=journal-size
203 Create a journal stored in the filesystem of size
204 journal-size megabytes. The size of the journal
205 must be at least 1024 filesystem blocks (i.e., 1MB
206 if using 1k blocks, 4MB if using 4k blocks, etc.)
207 and may be no more than 102,400 filesystem blocks.
208 There must be enough free space in the filesystem to
209 create a journal of that size.
210
211 device=external-journal
212 Attach the filesystem to the journal block device
213 located on external-journal. The external journal
214 must have been already created using the command
215
216 mke2fs -O journal_dev external-journal
217
218 Note that external-journal must be formatted with
219 the same block size as filesystems which will be
220 using it. In addition, while there is support for
221 attaching multiple filesystems to a single external
222 journal, the Linux kernel and e2fsck(8) do not cur‐
223 rently support shared external journals yet.
224
225 Instead of specifying a device name directly, exter‐
226 nal-journal can also be specified by either
227 LABEL=label or UUID=UUID to locate the external
228 journal by either the volume label or UUID stored in
229 the ext2 superblock at the start of the journal.
230 Use dumpe2fs(8) to display a journal device's volume
231 label and UUID. See also the -L option of
232 tune2fs(8).
233
234 Only one of the size or device options can be given for a
235 filesystem.
236
237 -l List the contents of the filesystem superblock, including the
238 current values of the parameters that can be set via this pro‐
239 gram.
240
241 -L volume-label
242 Set the volume label of the filesystem. Ext2 filesystem labels
243 can be at most 16 characters long; if volume-label is longer
244 than 16 characters, tune2fs will truncate it and print a warn‐
245 ing. The volume label can be used by mount(8), fsck(8), and
246 /etc/fstab(5) (and possibly others) by specifying LABEL=vol‐
247 ume_label instead of a block special device name like /dev/hda5.
248
249 -m reserved-blocks-percentage
250 Set the percentage of the filesystem which may only be allocated
251 by privileged processes. Reserving some number of filesystem
252 blocks for use by privileged processes is done to avoid filesys‐
253 tem fragmentation, and to allow system daemons, such as sys‐
254 logd(8), to continue to function correctly after non-privileged
255 processes are prevented from writing to the filesystem. Nor‐
256 mally, the default percentage of reserved blocks is 5%.
257
258 -M last-mounted-directory
259 Set the last-mounted directory for the filesystem.
260
261 -o [^]mount-option[,...]
262 Set or clear the indicated default mount options in the filesys‐
263 tem. Default mount options can be overridden by mount options
264 specified either in /etc/fstab(5) or on the command line argu‐
265 ments to mount(8). Older kernels may not support this feature;
266 in particular, kernels which predate 2.4.20 will almost cer‐
267 tainly ignore the default mount options field in the superblock.
268
269 More than one mount option can be cleared or set by separating
270 features with commas. Mount options prefixed with a caret char‐
271 acter ('^') will be cleared in the filesystem's superblock;
272 mount options without a prefix character or prefixed with a plus
273 character ('+') will be added to the filesystem.
274
275 The following mount options can be set or cleared using tune2fs:
276
277 debug Enable debugging code for this filesystem.
278
279 bsdgroups
280 Emulate BSD behavior when creating new files: they
281 will take the group-id of the directory in which
282 they were created. The standard System V behavior
283 is the default, where newly created files take on
284 the fsgid of the current process, unless the direc‐
285 tory has the setgid bit set, in which case it takes
286 the gid from the parent directory, and also gets the
287 setgid bit set if it is a directory itself.
288
289 user_xattr
290 Enable user-specified extended attributes.
291
292 acl Enable Posix Access Control Lists.
293
294 uid16 Disables 32-bit UIDs and GIDs. This is for interop‐
295 erability with older kernels which only store and
296 expect 16-bit values.
297
298 journal_data
299 When the filesystem is mounted with journalling
300 enabled, all data (not just metadata) is committed
301 into the journal prior to being written into the
302 main filesystem.
303
304 journal_data_ordered
305 When the filesystem is mounted with journalling
306 enabled, all data is forced directly out to the main
307 file system prior to its metadata being committed to
308 the journal.
309
310 journal_data_writeback
311 When the filesystem is mounted with journalling
312 enabled, data may be written into the main filesys‐
313 tem after its metadata has been committed to the
314 journal. This may increase throughput, however, it
315 may allow old data to appear in files after a crash
316 and journal recovery.
317
318 nobarrier
319 The file system will be mounted with barrier opera‐
320 tions in the journal disabled. (This option is cur‐
321 rently only supported by the ext4 file system driver
322 in 2.6.35+ kernels.)
323
324 block_validity
325 The file system will be mounted with the
326 block_validity option enabled, which causes extra
327 checks to be performed after reading or writing from
328 the file system. This prevents corrupted metadata
329 blocks from causing file system damage by overwrit‐
330 ing parts of the inode table or block group descrip‐
331 tors. This comes at the cost of increased memory
332 and CPU overhead, so it is enabled only for debug‐
333 ging purposes. (This option is currently only sup‐
334 ported by the ext4 file system driver in 2.6.35+
335 kernels.)
336
337 discard
338 The file system will be mounted with the discard
339 mount option. This will cause the file system
340 driver to attempt to use the trim/discard feature of
341 some storage devices (such as SSD's and thin-provi‐
342 sioned drives available in some enterprise storage
343 arrays) to inform the storage device that blocks
344 belonging to deleted files can be reused for other
345 purposes. (This option is currently only supported
346 by the ext4 file system driver in 2.6.35+ kernels.)
347
348 nodelalloc
349 The file system will be mounted with the nodelalloc
350 mount option. This will disable the delayed alloca‐
351 tion feature. (This option is currently only sup‐
352 ported by the ext4 file system driver in 2.6.35+
353 kernels.)
354
355 -O [^]feature[,...]
356 Set or clear the indicated filesystem features (options) in the
357 filesystem. More than one filesystem feature can be cleared or
358 set by separating features with commas. Filesystem features
359 prefixed with a caret character ('^') will be cleared in the
360 filesystem's superblock; filesystem features without a prefix
361 character or prefixed with a plus character ('+') will be added
362 to the filesystem. For a detailed description of the file sys‐
363 tem features, please see the man page ext4(5).
364
365 The following filesystem features can be set or cleared using
366 tune2fs:
367
368 dir_index
369 Use hashed b-trees to speed up lookups for large
370 directories.
371
372 dir_nlink
373 Allow more than 65000 subdirectories per directory.
374
375 extent Enable the use of extent trees to store the location
376 of data blocks in inodes.
377
378 extra_isize
379 Enable the extended inode fields used by ext4.
380
381 filetype
382 Store file type information in directory entries.
383
384 flex_bg
385 Allow bitmaps and inode tables for a block group to
386 be placed anywhere on the storage media. Tune2fs
387 will not reorganize the location of the inode tables
388 and allocation bitmaps, as mke2fs(8) will do when it
389 creates a freshly formatted file system with flex_bg
390 enabled.
391
392 has_journal
393 Use a journal to ensure filesystem consistency even
394 across unclean shutdowns. Setting the filesystem
395 feature is equivalent to using the -j option.
396
397 huge_file
398 Support files larger than 2 terabytes in size.
399
400 large_file
401 Filesystem can contain files that are greater than
402 2GB.
403
404 resize_inode
405 Reserve space so the block group descriptor table
406 may grow in the future. Tune2fs only supports
407 clearing this filesystem feature.
408
409 mmp Enable or disable multiple mount protection (MMP)
410 feature.
411
412 sparse_super
413 Limit the number of backup superblocks to save space
414 on large filesystems.
415
416 uninit_bg
417 Allow the kernel to initialize bitmaps and inode
418 tables lazily, and to keep a high watermark for the
419 unused inodes in a filesystem, to reduce e2fsck(8)
420 time. This first e2fsck run after enabling this
421 feature will take the full time, but subsequent
422 e2fsck runs will take only a fraction of the origi‐
423 nal time, depending on how full the file system is.
424
425 After setting or clearing sparse_super, uninit_bg, filetype, or
426 resize_inode filesystem features, e2fsck(8) must be run on the
427 filesystem to return the filesystem to a consistent state.
428 Tune2fs will print a message requesting that the system adminis‐
429 trator run e2fsck(8) if necessary. After setting the dir_index
430 feature, e2fsck -D can be run to convert existing directories to
431 the hashed B-tree format. Enabling certain filesystem features
432 may prevent the filesystem from being mounted by kernels which
433 do not support those features. In particular, the uninit_bg and
434 flex_bg features are only supported by the ext4 filesystem.
435
436 -p mmp_check_interval
437 Set the desired MMP check interval in seconds. It is 5 seconds
438 by default.
439
440 -r reserved-blocks-count
441 Set the number of reserved filesystem blocks.
442
443 -Q quota-options
444 Sets 'quota' feature on the superblock and works on the quota
445 files for the given quota type. Quota options could be one or
446 more of the following:
447
448 [^]usrquota
449 Sets/clears user quota inode in the superblock.
450
451 [^]grpquota
452 Sets/clears group quota inode in the superblock.
453
454 -T time-last-checked
455 Set the time the filesystem was last checked using e2fsck. The
456 time is interpreted using the current (local) timezone. This
457 can be useful in scripts which use a Logical Volume Manager to
458 make a consistent snapshot of a filesystem, and then check the
459 filesystem during off hours to make sure it hasn't been cor‐
460 rupted due to hardware problems, etc. If the filesystem was
461 clean, then this option can be used to set the last checked time
462 on the original filesystem. The format of time-last-checked is
463 the international date format, with an optional time specifier,
464 i.e. YYYYMMDD[HH[MM[SS]]]. The keyword now is also accepted,
465 in which case the last checked time will be set to the current
466 time.
467
468 -u user
469 Set the user who can use the reserved filesystem blocks. user
470 can be a numerical uid or a user name. If a user name is given,
471 it is converted to a numerical uid before it is stored in the
472 superblock.
473
474 -U UUID
475 Set the universally unique identifier (UUID) of the filesystem
476 to UUID. The format of the UUID is a series of hex digits sepa‐
477 rated by hyphens, like this:
478 "c1b9d5a2-f162-11cf-9ece-0020afc76f16". The UUID parameter may
479 also be one of the following:
480
481 clear clear the filesystem UUID
482
483 random generate a new randomly-generated UUID
484
485 time generate a new time-based UUID
486
487 The UUID may be used by mount(8), fsck(8), and /etc/fstab(5)
488 (and possibly others) by specifying UUID=uuid instead of a block
489 special device name like /dev/hda1.
490
491 See uuidgen(8) for more information. If the system does not
492 have a good random number generator such as /dev/random or
493 /dev/urandom, tune2fs will automatically use a time-based UUID
494 instead of a randomly-generated UUID.
495
497 We haven't found any bugs yet. That doesn't mean there aren't any...
498
500 tune2fs was written by Remy Card <Remy.Card@linux.org>. It is cur‐
501 rently being maintained by Theodore Ts'o <tytso@alum.mit.edu>. tune2fs
502 uses the ext2fs library written by Theodore Ts'o <tytso@mit.edu>. This
503 manual page was written by Christian Kuhtz <chk@data-hh.Hanse.DE>.
504 Time-dependent checking was added by Uwe Ohse <uwe@tirka.gun.de>.
505
507 tune2fs is part of the e2fsprogs package and is available from
508 http://e2fsprogs.sourceforge.net.
509
511 debugfs(8), dumpe2fs(8), e2fsck(8), mke2fs(8), ext4(5)
512
513
514
515E2fsprogs version 1.42.9 December 2013 TUNE2FS(8)