1EXT4(5) File Formats Manual EXT4(5)
2
3
4
6 ext2 - the second extended file system
7 ext2 - the third extended file system
8 ext4 - the fourth extended file system
9
11 The second, third, and fourth extended file systems, or ext2, ext3, and
12 ext4 as they are commonly known, are Linux file systems that have his‐
13 torically been the default file system for many Linux distributions.
14 They are general purpose file systems that have been designed for
15 extensibility and backwards compatibility. In particular, file systems
16 previously intended for use with the ext2 and ext3 file systems can be
17 mounted using the ext4 file system driver, and indeed in many modern
18 Linux distributions, the ext4 file system driver has been configured
19 handle mount requests for ext2 and ext3 file systems.
20
22 A file system formated for ext2, ext3, or ext4 can be have some collec‐
23 tion of the follow file system feature flags enabled. Some of these
24 features are not supported by all implementations of the ext2, ext3,
25 and ext4 file system drivers, depending on Linux kernel version in use.
26 On other operating systems, such as the GNU/HURD or FreeBSD, only a
27 very restrictive set of file system features may be supported in their
28 implementations of ext2.
29
30 64bit
31 Enables the file system to be larger than 2^32
32 blocks. This feature is set automatically, as
33 needed, but it can be useful to specify this feature
34 explicitly if the file system might need to be
35 resized larger than 2^32 blocks, even if it was
36 smaller than that threshold when it was originally
37 created. Note that some older kernels and older
38 versions of e2fsprogs will not support file systems
39 with this ext4 feature enabled.
40
41 bigalloc
42 This ext4 feature enables clustered block alloca‐
43 tion, so that the unit of allocation is a power of
44 two number of blocks. That is, each bit in the what
45 had traditionally been known as the block allocation
46 bitmap now indicates whether a cluster is in use or
47 not, where a cluster is by default composed of 16
48 blocks. This feature can decrease the time spent on
49 doing block allocation and brings smaller fragmenta‐
50 tion, especially for large files. The size can be
51 specified using the -C option.
52
53 Warning: The bigalloc feature is still under devel‐
54 opment, and may not be fully supported with your
55 kernel or may have various bugs. Please see the web
56 page http://ext4.wiki.kernel.org/index.php/Bigalloc
57 for details. May clash with delayed allocation (see
58 nodelallocmountoption).
59
60 This feature requires that the extent features be
61 enabled.
62
63 dir_index
64 Use hashed b-trees to speed up name lookups in large
65 directories. This feature is supported by ext3 and
66 ext4 file systems, and is ignored by ext2 file sys‐
67 tems.
68
69 dir_nlink
70 This ext4 feature allows more than 65000 subdirecto‐
71 ries per directory.
72
73 extent
74 This ext4 feature allows the mapping of logical
75 block numbers for a particular inode to physical
76 blocks on the storage device to be stored using an
77 extent tree, which is a more efficient data struc‐
78 ture than the traditional indirect block scheme used
79 by the ext2 and ext3 file systems. The use of the
80 extent tree decreases metadata block overhead,
81 improves file system performance, and decreases the
82 needed to run e2fsck(8) on the file system. (Note:
83 both extent and extents are accepted as valid names
84 for this feature for historical/backwards compati‐
85 bility reasons.)
86
87 extra_isize
88 This ext4 feature reserves a specific amount of
89 space in each inode for extended metadata such as
90 nanosecond timestamps and file creation time, even
91 if the current kernel does not current need to
92 reserve this much space. Without this feature, the
93 kernel will reserve the amount of space for features
94 currently it currently needs, and the rest may be
95 consumed by extended attributes.
96
97 For this feature to be useful the inode size must be
98 256 bytes in size or larger.
99
100 ext_attr
101 This feature enables the use of extended attributes.
102 This feature is supported by ext2, ext3, and ext4.
103
104 filetype
105 This feature enables the storage file type informa‐
106 tion in directory entries. This feature is sup‐
107 ported by ext2, ext3, and ext4.
108
109
110 flex_bg
111 This ext4 feature allows the per-
112 block group metadata (allocation
113 bitmaps and inode tables) to be
114 placed anywhere on the storage
115 media. In addition, mke2fs will
116 place the per-block group meta‐
117 data together starting at the
118 first block group of each
119 "flex_bg group". The size of
120 the flex_bg group can be speci‐
121 fied using the -G option.
122
123 has_journal
124 Create a journal to ensure
125 filesystem consistency even
126 across unclean shutdowns. Set‐
127 ting the filesystem feature is
128 equivalent to using the -j
129 option. This feature is sup‐
130 ported by ext3 and ext4, and
131 ignored by the ext2 file system
132 driver.
133
134 huge_file
135 This ext4 feature allows files to
136 be larger than 2 terabytes in
137 size.
138
139 journal_dev
140 This feature is enabled on the
141 superblock found on an external
142 journal device. The block size
143 for the external journal must be
144 the same as the file system which
145 uses it.
146
147 The external journal device can
148 be used by a file system by spec‐
149 ifying the -J device=<external-
150 device> option to mke2fs(8) or
151 tune2fs(8).
152
153 large_file
154 This feature flag is set automat‐
155 ically by modern kernels when a
156 file larger than 2 gigabytes is
157 created. Very old kernels could
158 not handle large files, so this
159 feature flag was used to prohibit
160 those kernels from mounting file
161 systems that they could not
162 understand.
163
164 meta_bg
165 This ext4 feature allows file
166 systems to be resized on-line
167 without explicitly needing to
168 reserve space for growth in the
169 size of the block group descrip‐
170 tors. This scheme is also used
171 to resize file systems which are
172 larger than 2^32 blocks. It is
173 not recommended that this feature
174 be set when a file system is cre‐
175 ated, since this alternate method
176 of storing the block group
177 descriptor will slow down the
178 time needed to mount the file
179 system, and newer kernels can
180 automatically set this feature as
181 necessary when doing an online
182 resize and no more reserved space
183 is available in the resize inode.
184
185 mmp
186 This ext4 feature provides multi‐
187 ple mount protection (MMP). MMP
188 helps to protect the filesystem
189 from being multiply mounted and
190 is useful in shared storage envi‐
191 ronments.
192
193 resize_inode
194 This file system feature indi‐
195 cates that space has been
196 reserved so the block group
197 descriptor table can be extended
198 by the file system is resized
199 while the file system is mounted.
200 The online resize operation is
201 carried out by the kernel, trig‐
202 gered, by resize2fs(8). By
203 default mke2fs will attempt to
204 reserve enough space so that the
205 filesystem may grow to 1024 times
206 its initial size. This can be
207 changed using the resize extended
208 option.
209
210 This feature requires that the
211 sparse_super feature be enabled.
212
213 sparse_super
214 This file system feature is set
215 on all modern ext2, ext3, and
216 ext4 file system. It indicates
217 that backup copies of the
218 superblock and block group
219 descriptors be present only on a
220 few block groups, and not all of
221 them.
222
223 uninit_bg
224 This ext4 file system feature
225 indicates that the block group
226 descriptors will be protected
227 using checksums, making it safe
228 for mke2fs(8) to create a file
229 system without initializing all
230 of the block groups. The kernel
231 will keep a high watermark of
232 unused inodes, and initialize
233 inode tables and block lazily.
234 This feature speeds up the time
235 to check the file system using
236 e2fsck(8), and it also speeds up
237 the time required for mke2fs(8)
238 to create the file system.
239
241 This section describes mount options which are spe‐
242 cific to ext2, ext3, and ext4. Other generic mount
243 options may be used as well; see mount(8) for
244 details.
245
247 The `ext2' filesystem is the standard Linux filesys‐
248 tem. Since Linux 2.5.46, for most mount options the
249 default is determined by the filesystem superblock.
250 Set them with tune2fs(8).
251
252 acl|noacl
253 Support POSIX Access Control Lists (or not).
254
255 bsddf|minixdf
256 Set the behavior for the statfs system call.
257 The minixdf behavior is to return in the
258 f_blocks field the total number of blocks of
259 the filesystem, while the bsddf behavior
260 (which is the default) is to subtract the
261 overhead blocks used by the ext2 filesystem
262 and not available for file storage. Thus
263
264 % mount /k -o minixdf; df /k; umount /k
265
266 Filesystem 1024-blocks Used Available Capacity Mounted on
267 /dev/sda6 2630655 86954 2412169 3% /k
268
269 % mount /k -o bsddf; df /k; umount /k
270
271 Filesystem 1024-blocks Used Available Capacity Mounted on
272 /dev/sda6 2543714 13 2412169 0% /k
273
274 (Note that this example shows that one can
275 add command line options to the options given
276 in /etc/fstab.)
277
278 check=none or nocheck
279 No checking is done at mount time. This is
280 the default. This is fast. It is wise to
281 invoke e2fsck(8) every now and then, e.g. at
282 boot time. The non-default behavior is unsup‐
283 ported (check=normal and check=strict options
284 have been removed). Note that these mount
285 options don't have to be supported if ext4
286 kernel driver is used for ext2 and ext3
287 filesystems.
288
289 debug Print debugging info upon each (re)mount.
290
291 errors={continue|remount-ro|panic}
292 Define the behavior when an error is encoun‐
293 tered. (Either ignore errors and just mark
294 the filesystem erroneous and continue, or
295 remount the filesystem read-only, or panic
296 and halt the system.) The default is set in
297 the filesystem superblock, and can be changed
298 using tune2fs(8).
299
300 grpid|bsdgroups and nogrpid|sysvgroups
301 These options define what group id a newly
302 created file gets. When grpid is set, it
303 takes the group id of the directory in which
304 it is created; otherwise (the default) it
305 takes the fsgid of the current process,
306 unless the directory has the setgid bit set,
307 in which case it takes the gid from the par‐
308 ent directory, and also gets the setgid bit
309 set if it is a directory itself.
310
311 grpquota|noquota|quota|usrquota
312 The usrquota (same as quota) mount option
313 enables user quota support on the filesystem.
314 grpquota enables group quotas support. You
315 need the quota utilities to actually enable
316 and manage the quota system.
317
318 nouid32
319 Disables 32-bit UIDs and GIDs. This is for
320 interoperability with older kernels which
321 only store and expect 16-bit values.
322
323 oldalloc or orlov
324 Use old allocator or Orlov allocator for new
325 inodes. Orlov is default.
326
327 resgid=n and resuid=n
328 The ext2 filesystem reserves a certain per‐
329 centage of the available space (by default
330 5%, see mke2fs(8) and tune2fs(8)). These
331 options determine who can use the reserved
332 blocks. (Roughly: whoever has the specified
333 uid, or belongs to the specified group.)
334
335 sb=n Instead of block 1, use block n as
336 superblock. This could be useful when the
337 filesystem has been damaged. (Earlier,
338 copies of the superblock would be made every
339 8192 blocks: in block 1, 8193, 16385, ...
340 (and one got thousands of copies on a big
341 filesystem). Since version 1.08, mke2fs has a
342 -s (sparse superblock) option to reduce the
343 number of backup superblocks, and since ver‐
344 sion 1.15 this is the default. Note that this
345 may mean that ext2 filesystems created by a
346 recent mke2fs cannot be mounted r/w under
347 Linux 2.0.*.) The block number here uses 1 k
348 units. Thus, if you want to use logical block
349 32768 on a filesystem with 4 k blocks, use
350 "sb=131072".
351
352 user_xattr|nouser_xattr
353 Support "user." extended attributes (or not).
354
355
356
358 The ext3 filesystem is a version of the ext2
359 filesystem which has been enhanced with journaling.
360 It supports the same options as ext2 as well as the
361 following additions:
362
363 journal=update
364 Update the ext3 filesystem's journal to the
365 current format.
366
367 journal=inum
368 When a journal already exists, this option is
369 ignored. Otherwise, it specifies the number
370 of the inode which will represent the ext3
371 filesystem's journal file; ext3 will create a
372 new journal, overwriting the old contents of
373 the file whose inode number is inum.
374
375 journal_dev=devnum/journal_path=path
376 When the external journal device's
377 major/minor numbers have changed, these
378 options allow the user to specify the new
379 journal location. The journal device is
380 identified either through its new major/minor
381 numbers encoded in devnum, or via a path to
382 the device.
383
384 norecovery/noload
385 Don't load the journal on mounting. Note
386 that if the filesystem was not unmounted
387 cleanly, skipping the journal replay will
388 lead to the filesystem containing inconsis‐
389 tencies that can lead to any number of prob‐
390 lems.
391
392 data={journal|ordered|writeback}
393 Specifies the journaling mode for file data.
394 Metadata is always journaled. To use modes
395 other than ordered on the root filesystem,
396 pass the mode to the kernel as boot parame‐
397 ter, e.g. rootflags=data=journal.
398
399 journal
400 All data is committed into the journal
401 prior to being written into the main
402 filesystem.
403
404 ordered
405 This is the default mode. All data is
406 forced directly out to the main file
407 system prior to its metadata being
408 committed to the journal.
409
410 writeback
411 Data ordering is not preserved – data
412 may be written into the main filesys‐
413 tem after its metadata has been com‐
414 mitted to the journal. This is
415 rumoured to be the highest-throughput
416 option. It guarantees internal
417 filesystem integrity, however it can
418 allow old data to appear in files
419 after a crash and journal recovery.
420
421 data_err=ignore
422 Just print an error message if an error
423 occurs in a file data buffer in ordered mode.
424
425 data_err=abort
426 Abort the journal if an error occurs in a
427 file data buffer in ordered mode.
428
429 barrier=0 / barrier=1
430 This disables / enables the use of write bar‐
431 riers in the jbd code. barrier=0 disables,
432 barrier=1 enables (default). This also
433 requires an IO stack which can support barri‐
434 ers, and if jbd gets an error on a barrier
435 write, it will disable barriers again with a
436 warning. Write barriers enforce proper on-
437 disk ordering of journal commits, making
438 volatile disk write caches safe to use, at
439 some performance penalty. If your disks are
440 battery-backed in one way or another, dis‐
441 abling barriers may safely improve perfor‐
442 mance.
443
444 commit=nrsec
445 Sync all data and metadata every nrsec sec‐
446 onds. The default value is 5 seconds. Zero
447 means default.
448
449 user_xattr
450 Enable Extended User Attributes. See the
451 attr(5) manual page.
452
453 acl Enable POSIX Access Control Lists. See the
454 acl(5) manual page.
455
456 usr‐
457 jquota=aquota.user|grpjquota=aquota.group|jqfmt=vfsv0
458 Apart from the old quota system (as in ext2,
459 jqfmt=vfsold aka version 1 quota) ext3 also
460 supports journaled quotas (version 2 quota).
461 jqfmt=vfsv0 enables journaled quotas. For
462 journaled quotas the mount options usr‐
463 jquota=aquota.user and grpjquota=aquota.group
464 are required to tell the quota system which
465 quota database files to use. Journaled quotas
466 have the advantage that even after a crash no
467 quota check is required.
468
469
471 The ext4 filesystem is an advanced level of the ext3
472 filesystem which incorporates scalability and relia‐
473 bility enhancements for supporting large filesystem.
474
475 The options journal_dev, norecovery, noload, data,
476 commit, orlov, oldalloc, [no]user_xattr [no]acl,
477 bsddf, minixdf, debug, errors, data_err, grpid, bsd‐
478 groups, nogrpid sysvgroups, resgid, resuid, sb,
479 quota, noquota, grpquota, usrquota usrjquota,
480 grpjquota and jqfmt are backwardly compatible with
481 ext3 or ext2.
482
483 journal_checksum
484 Enable checksumming of the journal transac‐
485 tions. This will allow the recovery code in
486 e2fsck and the kernel to detect corruption in
487 the kernel. It is a compatible change and
488 will be ignored by older kernels.
489
490 journal_async_commit
491 Commit block can be written to disk without
492 waiting for descriptor blocks. If enabled
493 older kernels cannot mount the device. This
494 will enable 'journal_checksum' internally.
495
496 barrier=0 / barrier=1 / barrier / nobarrier
497 These mount options have the same effect as
498 in ext3. The mount options "barrier" and
499 "nobarrier" are added for consistency with
500 other ext4 mount options.
501
502 The ext4 filesystem enables write barriers by
503 default.
504
505 inode_readahead_blks=n
506 This tuning parameter controls the maximum
507 number of inode table blocks that ext4's
508 inode table readahead algorithm will pre-read
509 into the buffer cache. The value must be a
510 power of 2. The default value is 32 blocks.
511
512 stripe=n
513 Number of filesystem blocks that mballoc will
514 try to use for allocation size and alignment.
515 For RAID5/6 systems this should be the number
516 of data disks * RAID chunk size in filesystem
517 blocks.
518
519 delalloc
520 Deferring block allocation until write-out
521 time.
522
523 nodelalloc
524 Disable delayed allocation. Blocks are allo‐
525 cated when data is copied from user to page
526 cache.
527
528 max_batch_time=usec
529 Maximum amount of time ext4 should wait for
530 additional filesystem operations to be batch
531 together with a synchronous write operation.
532 Since a synchronous write operation is going
533 to force a commit and then a wait for the I/O
534 complete, it doesn't cost much, and can be a
535 huge throughput win, we wait for a small
536 amount of time to see if any other transac‐
537 tions can piggyback on the synchronous write.
538 The algorithm used is designed to automati‐
539 cally tune for the speed of the disk, by mea‐
540 suring the amount of time (on average) that
541 it takes to finish committing a transaction.
542 Call this time the "commit time". If the
543 time that the transaction has been running is
544 less than the commit time, ext4 will try
545 sleeping for the commit time to see if other
546 operations will join the transaction. The
547 commit time is capped by the max_batch_time,
548 which defaults to 15000 µs (15 ms). This
549 optimization can be turned off entirely by
550 setting max_batch_time to 0.
551
552 min_batch_time=usec
553 This parameter sets the commit time (as
554 described above) to be at least
555 min_batch_time. It defaults to zero microsec‐
556 onds. Increasing this parameter may improve
557 the throughput of multi-threaded, synchronous
558 workloads on very fast disks, at the cost of
559 increasing latency.
560
561 journal_ioprio=prio
562 The I/O priority (from 0 to 7, where 0 is the
563 highest priority) which should be used for
564 I/O operations submitted by kjournald2 during
565 a commit operation. This defaults to 3,
566 which is a slightly higher priority than the
567 default I/O priority.
568
569 abort Simulate the effects of calling ext4_abort()
570 for debugging purposes. This is normally
571 used while remounting a filesystem which is
572 already mounted.
573
574 auto_da_alloc|noauto_da_alloc
575 Many broken applications don't use fsync()
576 when replacing existing files via patterns
577 such as
578
579 fd = open("foo.new")/write(fd,...)/close(fd)/
580 rename("foo.new", "foo")
581
582 or worse yet
583
584 fd = open("foo",
585 O_TRUNC)/write(fd,...)/close(fd).
586
587 If auto_da_alloc is enabled, ext4 will detect
588 the replace-via-rename and replace-via-trun‐
589 cate patterns and force that any delayed
590 allocation blocks are allocated such that at
591 the next journal commit, in the default
592 data=ordered mode, the data blocks of the new
593 file are forced to disk before the rename()
594 operation is committed. This provides
595 roughly the same level of guarantees as ext3,
596 and avoids the "zero-length" problem that can
597 happen when a system crashes before the
598 delayed allocation blocks are forced to disk.
599
600 noinit_itable
601 Do not initialize any uninitialized inode ta‐
602 ble blocks in the background. This feature
603 may be used by installation CD's so that the
604 install process can complete as quickly as
605 possible; the inode table initialization
606 process would then be deferred until the next
607 time the filesystem is mounted.
608
609 init_itable=n
610 The lazy itable init code will wait n times
611 the number of milliseconds it took to zero
612 out the previous block group's inode table.
613 This minimizes the impact on system perfor‐
614 mance while the filesystem's inode table is
615 being initialized.
616
617 discard/nodiscard
618 Controls whether ext4 should issue dis‐
619 card/TRIM commands to the underlying block
620 device when blocks are freed. This is useful
621 for SSD devices and sparse/thinly-provisioned
622 LUNs, but it is off by default until suffi‐
623 cient testing has been done.
624
625 nouid32
626 Disables 32-bit UIDs and GIDs. This is for
627 interoperability with older kernels which
628 only store and expect 16-bit values.
629
630 block_validity/noblock_validity
631 This options allows to enables/disables the
632 in-kernel facility for tracking filesystem
633 metadata blocks within internal data struc‐
634 tures. This allows multi-block allocator and
635 other routines to quickly locate extents
636 which might overlap with filesystem metadata
637 blocks. This option is intended for debugging
638 purposes and since it negatively affects the
639 performance, it is off by default.
640
641 dioread_lock/dioread_nolock
642 Controls whether or not ext4 should use the
643 DIO read locking. If the dioread_nolock
644 option is specified ext4 will allocate unini‐
645 tialized extent before buffer write and con‐
646 vert the extent to initialized after IO com‐
647 pletes. This approach allows ext4 code to
648 avoid using inode mutex, which improves scal‐
649 ability on high speed storages. However this
650 does not work with data journaling and
651 dioread_nolock option will be ignored with
652 kernel warning. Note that dioread_nolock
653 code path is only used for extent-based
654 files. Because of the restrictions this
655 options comprises it is off by default (e.g.
656 dioread_lock).
657
658 max_dir_size_kb=n
659 This limits the size of the directories so
660 that any attempt to expand them beyond the
661 specified limit in kilobytes will cause an
662 ENOSPC error. This is useful in memory-con‐
663 strained environments, where a very large
664 directory can cause severe performance prob‐
665 lems or even provoke the Out Of Memory
666 killer. (For example, if there is only 512 MB
667 memory available, a 176 MB directory may
668 seriously cramp the system's style.)
669
670 i_version
671 Enable 64-bit inode version support. This
672 option is off by default.
673
674
676 The ext2, ext3, and ext4 filesystems support setting
677 the following file attributes on Linux systems using
678 the chattr(1) utility:
679
680 a - append only
681
682 A - no atime updates
683
684 d - no dump
685
686 D - synchronous directory updates
687
688 i - immutable
689
690 S - synchronous updates
691
692 u - undeletable
693
694 In addition, the ext3 and ext4 filesystems support
695 the following flag:
696
697 j - data journaling
698
699 Finally, the ext4 filesystem also supports the fol‐
700 lowing flag:
701
702 e - extents format
703
704 For descriptions of these attribute flags, please
705 refer to the chattr(1) man page.
706
708 mke2fs(8), mke2fs.conf(5), e2fsck(8), dumpe2fs(8),
709 tune2fs(8), debugfs(8), mount(8), chattr(1)
710
711
712
713E2fsprogs version 1.42.9 December 2013 EXT4(5)