Orange Pi5 kernel

Deprecated Linux kernel 5.10.110 for OrangePi 5/5B/5+ boards

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