~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/Documentation/admin-guide/ext4.rst

Version: ~ [ linux-6.12-rc7 ] ~ [ linux-6.11.7 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.60 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.116 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.171 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.229 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.285 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.323 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.12 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

Diff markup

Differences between /Documentation/admin-guide/ext4.rst (Architecture ppc) and /Documentation/admin-guide/ext4.rst (Architecture sparc64)


  1 .. SPDX-License-Identifier: GPL-2.0                 1 .. SPDX-License-Identifier: GPL-2.0
  2                                                     2 
  3 ========================                            3 ========================
  4 ext4 General Information                            4 ext4 General Information
  5 ========================                            5 ========================
  6                                                     6 
  7 Ext4 is an advanced level of the ext3 filesyst      7 Ext4 is an advanced level of the ext3 filesystem which incorporates
  8 scalability and reliability enhancements for s      8 scalability and reliability enhancements for supporting large filesystems
  9 (64 bit) in keeping with increasing disk capac      9 (64 bit) in keeping with increasing disk capacities and state-of-the-art
 10 feature requirements.                              10 feature requirements.
 11                                                    11 
 12 Mailing list:   linux-ext4@vger.kernel.org         12 Mailing list:   linux-ext4@vger.kernel.org
 13 Web site:       http://ext4.wiki.kernel.org        13 Web site:       http://ext4.wiki.kernel.org
 14                                                    14 
 15                                                    15 
 16 Quick usage instructions                           16 Quick usage instructions
 17 ========================                           17 ========================
 18                                                    18 
 19 Note: More extensive information for getting s     19 Note: More extensive information for getting started with ext4 can be
 20 found at the ext4 wiki site at the URL:            20 found at the ext4 wiki site at the URL:
 21 http://ext4.wiki.kernel.org/index.php/Ext4_How     21 http://ext4.wiki.kernel.org/index.php/Ext4_Howto
 22                                                    22 
 23   - The latest version of e2fsprogs can be fou     23   - The latest version of e2fsprogs can be found at:
 24                                                    24 
 25     https://www.kernel.org/pub/linux/kernel/pe     25     https://www.kernel.org/pub/linux/kernel/people/tytso/e2fsprogs/
 26                                                    26 
 27         or                                         27         or
 28                                                    28 
 29     http://sourceforge.net/project/showfiles.p     29     http://sourceforge.net/project/showfiles.php?group_id=2406
 30                                                    30 
 31         or grab the latest git repository from     31         or grab the latest git repository from:
 32                                                    32 
 33    https://git.kernel.org/pub/scm/fs/ext2/e2fs     33    https://git.kernel.org/pub/scm/fs/ext2/e2fsprogs.git
 34                                                    34 
 35   - Create a new filesystem using the ext4 fil     35   - Create a new filesystem using the ext4 filesystem type:
 36                                                    36 
 37         # mke2fs -t ext4 /dev/hda1                 37         # mke2fs -t ext4 /dev/hda1
 38                                                    38 
 39     Or to configure an existing ext3 filesyste     39     Or to configure an existing ext3 filesystem to support extents:
 40                                                    40 
 41         # tune2fs -O extents /dev/hda1             41         # tune2fs -O extents /dev/hda1
 42                                                    42 
 43     If the filesystem was created with 128 byt     43     If the filesystem was created with 128 byte inodes, it can be
 44     converted to use 256 byte for greater effi     44     converted to use 256 byte for greater efficiency via:
 45                                                    45 
 46         # tune2fs -I 256 /dev/hda1                 46         # tune2fs -I 256 /dev/hda1
 47                                                    47 
 48   - Mounting:                                      48   - Mounting:
 49                                                    49 
 50         # mount -t ext4 /dev/hda1 /wherever        50         # mount -t ext4 /dev/hda1 /wherever
 51                                                    51 
 52   - When comparing performance with other file     52   - When comparing performance with other filesystems, it's always
 53     important to try multiple workloads; very      53     important to try multiple workloads; very often a subtle change in a
 54     workload parameter can completely change t     54     workload parameter can completely change the ranking of which
 55     filesystems do well compared to others.  W     55     filesystems do well compared to others.  When comparing versus ext3,
 56     note that ext4 enables write barriers by d     56     note that ext4 enables write barriers by default, while ext3 does
 57     not enable write barriers by default.  So      57     not enable write barriers by default.  So it is useful to use
 58     explicitly specify whether barriers are en     58     explicitly specify whether barriers are enabled or not when via the
 59     '-o barriers=[0|1]' mount option for both      59     '-o barriers=[0|1]' mount option for both ext3 and ext4 filesystems
 60     for a fair comparison.  When tuning ext3 f     60     for a fair comparison.  When tuning ext3 for best benchmark numbers,
 61     it is often worthwhile to try changing the     61     it is often worthwhile to try changing the data journaling mode; '-o
 62     data=writeback' can be faster for some wor     62     data=writeback' can be faster for some workloads.  (Note however that
 63     running mounted with data=writeback can po     63     running mounted with data=writeback can potentially leave stale data
 64     exposed in recently written files in case      64     exposed in recently written files in case of an unclean shutdown,
 65     which could be a security exposure in some     65     which could be a security exposure in some situations.)  Configuring
 66     the filesystem with a large journal can al     66     the filesystem with a large journal can also be helpful for
 67     metadata-intensive workloads.                  67     metadata-intensive workloads.
 68                                                    68 
 69 Features                                           69 Features
 70 ========                                           70 ========
 71                                                    71 
 72 Currently Available                                72 Currently Available
 73 -------------------                                73 -------------------
 74                                                    74 
 75 * ability to use filesystems > 16TB (e2fsprogs     75 * ability to use filesystems > 16TB (e2fsprogs support not available yet)
 76 * extent format reduces metadata overhead (RAM     76 * extent format reduces metadata overhead (RAM, IO for access, transactions)
 77 * extent format more robust in face of on-disk     77 * extent format more robust in face of on-disk corruption due to magics,
 78 * internal redundancy in tree                      78 * internal redundancy in tree
 79 * improved file allocation (multi-block alloc)     79 * improved file allocation (multi-block alloc)
 80 * lift 32000 subdirectory limit imposed by i_l     80 * lift 32000 subdirectory limit imposed by i_links_count[1]
 81 * nsec timestamps for mtime, atime, ctime, cre     81 * nsec timestamps for mtime, atime, ctime, create time
 82 * inode version field on disk (NFSv4, Lustre)      82 * inode version field on disk (NFSv4, Lustre)
 83 * reduced e2fsck time via uninit_bg feature        83 * reduced e2fsck time via uninit_bg feature
 84 * journal checksumming for robustness, perform     84 * journal checksumming for robustness, performance
 85 * persistent file preallocation (e.g for strea     85 * persistent file preallocation (e.g for streaming media, databases)
 86 * ability to pack bitmaps and inode tables int     86 * ability to pack bitmaps and inode tables into larger virtual groups via the
 87   flex_bg feature                                  87   flex_bg feature
 88 * large file support                               88 * large file support
 89 * inode allocation using large virtual block g     89 * inode allocation using large virtual block groups via flex_bg
 90 * delayed allocation                               90 * delayed allocation
 91 * large block (up to pagesize) support             91 * large block (up to pagesize) support
 92 * efficient new ordered mode in JBD2 and ext4      92 * efficient new ordered mode in JBD2 and ext4 (avoid using buffer head to force
 93   the ordering)                                    93   the ordering)
 94 * Case-insensitive file name lookups               94 * Case-insensitive file name lookups
 95 * file-based encryption support (fscrypt)          95 * file-based encryption support (fscrypt)
 96 * file-based verity support (fsverity)             96 * file-based verity support (fsverity)
 97                                                    97 
 98 [1] Filesystems with a block size of 1k may se     98 [1] Filesystems with a block size of 1k may see a limit imposed by the
 99 directory hash tree having a maximum depth of      99 directory hash tree having a maximum depth of two.
100                                                   100 
101 case-insensitive file name lookups                101 case-insensitive file name lookups
102 ==============================================    102 ======================================================
103                                                   103 
104 The case-insensitive file name lookup feature     104 The case-insensitive file name lookup feature is supported on a
105 per-directory basis, allowing the user to mix     105 per-directory basis, allowing the user to mix case-insensitive and
106 case-sensitive directories in the same filesys    106 case-sensitive directories in the same filesystem.  It is enabled by
107 flipping the +F inode attribute of an empty di    107 flipping the +F inode attribute of an empty directory.  The
108 case-insensitive string match operation is onl    108 case-insensitive string match operation is only defined when we know how
109 text in encoded in a byte sequence.  For that     109 text in encoded in a byte sequence.  For that reason, in order to enable
110 case-insensitive directories, the filesystem m    110 case-insensitive directories, the filesystem must have the
111 casefold feature, which stores the filesystem-    111 casefold feature, which stores the filesystem-wide encoding
112 model used.  By default, the charset adopted i    112 model used.  By default, the charset adopted is the latest version of
113 Unicode (12.1.0, by the time of this writing),    113 Unicode (12.1.0, by the time of this writing), encoded in the UTF-8
114 form.  The comparison algorithm is implemented    114 form.  The comparison algorithm is implemented by normalizing the
115 strings to the Canonical decomposition form, a    115 strings to the Canonical decomposition form, as defined by Unicode,
116 followed by a byte per byte comparison.           116 followed by a byte per byte comparison.
117                                                   117 
118 The case-awareness is name-preserving on the d    118 The case-awareness is name-preserving on the disk, meaning that the file
119 name provided by userspace is a byte-per-byte     119 name provided by userspace is a byte-per-byte match to what is actually
120 written in the disk.  The Unicode normalizatio    120 written in the disk.  The Unicode normalization format used by the
121 kernel is thus an internal representation, and    121 kernel is thus an internal representation, and not exposed to the
122 userspace nor to the disk, with the important     122 userspace nor to the disk, with the important exception of disk hashes,
123 used on large case-insensitive directories wit    123 used on large case-insensitive directories with DX feature.  On DX
124 directories, the hash must be calculated using    124 directories, the hash must be calculated using the casefolded version of
125 the filename, meaning that the normalization f    125 the filename, meaning that the normalization format used actually has an
126 impact on where the directory entry is stored.    126 impact on where the directory entry is stored.
127                                                   127 
128 When we change from viewing filenames as opaqu    128 When we change from viewing filenames as opaque byte sequences to seeing
129 them as encoded strings we need to address wha    129 them as encoded strings we need to address what happens when a program
130 tries to create a file with an invalid name.      130 tries to create a file with an invalid name.  The Unicode subsystem
131 within the kernel leaves the decision of what     131 within the kernel leaves the decision of what to do in this case to the
132 filesystem, which select its preferred behavio    132 filesystem, which select its preferred behavior by enabling/disabling
133 the strict mode.  When Ext4 encounters one of     133 the strict mode.  When Ext4 encounters one of those strings and the
134 filesystem did not require strict mode, it fal    134 filesystem did not require strict mode, it falls back to considering the
135 entire string as an opaque byte sequence, whic    135 entire string as an opaque byte sequence, which still allows the user to
136 operate on that file, but the case-insensitive    136 operate on that file, but the case-insensitive lookups won't work.
137                                                   137 
138 Options                                           138 Options
139 =======                                           139 =======
140                                                   140 
141 When mounting an ext4 filesystem, the followin    141 When mounting an ext4 filesystem, the following option are accepted:
142 (*) == default                                    142 (*) == default
143                                                   143 
144   ro                                              144   ro
145         Mount filesystem read only. Note that     145         Mount filesystem read only. Note that ext4 will replay the journal (and
146         thus write to the partition) even when    146         thus write to the partition) even when mounted "read only". The mount
147         options "ro,noload" can be used to pre    147         options "ro,noload" can be used to prevent writes to the filesystem.
148                                                   148 
149   journal_checksum                                149   journal_checksum
150         Enable checksumming of the journal tra    150         Enable checksumming of the journal transactions.  This will allow the
151         recovery code in e2fsck and the kernel    151         recovery code in e2fsck and the kernel to detect corruption in the
152         kernel.  It is a compatible change and    152         kernel.  It is a compatible change and will be ignored by older
153         kernels.                                  153         kernels.
154                                                   154 
155   journal_async_commit                            155   journal_async_commit
156         Commit block can be written to disk wi    156         Commit block can be written to disk without waiting for descriptor
157         blocks. If enabled older kernels canno    157         blocks. If enabled older kernels cannot mount the device. This will
158         enable 'journal_checksum' internally.     158         enable 'journal_checksum' internally.
159                                                   159 
160   journal_path=path, journal_dev=devnum           160   journal_path=path, journal_dev=devnum
161         When the external journal device's maj    161         When the external journal device's major/minor numbers have changed,
162         these options allow the user to specif    162         these options allow the user to specify the new journal location.  The
163         journal device is identified through e    163         journal device is identified through either its new major/minor numbers
164         encoded in devnum, or via a path to th    164         encoded in devnum, or via a path to the device.
165                                                   165 
166   norecovery, noload                              166   norecovery, noload
167         Don't load the journal on mounting.  N    167         Don't load the journal on mounting.  Note that if the filesystem was
168         not unmounted cleanly, skipping the jo    168         not unmounted cleanly, skipping the journal replay will lead to the
169         filesystem containing inconsistencies     169         filesystem containing inconsistencies that can lead to any number of
170         problems.                                 170         problems.
171                                                   171 
172   data=journal                                    172   data=journal
173         All data are committed into the journa    173         All data are committed into the journal prior to being written into the
174         main file system.  Enabling this mode     174         main file system.  Enabling this mode will disable delayed allocation
175         and O_DIRECT support.                     175         and O_DIRECT support.
176                                                   176 
177   data=ordered  (*)                               177   data=ordered  (*)
178         All data are forced directly out to th    178         All data are forced directly out to the main file system prior to its
179         metadata being committed to the journa    179         metadata being committed to the journal.
180                                                   180 
181   data=writeback                                  181   data=writeback
182         Data ordering is not preserved, data m    182         Data ordering is not preserved, data may be written into the main file
183         system after its metadata has been com    183         system after its metadata has been committed to the journal.
184                                                   184 
185   commit=nrsec  (*)                               185   commit=nrsec  (*)
186         This setting limits the maximum age of    186         This setting limits the maximum age of the running transaction to
187         'nrsec' seconds.  The default value is    187         'nrsec' seconds.  The default value is 5 seconds.  This means that if
188         you lose your power, you will lose as     188         you lose your power, you will lose as much as the latest 5 seconds of
189         metadata changes (your filesystem will    189         metadata changes (your filesystem will not be damaged though, thanks
190         to the journaling). This default value    190         to the journaling). This default value (or any low value) will hurt
191         performance, but it's good for data-sa    191         performance, but it's good for data-safety.  Setting it to 0 will have
192         the same effect as leaving it at the d    192         the same effect as leaving it at the default (5 seconds).  Setting it
193         to very large values will improve perf    193         to very large values will improve performance.  Note that due to
194         delayed allocation even older data can    194         delayed allocation even older data can be lost on power failure since
195         writeback of those data begins only af    195         writeback of those data begins only after time set in
196         /proc/sys/vm/dirty_expire_centisecs.      196         /proc/sys/vm/dirty_expire_centisecs.
197                                                   197 
198   barrier=<0|1(*)>, barrier(*), nobarrier         198   barrier=<0|1(*)>, barrier(*), nobarrier
199         This enables/disables the use of write    199         This enables/disables the use of write barriers in the jbd code.
200         barrier=0 disables, barrier=1 enables.    200         barrier=0 disables, barrier=1 enables.  This also requires an IO stack
201         which can support barriers, and if jbd    201         which can support barriers, and if jbd gets an error on a barrier
202         write, it will disable again with a wa    202         write, it will disable again with a warning.  Write barriers enforce
203         proper on-disk ordering of journal com    203         proper on-disk ordering of journal commits, making volatile disk write
204         caches safe to use, at some performanc    204         caches safe to use, at some performance penalty.  If your disks are
205         battery-backed in one way or another,     205         battery-backed in one way or another, disabling barriers may safely
206         improve performance.  The mount option    206         improve performance.  The mount options "barrier" and "nobarrier" can
207         also be used to enable or disable barr    207         also be used to enable or disable barriers, for consistency with other
208         ext4 mount options.                       208         ext4 mount options.
209                                                   209 
210   inode_readahead_blks=n                          210   inode_readahead_blks=n
211         This tuning parameter controls the max    211         This tuning parameter controls the maximum number of inode table blocks
212         that ext4's inode table readahead algo    212         that ext4's inode table readahead algorithm will pre-read into the
213         buffer cache.  The default value is 32    213         buffer cache.  The default value is 32 blocks.
214                                                   214 
215   bsddf (*)                                       215   bsddf (*)
216         Make 'df' act like BSD.                   216         Make 'df' act like BSD.
217                                                   217 
218   minixdf                                         218   minixdf
219         Make 'df' act like Minix.                 219         Make 'df' act like Minix.
220                                                   220 
221   debug                                           221   debug
222         Extra debugging information is sent to    222         Extra debugging information is sent to syslog.
223                                                   223 
224   abort                                           224   abort
225         Simulate the effects of calling ext4_a    225         Simulate the effects of calling ext4_abort() for debugging purposes.
226         This is normally used while remounting    226         This is normally used while remounting a filesystem which is already
227         mounted.                                  227         mounted.
228                                                   228 
229   errors=remount-ro                               229   errors=remount-ro
230         Remount the filesystem read-only on an    230         Remount the filesystem read-only on an error.
231                                                   231 
232   errors=continue                                 232   errors=continue
233         Keep going on a filesystem error.         233         Keep going on a filesystem error.
234                                                   234 
235   errors=panic                                    235   errors=panic
236         Panic and halt the machine if an error    236         Panic and halt the machine if an error occurs.  (These mount options
237         override the errors behavior specified    237         override the errors behavior specified in the superblock, which can be
238         configured using tune2fs)                 238         configured using tune2fs)
239                                                   239 
240   data_err=ignore(*)                              240   data_err=ignore(*)
241         Just print an error message if an erro    241         Just print an error message if an error occurs in a file data buffer in
242         ordered mode.                             242         ordered mode.
243   data_err=abort                                  243   data_err=abort
244         Abort the journal if an error occurs i    244         Abort the journal if an error occurs in a file data buffer in ordered
245         mode.                                     245         mode.
246                                                   246 
247   grpid | bsdgroups                               247   grpid | bsdgroups
248         New objects have the group ID of their    248         New objects have the group ID of their parent.
249                                                   249 
250   nogrpid (*) | sysvgroups                        250   nogrpid (*) | sysvgroups
251         New objects have the group ID of their    251         New objects have the group ID of their creator.
252                                                   252 
253   resgid=n                                        253   resgid=n
254         The group ID which may use the reserve    254         The group ID which may use the reserved blocks.
255                                                   255 
256   resuid=n                                        256   resuid=n
257         The user ID which may use the reserved    257         The user ID which may use the reserved blocks.
258                                                   258 
259   sb=                                             259   sb=
260         Use alternate superblock at this locat    260         Use alternate superblock at this location.
261                                                   261 
262   quota, noquota, grpquota, usrquota              262   quota, noquota, grpquota, usrquota
263         These options are ignored by the files    263         These options are ignored by the filesystem. They are used only by
264         quota tools to recognize volumes where    264         quota tools to recognize volumes where quota should be turned on. See
265         documentation in the quota-tools packa    265         documentation in the quota-tools package for more details
266         (http://sourceforge.net/projects/linux    266         (http://sourceforge.net/projects/linuxquota).
267                                                   267 
268   jqfmt=<quota type>, usrjquota=<file>, grpjqu    268   jqfmt=<quota type>, usrjquota=<file>, grpjquota=<file>
269         These options tell filesystem details     269         These options tell filesystem details about quota so that quota
270         information can be properly updated du    270         information can be properly updated during journal replay. They replace
271         the above quota options. See documenta    271         the above quota options. See documentation in the quota-tools package
272         for more details (http://sourceforge.n    272         for more details (http://sourceforge.net/projects/linuxquota).
273                                                   273 
274   stripe=n                                        274   stripe=n
275         Number of filesystem blocks that mball    275         Number of filesystem blocks that mballoc will try to use for allocation
276         size and alignment. For RAID5/6 system    276         size and alignment. For RAID5/6 systems this should be the number of
277         data disks *  RAID chunk size in file     277         data disks *  RAID chunk size in file system blocks.
278                                                   278 
279   delalloc      (*)                               279   delalloc      (*)
280         Defer block allocation until just befo    280         Defer block allocation until just before ext4 writes out the block(s)
281         in question.  This allows ext4 to bett    281         in question.  This allows ext4 to better allocation decisions more
282         efficiently.                              282         efficiently.
283                                                   283 
284   nodelalloc                                      284   nodelalloc
285         Disable delayed allocation.  Blocks ar    285         Disable delayed allocation.  Blocks are allocated when the data is
286         copied from userspace to the page cach    286         copied from userspace to the page cache, either via the write(2) system
287         call or when an mmap'ed page which was    287         call or when an mmap'ed page which was previously unallocated is
288         written for the first time.               288         written for the first time.
289                                                   289 
290   max_batch_time=usec                             290   max_batch_time=usec
291         Maximum amount of time ext4 should wai    291         Maximum amount of time ext4 should wait for additional filesystem
292         operations to be batch together with a    292         operations to be batch together with a synchronous write operation.
293         Since a synchronous write operation is    293         Since a synchronous write operation is going to force a commit and then
294         a wait for the I/O complete, it doesn'    294         a wait for the I/O complete, it doesn't cost much, and can be a huge
295         throughput win, we wait for a small am    295         throughput win, we wait for a small amount of time to see if any other
296         transactions can piggyback on the sync    296         transactions can piggyback on the synchronous write.   The algorithm
297         used is designed to automatically tune    297         used is designed to automatically tune for the speed of the disk, by
298         measuring the amount of time (on avera    298         measuring the amount of time (on average) that it takes to finish
299         committing a transaction.  Call this t    299         committing a transaction.  Call this time the "commit time".  If the
300         time that the transaction has been run    300         time that the transaction has been running is less than the commit
301         time, ext4 will try sleeping for the c    301         time, ext4 will try sleeping for the commit time to see if other
302         operations will join the transaction.     302         operations will join the transaction.   The commit time is capped by
303         the max_batch_time, which defaults to     303         the max_batch_time, which defaults to 15000us (15ms).   This
304         optimization can be turned off entirel    304         optimization can be turned off entirely by setting max_batch_time to 0.
305                                                   305 
306   min_batch_time=usec                             306   min_batch_time=usec
307         This parameter sets the commit time (a    307         This parameter sets the commit time (as described above) to be at least
308         min_batch_time.  It defaults to zero m    308         min_batch_time.  It defaults to zero microseconds.  Increasing this
309         parameter may improve the throughput o    309         parameter may improve the throughput of multi-threaded, synchronous
310         workloads on very fast disks, at the c    310         workloads on very fast disks, at the cost of increasing latency.
311                                                   311 
312   journal_ioprio=prio                             312   journal_ioprio=prio
313         The I/O priority (from 0 to 7, where 0    313         The I/O priority (from 0 to 7, where 0 is the highest priority) which
314         should be used for I/O operations subm    314         should be used for I/O operations submitted by kjournald2 during a
315         commit operation.  This defaults to 3,    315         commit operation.  This defaults to 3, which is a slightly higher
316         priority than the default I/O priority    316         priority than the default I/O priority.
317                                                   317 
318   auto_da_alloc(*), noauto_da_alloc               318   auto_da_alloc(*), noauto_da_alloc
319         Many broken applications don't use fsy    319         Many broken applications don't use fsync() when replacing existing
320         files via patterns such as fd = open("    320         files via patterns such as fd = open("foo.new")/write(fd,..)/close(fd)/
321         rename("foo.new", "foo"), or worse yet    321         rename("foo.new", "foo"), or worse yet, fd = open("foo",
322         O_TRUNC)/write(fd,..)/close(fd).  If a    322         O_TRUNC)/write(fd,..)/close(fd).  If auto_da_alloc is enabled, ext4
323         will detect the replace-via-rename and    323         will detect the replace-via-rename and replace-via-truncate patterns
324         and force that any delayed allocation     324         and force that any delayed allocation blocks are allocated such that at
325         the next journal commit, in the defaul    325         the next journal commit, in the default data=ordered mode, the data
326         blocks of the new file are forced to d    326         blocks of the new file are forced to disk before the rename() operation
327         is committed.  This provides roughly t    327         is committed.  This provides roughly the same level of guarantees as
328         ext3, and avoids the "zero-length" pro    328         ext3, and avoids the "zero-length" problem that can happen when a
329         system crashes before the delayed allo    329         system crashes before the delayed allocation blocks are forced to disk.
330                                                   330 
331   noinit_itable                                   331   noinit_itable
332         Do not initialize any uninitialized in    332         Do not initialize any uninitialized inode table blocks in the
333         background.  This feature may be used     333         background.  This feature may be used by installation CD's so that the
334         install process can complete as quickl    334         install process can complete as quickly as possible; the inode table
335         initialization process would then be d    335         initialization process would then be deferred until the next time the
336         file system is unmounted.                 336         file system is unmounted.
337                                                   337 
338   init_itable=n                                   338   init_itable=n
339         The lazy itable init code will wait n     339         The lazy itable init code will wait n times the number of milliseconds
340         it took to zero out the previous block    340         it took to zero out the previous block group's inode table.  This
341         minimizes the impact on the system per    341         minimizes the impact on the system performance while file system's
342         inode table is being initialized.         342         inode table is being initialized.
343                                                   343 
344   discard, nodiscard(*)                           344   discard, nodiscard(*)
345         Controls whether ext4 should issue dis    345         Controls whether ext4 should issue discard/TRIM commands to the
346         underlying block device when blocks ar    346         underlying block device when blocks are freed.  This is useful for SSD
347         devices and sparse/thinly-provisioned     347         devices and sparse/thinly-provisioned LUNs, but it is off by default
348         until sufficient testing has been done    348         until sufficient testing has been done.
349                                                   349 
350   nouid32                                         350   nouid32
351         Disables 32-bit UIDs and GIDs.  This i    351         Disables 32-bit UIDs and GIDs.  This is for interoperability  with
352         older kernels which only store and exp    352         older kernels which only store and expect 16-bit values.
353                                                   353 
354   block_validity(*), noblock_validity             354   block_validity(*), noblock_validity
355         These options enable or disable the in    355         These options enable or disable the in-kernel facility for tracking
356         filesystem metadata blocks within inte    356         filesystem metadata blocks within internal data structures.  This
357         allows multi- block allocator and othe    357         allows multi- block allocator and other routines to notice bugs or
358         corrupted allocation bitmaps which cau    358         corrupted allocation bitmaps which cause blocks to be allocated which
359         overlap with filesystem metadata block    359         overlap with filesystem metadata blocks.
360                                                   360 
361   dioread_lock, dioread_nolock                    361   dioread_lock, dioread_nolock
362         Controls whether or not ext4 should us    362         Controls whether or not ext4 should use the DIO read locking. If the
363         dioread_nolock option is specified ext    363         dioread_nolock option is specified ext4 will allocate uninitialized
364         extent before buffer write and convert    364         extent before buffer write and convert the extent to initialized after
365         IO completes. This approach allows ext    365         IO completes. This approach allows ext4 code to avoid using inode
366         mutex, which improves scalability on h    366         mutex, which improves scalability on high speed storages. However this
367         does not work with data journaling and    367         does not work with data journaling and dioread_nolock option will be
368         ignored with kernel warning. Note that    368         ignored with kernel warning. Note that dioread_nolock code path is only
369         used for extent-based files.  Because     369         used for extent-based files.  Because of the restrictions this options
370         comprises it is off by default (e.g. d    370         comprises it is off by default (e.g. dioread_lock).
371                                                   371 
372   max_dir_size_kb=n                               372   max_dir_size_kb=n
373         This limits the size of directories so    373         This limits the size of directories so that any attempt to expand them
374         beyond the specified limit in kilobyte    374         beyond the specified limit in kilobytes will cause an ENOSPC error.
375         This is useful in memory constrained e    375         This is useful in memory constrained environments, where a very large
376         directory can cause severe performance    376         directory can cause severe performance problems or even provoke the Out
377         Of Memory killer.  (For example, if th    377         Of Memory killer.  (For example, if there is only 512mb memory
378         available, a 176mb directory may serio    378         available, a 176mb directory may seriously cramp the system's style.)
379                                                   379 
380   i_version                                       380   i_version
381         Enable 64-bit inode version support. T    381         Enable 64-bit inode version support. This option is off by default.
382                                                   382 
383   dax                                             383   dax
384         Use direct access (no page cache).  Se    384         Use direct access (no page cache).  See
385         Documentation/filesystems/dax.rst.  No    385         Documentation/filesystems/dax.rst.  Note that this option is
386         incompatible with data=journal.           386         incompatible with data=journal.
387                                                   387 
388   inlinecrypt                                     388   inlinecrypt
389         When possible, encrypt/decrypt the con    389         When possible, encrypt/decrypt the contents of encrypted files using the
390         blk-crypto framework rather than files    390         blk-crypto framework rather than filesystem-layer encryption. This
391         allows the use of inline encryption ha    391         allows the use of inline encryption hardware. The on-disk format is
392         unaffected. For more details, see         392         unaffected. For more details, see
393         Documentation/block/inline-encryption.    393         Documentation/block/inline-encryption.rst.
394                                                   394 
395 Data Mode                                         395 Data Mode
396 =========                                         396 =========
397 There are 3 different data modes:                 397 There are 3 different data modes:
398                                                   398 
399 * writeback mode                                  399 * writeback mode
400                                                   400 
401   In data=writeback mode, ext4 does not journa    401   In data=writeback mode, ext4 does not journal data at all.  This mode provides
402   a similar level of journaling as that of XFS    402   a similar level of journaling as that of XFS, JFS, and ReiserFS in its default
403   mode - metadata journaling.  A crash+recover    403   mode - metadata journaling.  A crash+recovery can cause incorrect data to
404   appear in files which were written shortly b    404   appear in files which were written shortly before the crash.  This mode will
405   typically provide the best ext4 performance.    405   typically provide the best ext4 performance.
406                                                   406 
407 * ordered mode                                    407 * ordered mode
408                                                   408 
409   In data=ordered mode, ext4 only officially j    409   In data=ordered mode, ext4 only officially journals metadata, but it logically
410   groups metadata information related to data     410   groups metadata information related to data changes with the data blocks into
411   a single unit called a transaction.  When it    411   a single unit called a transaction.  When it's time to write the new metadata
412   out to disk, the associated data blocks are     412   out to disk, the associated data blocks are written first.  In general, this
413   mode performs slightly slower than writeback    413   mode performs slightly slower than writeback but significantly faster than
414   journal mode.                                   414   journal mode.
415                                                   415 
416 * journal mode                                    416 * journal mode
417                                                   417 
418   data=journal mode provides full data and met    418   data=journal mode provides full data and metadata journaling.  All new data is
419   written to the journal first, and then to it    419   written to the journal first, and then to its final location.  In the event of
420   a crash, the journal can be replayed, bringi    420   a crash, the journal can be replayed, bringing both data and metadata into a
421   consistent state.  This mode is the slowest     421   consistent state.  This mode is the slowest except when data needs to be read
422   from and written to disk at the same time wh    422   from and written to disk at the same time where it outperforms all others
423   modes.  Enabling this mode will disable dela    423   modes.  Enabling this mode will disable delayed allocation and O_DIRECT
424   support.                                        424   support.
425                                                   425 
426 /proc entries                                     426 /proc entries
427 =============                                     427 =============
428                                                   428 
429 Information about mounted ext4 file systems ca    429 Information about mounted ext4 file systems can be found in
430 /proc/fs/ext4.  Each mounted filesystem will h    430 /proc/fs/ext4.  Each mounted filesystem will have a directory in
431 /proc/fs/ext4 based on its device name (i.e.,     431 /proc/fs/ext4 based on its device name (i.e., /proc/fs/ext4/hdc or
432 /proc/fs/ext4/dm-0).   The files in each per-d    432 /proc/fs/ext4/dm-0).   The files in each per-device directory are shown
433 in table below.                                   433 in table below.
434                                                   434 
435 Files in /proc/fs/ext4/<devname>                  435 Files in /proc/fs/ext4/<devname>
436                                                   436 
437   mb_groups                                       437   mb_groups
438         details of multiblock allocator buddy     438         details of multiblock allocator buddy cache of free blocks
439                                                   439 
440 /sys entries                                      440 /sys entries
441 ============                                      441 ============
442                                                   442 
443 Information about mounted ext4 file systems ca    443 Information about mounted ext4 file systems can be found in
444 /sys/fs/ext4.  Each mounted filesystem will ha    444 /sys/fs/ext4.  Each mounted filesystem will have a directory in
445 /sys/fs/ext4 based on its device name (i.e., /    445 /sys/fs/ext4 based on its device name (i.e., /sys/fs/ext4/hdc or
446 /sys/fs/ext4/dm-0).   The files in each per-de    446 /sys/fs/ext4/dm-0).   The files in each per-device directory are shown
447 in table below.                                   447 in table below.
448                                                   448 
449 Files in /sys/fs/ext4/<devname>:                  449 Files in /sys/fs/ext4/<devname>:
450                                                   450 
451 (see also Documentation/ABI/testing/sysfs-fs-e    451 (see also Documentation/ABI/testing/sysfs-fs-ext4)
452                                                   452 
453   delayed_allocation_blocks                       453   delayed_allocation_blocks
454         This file is read-only and shows the n    454         This file is read-only and shows the number of blocks that are dirty in
455         the page cache, but which do not have     455         the page cache, but which do not have their location in the filesystem
456         allocated yet.                            456         allocated yet.
457                                                   457 
458   inode_goal                                      458   inode_goal
459         Tuning parameter which (if non-zero) c    459         Tuning parameter which (if non-zero) controls the goal inode used by
460         the inode allocator in preference to a    460         the inode allocator in preference to all other allocation heuristics.
461         This is intended for debugging use onl    461         This is intended for debugging use only, and should be 0 on production
462         systems.                                  462         systems.
463                                                   463 
464   inode_readahead_blks                            464   inode_readahead_blks
465         Tuning parameter which controls the ma    465         Tuning parameter which controls the maximum number of inode table
466         blocks that ext4's inode table readahe    466         blocks that ext4's inode table readahead algorithm will pre-read into
467         the buffer cache.                         467         the buffer cache.
468                                                   468 
469   lifetime_write_kbytes                           469   lifetime_write_kbytes
470         This file is read-only and shows the n    470         This file is read-only and shows the number of kilobytes of data that
471         have been written to this filesystem s    471         have been written to this filesystem since it was created.
472                                                   472 
473   max_writeback_mb_bump                           473   max_writeback_mb_bump
474         The maximum number of megabytes the wr    474         The maximum number of megabytes the writeback code will try to write
475         out before move on to another inode.      475         out before move on to another inode.
476                                                   476 
477   mb_group_prealloc                               477   mb_group_prealloc
478         The multiblock allocator will round up    478         The multiblock allocator will round up allocation requests to a
479         multiple of this tuning parameter if t    479         multiple of this tuning parameter if the stripe size is not set in the
480         ext4 superblock                           480         ext4 superblock
481                                                   481 
482   mb_max_to_scan                                  482   mb_max_to_scan
483         The maximum number of extents the mult    483         The maximum number of extents the multiblock allocator will search to
484         find the best extent.                     484         find the best extent.
485                                                   485 
486   mb_min_to_scan                                  486   mb_min_to_scan
487         The minimum number of extents the mult    487         The minimum number of extents the multiblock allocator will search to
488         find the best extent.                     488         find the best extent.
489                                                   489 
490   mb_order2_req                                   490   mb_order2_req
491         Tuning parameter which controls the mi    491         Tuning parameter which controls the minimum size for requests (as a
492         power of 2) where the buddy cache is u    492         power of 2) where the buddy cache is used.
493                                                   493 
494   mb_stats                                        494   mb_stats
495         Controls whether the multiblock alloca    495         Controls whether the multiblock allocator should collect statistics,
496         which are shown during the unmount. 1     496         which are shown during the unmount. 1 means to collect statistics, 0
497         means not to collect statistics.          497         means not to collect statistics.
498                                                   498 
499   mb_stream_req                                   499   mb_stream_req
500         Files which have fewer blocks than thi    500         Files which have fewer blocks than this tunable parameter will have
501         their blocks allocated out of a block     501         their blocks allocated out of a block group specific preallocation
502         pool, so that small files are packed c    502         pool, so that small files are packed closely together.  Each large file
503         will have its blocks allocated out of     503         will have its blocks allocated out of its own unique preallocation
504         pool.                                     504         pool.
505                                                   505 
506   session_write_kbytes                            506   session_write_kbytes
507         This file is read-only and shows the n    507         This file is read-only and shows the number of kilobytes of data that
508         have been written to this filesystem s    508         have been written to this filesystem since it was mounted.
509                                                   509 
510   reserved_clusters                               510   reserved_clusters
511         This is RW file and contains number of    511         This is RW file and contains number of reserved clusters in the file
512         system which will be used in the speci    512         system which will be used in the specific situations to avoid costly
513         zeroout, unexpected ENOSPC, or possibl    513         zeroout, unexpected ENOSPC, or possible data loss. The default is 2% or
514         4096 clusters, whichever is smaller an    514         4096 clusters, whichever is smaller and this can be changed however it
515         can never exceed number of clusters in    515         can never exceed number of clusters in the file system. If there is not
516         enough space for the reserved space wh    516         enough space for the reserved space when mounting the file mount will
517         _not_ fail.                               517         _not_ fail.
518                                                   518 
519 Ioctls                                            519 Ioctls
520 ======                                            520 ======
521                                                   521 
522 Ext4 implements various ioctls which can be us    522 Ext4 implements various ioctls which can be used by applications to access
523 ext4-specific functionality. An incomplete lis    523 ext4-specific functionality. An incomplete list of these ioctls is shown in the
524 table below. This list includes truly ext4-spe    524 table below. This list includes truly ext4-specific ioctls (``EXT4_IOC_*``) as
525 well as ioctls that may have been ext4-specifi    525 well as ioctls that may have been ext4-specific originally but are now supported
526 by some other filesystem(s) too (``FS_IOC_*``)    526 by some other filesystem(s) too (``FS_IOC_*``).
527                                                   527 
528 Table of Ext4 ioctls                              528 Table of Ext4 ioctls
529                                                   529 
530   FS_IOC_GETFLAGS                                 530   FS_IOC_GETFLAGS
531         Get additional attributes associated w    531         Get additional attributes associated with inode.  The ioctl argument is
532         an integer bitfield, with bit values d    532         an integer bitfield, with bit values described in ext4.h.
533                                                   533 
534   FS_IOC_SETFLAGS                                 534   FS_IOC_SETFLAGS
535         Set additional attributes associated w    535         Set additional attributes associated with inode.  The ioctl argument is
536         an integer bitfield, with bit values d    536         an integer bitfield, with bit values described in ext4.h.
537                                                   537 
538   EXT4_IOC_GETVERSION, EXT4_IOC_GETVERSION_OLD    538   EXT4_IOC_GETVERSION, EXT4_IOC_GETVERSION_OLD
539         Get the inode i_generation number stor    539         Get the inode i_generation number stored for each inode. The
540         i_generation number is normally change    540         i_generation number is normally changed only when new inode is created
541         and it is particularly useful for netw    541         and it is particularly useful for network filesystems. The '_OLD'
542         version of this ioctl is an alias for     542         version of this ioctl is an alias for FS_IOC_GETVERSION.
543                                                   543 
544   EXT4_IOC_SETVERSION, EXT4_IOC_SETVERSION_OLD    544   EXT4_IOC_SETVERSION, EXT4_IOC_SETVERSION_OLD
545         Set the inode i_generation number stor    545         Set the inode i_generation number stored for each inode. The '_OLD'
546         version of this ioctl is an alias for     546         version of this ioctl is an alias for FS_IOC_SETVERSION.
547                                                   547 
548   EXT4_IOC_GROUP_EXTEND                           548   EXT4_IOC_GROUP_EXTEND
549         This ioctl has the same purpose as the    549         This ioctl has the same purpose as the resize mount option. It allows
550         to resize filesystem to the end of the    550         to resize filesystem to the end of the last existing block group,
551         further resize has to be done with res    551         further resize has to be done with resize2fs, either online, or
552         offline. The argument points to the un    552         offline. The argument points to the unsigned logn number representing
553         the filesystem new block count.           553         the filesystem new block count.
554                                                   554 
555   EXT4_IOC_MOVE_EXT                               555   EXT4_IOC_MOVE_EXT
556         Move the block extents from orig_fd (t    556         Move the block extents from orig_fd (the one this ioctl is pointing to)
557         to the donor_fd (the one specified in     557         to the donor_fd (the one specified in move_extent structure passed as
558         an argument to this ioctl). Then, exch    558         an argument to this ioctl). Then, exchange inode metadata between
559         orig_fd and donor_fd.  This is especia    559         orig_fd and donor_fd.  This is especially useful for online
560         defragmentation, because the allocator    560         defragmentation, because the allocator has the opportunity to allocate
561         moved blocks better, ideally into one     561         moved blocks better, ideally into one contiguous extent.
562                                                   562 
563   EXT4_IOC_GROUP_ADD                              563   EXT4_IOC_GROUP_ADD
564         Add a new group descriptor to an exist    564         Add a new group descriptor to an existing or new group descriptor
565         block. The new group descriptor is des    565         block. The new group descriptor is described by ext4_new_group_input
566         structure, which is passed as an argum    566         structure, which is passed as an argument to this ioctl. This is
567         especially useful in conjunction with     567         especially useful in conjunction with EXT4_IOC_GROUP_EXTEND, which
568         allows online resize of the filesystem    568         allows online resize of the filesystem to the end of the last existing
569         block group.  Those two ioctls combine    569         block group.  Those two ioctls combined is used in userspace online
570         resize tool (e.g. resize2fs).             570         resize tool (e.g. resize2fs).
571                                                   571 
572   EXT4_IOC_MIGRATE                                572   EXT4_IOC_MIGRATE
573         This ioctl operates on the filesystem     573         This ioctl operates on the filesystem itself.  It converts (migrates)
574         ext3 indirect block mapped inode to ex    574         ext3 indirect block mapped inode to ext4 extent mapped inode by walking
575         through indirect block mapping of the     575         through indirect block mapping of the original inode and converting
576         contiguous block ranges into ext4 exte    576         contiguous block ranges into ext4 extents of the temporary inode. Then,
577         inodes are swapped. This ioctl might h    577         inodes are swapped. This ioctl might help, when migrating from ext3 to
578         ext4 filesystem, however suggestion is    578         ext4 filesystem, however suggestion is to create fresh ext4 filesystem
579         and copy data from the backup. Note, t    579         and copy data from the backup. Note, that filesystem has to support
580         extents for this ioctl to work.           580         extents for this ioctl to work.
581                                                   581 
582   EXT4_IOC_ALLOC_DA_BLKS                          582   EXT4_IOC_ALLOC_DA_BLKS
583         Force all of the delay allocated block    583         Force all of the delay allocated blocks to be allocated to preserve
584         application-expected ext3 behaviour. N    584         application-expected ext3 behaviour. Note that this will also start
585         triggering a write of the data blocks,    585         triggering a write of the data blocks, but this behaviour may change in
586         the future as it is not necessary and     586         the future as it is not necessary and has been done this way only for
587         sake of simplicity.                       587         sake of simplicity.
588                                                   588 
589   EXT4_IOC_RESIZE_FS                              589   EXT4_IOC_RESIZE_FS
590         Resize the filesystem to a new size.      590         Resize the filesystem to a new size.  The number of blocks of resized
591         filesystem is passed in via 64 bit int    591         filesystem is passed in via 64 bit integer argument.  The kernel
592         allocates bitmaps and inode table, the    592         allocates bitmaps and inode table, the userspace tool thus just passes
593         the new number of blocks.                 593         the new number of blocks.
594                                                   594 
595   EXT4_IOC_SWAP_BOOT                              595   EXT4_IOC_SWAP_BOOT
596         Swap i_blocks and associated attribute    596         Swap i_blocks and associated attributes (like i_blocks, i_size,
597         i_flags, ...) from the specified inode    597         i_flags, ...) from the specified inode with inode EXT4_BOOT_LOADER_INO
598         (#5). This is typically used to store     598         (#5). This is typically used to store a boot loader in a secure part of
599         the filesystem, where it can't be chan    599         the filesystem, where it can't be changed by a normal user by accident.
600         The data blocks of the previous boot l    600         The data blocks of the previous boot loader will be associated with the
601         given inode.                              601         given inode.
602                                                   602 
603 References                                        603 References
604 ==========                                        604 ==========
605                                                   605 
606 kernel source:  <file:fs/ext4/>                   606 kernel source:  <file:fs/ext4/>
607                 <file:fs/jbd2/>                   607                 <file:fs/jbd2/>
608                                                   608 
609 programs:       http://e2fsprogs.sourceforge.n    609 programs:       http://e2fsprogs.sourceforge.net/
610                                                   610 
611 useful links:   https://fedoraproject.org/wiki    611 useful links:   https://fedoraproject.org/wiki/ext3-devel
612                 http://www.bullopensource.org/    612                 http://www.bullopensource.org/ext4/
613                 http://ext4.wiki.kernel.org/in    613                 http://ext4.wiki.kernel.org/index.php/Main_Page
614                 https://fedoraproject.org/wiki    614                 https://fedoraproject.org/wiki/Features/Ext4
                                                      

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php