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