Sheriff Esseson | 89b408a | 2019-07-15 09:15:09 -0700 | [diff] [blame] | 1 | .. SPDX-License-Identifier: GPL-2.0 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 2 | |
Sheriff Esseson | 89b408a | 2019-07-15 09:15:09 -0700 | [diff] [blame] | 3 | ====================== |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 4 | The SGI XFS Filesystem |
| 5 | ====================== |
| 6 | |
| 7 | XFS is a high performance journaling filesystem which originated |
| 8 | on the SGI IRIX platform. It is completely multi-threaded, can |
| 9 | support large files and large filesystems, extended attributes, |
| 10 | variable block sizes, is extent based, and makes extensive use of |
| 11 | Btrees (directories, extents, free space) to aid both performance |
| 12 | and scalability. |
| 13 | |
Masanari Iida | a10c5d9 | 2018-03-02 22:30:13 +0900 | [diff] [blame] | 14 | Refer to the documentation at https://xfs.wiki.kernel.org/ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 15 | for further details. This implementation is on-disk compatible |
| 16 | with the IRIX version of XFS. |
| 17 | |
| 18 | |
| 19 | Mount Options |
| 20 | ============= |
| 21 | |
| 22 | When mounting an XFS filesystem, the following options are accepted. |
| 23 | |
Nathan Scott | fc97bbf | 2005-11-03 13:46:43 +1100 | [diff] [blame] | 24 | allocsize=size |
| 25 | Sets the buffered I/O end-of-file preallocation size when |
| 26 | doing delayed allocation writeout (default size is 64KiB). |
| 27 | Valid values for this option are page size (typically 4KiB) |
| 28 | through to 1GiB, inclusive, in power-of-2 increments. |
| 29 | |
Dave Chinner | 3e5b7d8 | 2013-07-10 07:03:59 +1000 | [diff] [blame] | 30 | The default behaviour is for dynamic end-of-file |
| 31 | preallocation size, which uses a set of heuristics to |
| 32 | optimise the preallocation size based on the current |
| 33 | allocation patterns within the file and the access patterns |
Sheriff Esseson | 89b408a | 2019-07-15 09:15:09 -0700 | [diff] [blame] | 34 | to the file. Specifying a fixed ``allocsize`` value turns off |
Dave Chinner | 3e5b7d8 | 2013-07-10 07:03:59 +1000 | [diff] [blame] | 35 | the dynamic behaviour. |
| 36 | |
Sheriff Esseson | 89b408a | 2019-07-15 09:15:09 -0700 | [diff] [blame] | 37 | attr2 or noattr2 |
Dave Chinner | 3e5b7d8 | 2013-07-10 07:03:59 +1000 | [diff] [blame] | 38 | The options enable/disable an "opportunistic" improvement to |
| 39 | be made in the way inline extended attributes are stored |
| 40 | on-disk. When the new form is used for the first time when |
Sheriff Esseson | 89b408a | 2019-07-15 09:15:09 -0700 | [diff] [blame] | 41 | ``attr2`` is selected (either when setting or removing extended |
Dave Chinner | 3e5b7d8 | 2013-07-10 07:03:59 +1000 | [diff] [blame] | 42 | attributes) the on-disk superblock feature bit field will be |
| 43 | updated to reflect this format being in use. |
| 44 | |
| 45 | The default behaviour is determined by the on-disk feature |
Sheriff Esseson | 89b408a | 2019-07-15 09:15:09 -0700 | [diff] [blame] | 46 | bit indicating that ``attr2`` behaviour is active. If either |
| 47 | mount option is set, then that becomes the new default used |
Dave Chinner | 3e5b7d8 | 2013-07-10 07:03:59 +1000 | [diff] [blame] | 48 | by the filesystem. |
Nathan Scott | fc97bbf | 2005-11-03 13:46:43 +1100 | [diff] [blame] | 49 | |
Sheriff Esseson | 89b408a | 2019-07-15 09:15:09 -0700 | [diff] [blame] | 50 | CRC enabled filesystems always use the ``attr2`` format, and so |
| 51 | will reject the ``noattr2`` mount option if it is set. |
Dave Chinner | d3eaace | 2013-06-05 12:09:09 +1000 | [diff] [blame] | 52 | |
Sheriff Esseson | 89b408a | 2019-07-15 09:15:09 -0700 | [diff] [blame] | 53 | discard or nodiscard (default) |
Dave Chinner | 3e5b7d8 | 2013-07-10 07:03:59 +1000 | [diff] [blame] | 54 | Enable/disable the issuing of commands to let the block |
| 55 | device reclaim space freed by the filesystem. This is |
| 56 | useful for SSD devices, thinly provisioned LUNs and virtual |
| 57 | machine images, but may have a performance impact. |
Christoph Hellwig | e84661a | 2011-05-20 13:45:32 +0000 | [diff] [blame] | 58 | |
Sheriff Esseson | 89b408a | 2019-07-15 09:15:09 -0700 | [diff] [blame] | 59 | Note: It is currently recommended that you use the ``fstrim`` |
| 60 | application to ``discard`` unused blocks rather than the ``discard`` |
Dave Chinner | 3e5b7d8 | 2013-07-10 07:03:59 +1000 | [diff] [blame] | 61 | mount option because the performance impact of this option |
| 62 | is quite severe. |
Nathan Scott | fc97bbf | 2005-11-03 13:46:43 +1100 | [diff] [blame] | 63 | |
Sheriff Esseson | 89b408a | 2019-07-15 09:15:09 -0700 | [diff] [blame] | 64 | grpid/bsdgroups or nogrpid/sysvgroups (default) |
Dave Chinner | 3e5b7d8 | 2013-07-10 07:03:59 +1000 | [diff] [blame] | 65 | These options define what group ID a newly created file |
Sheriff Esseson | 89b408a | 2019-07-15 09:15:09 -0700 | [diff] [blame] | 66 | gets. When ``grpid`` is set, it takes the group ID of the |
Dave Chinner | 3e5b7d8 | 2013-07-10 07:03:59 +1000 | [diff] [blame] | 67 | directory in which it is created; otherwise it takes the |
Sheriff Esseson | 89b408a | 2019-07-15 09:15:09 -0700 | [diff] [blame] | 68 | ``fsgid`` of the current process, unless the directory has the |
| 69 | ``setgid`` bit set, in which case it takes the ``gid`` from the |
| 70 | parent directory, and also gets the ``setgid`` bit set if it is |
Dave Chinner | 3e5b7d8 | 2013-07-10 07:03:59 +1000 | [diff] [blame] | 71 | a directory itself. |
Nathan Scott | fc97bbf | 2005-11-03 13:46:43 +1100 | [diff] [blame] | 72 | |
Dave Chinner | 3e5b7d8 | 2013-07-10 07:03:59 +1000 | [diff] [blame] | 73 | filestreams |
| 74 | Make the data allocator use the filestreams allocation mode |
| 75 | across the entire filesystem rather than just on directories |
| 76 | configured to use it. |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 77 | |
Sheriff Esseson | 89b408a | 2019-07-15 09:15:09 -0700 | [diff] [blame] | 78 | ikeep or noikeep (default) |
| 79 | When ``ikeep`` is specified, XFS does not delete empty inode |
| 80 | clusters and keeps them around on disk. When ``noikeep`` is |
Dave Chinner | 3e5b7d8 | 2013-07-10 07:03:59 +1000 | [diff] [blame] | 81 | specified, empty inode clusters are returned to the free |
| 82 | space pool. |
Carlos Maiolino | c99abb8 | 2012-10-18 12:28:58 -0300 | [diff] [blame] | 83 | |
Sheriff Esseson | 89b408a | 2019-07-15 09:15:09 -0700 | [diff] [blame] | 84 | inode32 or inode64 (default) |
| 85 | When ``inode32`` is specified, it indicates that XFS limits |
Dave Chinner | 3e5b7d8 | 2013-07-10 07:03:59 +1000 | [diff] [blame] | 86 | inode creation to locations which will not result in inode |
| 87 | numbers with more than 32 bits of significance. |
Nathan Scott | fc97bbf | 2005-11-03 13:46:43 +1100 | [diff] [blame] | 88 | |
Sheriff Esseson | 89b408a | 2019-07-15 09:15:09 -0700 | [diff] [blame] | 89 | When ``inode64`` is specified, it indicates that XFS is allowed |
Dave Chinner | 3e5b7d8 | 2013-07-10 07:03:59 +1000 | [diff] [blame] | 90 | to create inodes at any location in the filesystem, |
| 91 | including those which will result in inode numbers occupying |
Sheriff Esseson | 89b408a | 2019-07-15 09:15:09 -0700 | [diff] [blame] | 92 | more than 32 bits of significance. |
Dave Chinner | 3e5b7d8 | 2013-07-10 07:03:59 +1000 | [diff] [blame] | 93 | |
Sheriff Esseson | 89b408a | 2019-07-15 09:15:09 -0700 | [diff] [blame] | 94 | ``inode32`` is provided for backwards compatibility with older |
Dave Chinner | 3e5b7d8 | 2013-07-10 07:03:59 +1000 | [diff] [blame] | 95 | systems and applications, since 64 bits inode numbers might |
| 96 | cause problems for some applications that cannot handle |
| 97 | large inode numbers. If applications are in use which do |
Sheriff Esseson | 89b408a | 2019-07-15 09:15:09 -0700 | [diff] [blame] | 98 | not handle inode numbers bigger than 32 bits, the ``inode32`` |
Dave Chinner | 3e5b7d8 | 2013-07-10 07:03:59 +1000 | [diff] [blame] | 99 | option should be specified. |
| 100 | |
Sheriff Esseson | 89b408a | 2019-07-15 09:15:09 -0700 | [diff] [blame] | 101 | largeio or nolargeio (default) |
| 102 | If ``nolargeio`` is specified, the optimal I/O reported in |
| 103 | ``st_blksize`` by **stat(2)** will be as small as possible to allow |
Dave Chinner | 3e5b7d8 | 2013-07-10 07:03:59 +1000 | [diff] [blame] | 104 | user applications to avoid inefficient read/modify/write |
| 105 | I/O. This is typically the page size of the machine, as |
| 106 | this is the granularity of the page cache. |
| 107 | |
Sheriff Esseson | 89b408a | 2019-07-15 09:15:09 -0700 | [diff] [blame] | 108 | If ``largeio`` is specified, a filesystem that was created with a |
| 109 | ``swidth`` specified will return the ``swidth`` value (in bytes) |
| 110 | in ``st_blksize``. If the filesystem does not have a ``swidth`` |
| 111 | specified but does specify an ``allocsize`` then ``allocsize`` |
Dave Chinner | 3e5b7d8 | 2013-07-10 07:03:59 +1000 | [diff] [blame] | 112 | (in bytes) will be returned instead. Otherwise the behaviour |
Sheriff Esseson | 89b408a | 2019-07-15 09:15:09 -0700 | [diff] [blame] | 113 | is the same as if ``nolargeio`` was specified. |
Nathan Scott | fc97bbf | 2005-11-03 13:46:43 +1100 | [diff] [blame] | 114 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 115 | logbufs=value |
Dave Chinner | 3e5b7d8 | 2013-07-10 07:03:59 +1000 | [diff] [blame] | 116 | Set the number of in-memory log buffers. Valid numbers |
| 117 | range from 2-8 inclusive. |
| 118 | |
| 119 | The default value is 8 buffers. |
| 120 | |
| 121 | If the memory cost of 8 log buffers is too high on small |
| 122 | systems, then it may be reduced at some cost to performance |
Sheriff Esseson | 89b408a | 2019-07-15 09:15:09 -0700 | [diff] [blame] | 123 | on metadata intensive workloads. The ``logbsize`` option below |
Masanari Iida | 9ed354b | 2013-08-20 20:33:17 +0900 | [diff] [blame] | 124 | controls the size of each buffer and so is also relevant to |
Dave Chinner | 3e5b7d8 | 2013-07-10 07:03:59 +1000 | [diff] [blame] | 125 | this case. |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 126 | |
| 127 | logbsize=value |
Dave Chinner | 3e5b7d8 | 2013-07-10 07:03:59 +1000 | [diff] [blame] | 128 | Set the size of each in-memory log buffer. The size may be |
| 129 | specified in bytes, or in kilobytes with a "k" suffix. |
| 130 | Valid sizes for version 1 and version 2 logs are 16384 (16k) |
| 131 | and 32768 (32k). Valid sizes for version 2 logs also |
| 132 | include 65536 (64k), 131072 (128k) and 262144 (256k). The |
| 133 | logbsize must be an integer multiple of the log |
Sheriff Esseson | 89b408a | 2019-07-15 09:15:09 -0700 | [diff] [blame] | 134 | stripe unit configured at **mkfs(8)** time. |
Dave Chinner | 3e5b7d8 | 2013-07-10 07:03:59 +1000 | [diff] [blame] | 135 | |
Randy Dunlap | 559394d | 2020-07-03 20:20:20 -0700 | [diff] [blame] | 136 | The default value for version 1 logs is 32768, while the |
Dave Chinner | 3e5b7d8 | 2013-07-10 07:03:59 +1000 | [diff] [blame] | 137 | default value for version 2 logs is MAX(32768, log_sunit). |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 138 | |
| 139 | logdev=device and rtdev=device |
| 140 | Use an external log (metadata journal) and/or real-time device. |
| 141 | An XFS filesystem has up to three parts: a data section, a log |
| 142 | section, and a real-time section. The real-time section is |
| 143 | optional, and the log section can be separate from the data |
| 144 | section or contained within it. |
| 145 | |
| 146 | noalign |
Dave Chinner | 3e5b7d8 | 2013-07-10 07:03:59 +1000 | [diff] [blame] | 147 | Data allocations will not be aligned at stripe unit |
| 148 | boundaries. This is only relevant to filesystems created |
Sheriff Esseson | 89b408a | 2019-07-15 09:15:09 -0700 | [diff] [blame] | 149 | with non-zero data alignment parameters (``sunit``, ``swidth``) by |
| 150 | **mkfs(8)**. |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 151 | |
| 152 | norecovery |
| 153 | The filesystem will be mounted without running log recovery. |
| 154 | If the filesystem was not cleanly unmounted, it is likely to |
Sheriff Esseson | 89b408a | 2019-07-15 09:15:09 -0700 | [diff] [blame] | 155 | be inconsistent when mounted in ``norecovery`` mode. |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 156 | Some files or directories may not be accessible because of this. |
Sheriff Esseson | 89b408a | 2019-07-15 09:15:09 -0700 | [diff] [blame] | 157 | Filesystems mounted ``norecovery`` must be mounted read-only or |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 158 | the mount will fail. |
| 159 | |
| 160 | nouuid |
Dave Chinner | 3e5b7d8 | 2013-07-10 07:03:59 +1000 | [diff] [blame] | 161 | Don't check for double mounted file systems using the file |
Sheriff Esseson | 89b408a | 2019-07-15 09:15:09 -0700 | [diff] [blame] | 162 | system ``uuid``. This is useful to mount LVM snapshot volumes, |
| 163 | and often used in combination with ``norecovery`` for mounting |
Dave Chinner | 3e5b7d8 | 2013-07-10 07:03:59 +1000 | [diff] [blame] | 164 | read-only snapshots. |
| 165 | |
| 166 | noquota |
| 167 | Forcibly turns off all quota accounting and enforcement |
| 168 | within the filesystem. |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 169 | |
Nathan Scott | fc97bbf | 2005-11-03 13:46:43 +1100 | [diff] [blame] | 170 | uquota/usrquota/uqnoenforce/quota |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 171 | User disk quota accounting enabled, and limits (optionally) |
Sheriff Esseson | 89b408a | 2019-07-15 09:15:09 -0700 | [diff] [blame] | 172 | enforced. Refer to **xfs_quota(8)** for further details. |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 173 | |
Nathan Scott | fc97bbf | 2005-11-03 13:46:43 +1100 | [diff] [blame] | 174 | gquota/grpquota/gqnoenforce |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 175 | Group disk quota accounting enabled and limits (optionally) |
Sheriff Esseson | 89b408a | 2019-07-15 09:15:09 -0700 | [diff] [blame] | 176 | enforced. Refer to **xfs_quota(8)** for further details. |
Nathan Scott | fc97bbf | 2005-11-03 13:46:43 +1100 | [diff] [blame] | 177 | |
| 178 | pquota/prjquota/pqnoenforce |
| 179 | Project disk quota accounting enabled and limits (optionally) |
Sheriff Esseson | 89b408a | 2019-07-15 09:15:09 -0700 | [diff] [blame] | 180 | enforced. Refer to **xfs_quota(8)** for further details. |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 181 | |
| 182 | sunit=value and swidth=value |
Dave Chinner | 3e5b7d8 | 2013-07-10 07:03:59 +1000 | [diff] [blame] | 183 | Used to specify the stripe unit and width for a RAID device |
| 184 | or a stripe volume. "value" must be specified in 512-byte |
| 185 | block units. These options are only relevant to filesystems |
| 186 | that were created with non-zero data alignment parameters. |
| 187 | |
Sheriff Esseson | 89b408a | 2019-07-15 09:15:09 -0700 | [diff] [blame] | 188 | The ``sunit`` and ``swidth`` parameters specified must be compatible |
Dave Chinner | 3e5b7d8 | 2013-07-10 07:03:59 +1000 | [diff] [blame] | 189 | with the existing filesystem alignment characteristics. In |
Sheriff Esseson | 89b408a | 2019-07-15 09:15:09 -0700 | [diff] [blame] | 190 | general, that means the only valid changes to ``sunit`` are |
| 191 | increasing it by a power-of-2 multiple. Valid ``swidth`` values |
| 192 | are any integer multiple of a valid ``sunit`` value. |
Dave Chinner | 3e5b7d8 | 2013-07-10 07:03:59 +1000 | [diff] [blame] | 193 | |
| 194 | Typically the only time these mount options are necessary if |
| 195 | after an underlying RAID device has had it's geometry |
| 196 | modified, such as adding a new disk to a RAID5 lun and |
| 197 | reshaping it. |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 198 | |
Nathan Scott | fc97bbf | 2005-11-03 13:46:43 +1100 | [diff] [blame] | 199 | swalloc |
| 200 | Data allocations will be rounded up to stripe width boundaries |
| 201 | when the current end of file is being extended and the file |
| 202 | size is larger than the stripe width size. |
| 203 | |
Dave Chinner | 3e5b7d8 | 2013-07-10 07:03:59 +1000 | [diff] [blame] | 204 | wsync |
| 205 | When specified, all filesystem namespace operations are |
| 206 | executed synchronously. This ensures that when the namespace |
| 207 | operation (create, unlink, etc) completes, the change to the |
| 208 | namespace is on stable storage. This is useful in HA setups |
| 209 | where failover must not result in clients seeing |
| 210 | inconsistent namespace presentation during or after a |
| 211 | failover event. |
| 212 | |
Darrick J. Wong | b96cb83 | 2020-09-10 10:57:17 -0700 | [diff] [blame] | 213 | Deprecation of V4 Format |
| 214 | ======================== |
| 215 | |
| 216 | The V4 filesystem format lacks certain features that are supported by |
| 217 | the V5 format, such as metadata checksumming, strengthened metadata |
| 218 | verification, and the ability to store timestamps past the year 2038. |
| 219 | Because of this, the V4 format is deprecated. All users should upgrade |
| 220 | by backing up their files, reformatting, and restoring from the backup. |
| 221 | |
| 222 | Administrators and users can detect a V4 filesystem by running xfs_info |
| 223 | against a filesystem mountpoint and checking for a string containing |
| 224 | "crc=". If no such string is found, please upgrade xfsprogs to the |
| 225 | latest version and try again. |
| 226 | |
| 227 | The deprecation will take place in two parts. Support for mounting V4 |
| 228 | filesystems can now be disabled at kernel build time via Kconfig option. |
| 229 | The option will default to yes until September 2025, at which time it |
| 230 | will be changed to default to no. In September 2030, support will be |
| 231 | removed from the codebase entirely. |
| 232 | |
| 233 | Note: Distributors may choose to withdraw V4 format support earlier than |
| 234 | the dates listed above. |
Dave Chinner | 3e5b7d8 | 2013-07-10 07:03:59 +1000 | [diff] [blame] | 235 | |
| 236 | Deprecated Mount Options |
| 237 | ======================== |
| 238 | |
Sheriff Esseson | 89b408a | 2019-07-15 09:15:09 -0700 | [diff] [blame] | 239 | =========================== ================ |
Dave Chinner | 4cf4573 | 2016-12-09 16:49:54 +1100 | [diff] [blame] | 240 | Name Removal Schedule |
Sheriff Esseson | 89b408a | 2019-07-15 09:15:09 -0700 | [diff] [blame] | 241 | =========================== ================ |
Darrick J. Wong | b96cb83 | 2020-09-10 10:57:17 -0700 | [diff] [blame] | 242 | Mounting with V4 filesystem September 2030 |
Pavel Reichl | c23c393 | 2020-09-25 11:10:29 -0700 | [diff] [blame] | 243 | ikeep/noikeep September 2025 |
| 244 | attr2/noattr2 September 2025 |
Sheriff Esseson | 89b408a | 2019-07-15 09:15:09 -0700 | [diff] [blame] | 245 | =========================== ================ |
Dave Chinner | 3e5b7d8 | 2013-07-10 07:03:59 +1000 | [diff] [blame] | 246 | |
Dave Chinner | 3e5b7d8 | 2013-07-10 07:03:59 +1000 | [diff] [blame] | 247 | |
Eric Sandeen | 444a702 | 2015-02-24 10:17:04 +1100 | [diff] [blame] | 248 | Removed Mount Options |
| 249 | ===================== |
Dave Chinner | 3e5b7d8 | 2013-07-10 07:03:59 +1000 | [diff] [blame] | 250 | |
Sheriff Esseson | 89b408a | 2019-07-15 09:15:09 -0700 | [diff] [blame] | 251 | =========================== ======= |
Eric Sandeen | 444a702 | 2015-02-24 10:17:04 +1100 | [diff] [blame] | 252 | Name Removed |
Sheriff Esseson | 89b408a | 2019-07-15 09:15:09 -0700 | [diff] [blame] | 253 | =========================== ======= |
Fanael Linithien | 4d66ea0 | 2015-06-01 07:15:38 +1000 | [diff] [blame] | 254 | delaylog/nodelaylog v4.0 |
| 255 | ihashsize v4.0 |
| 256 | irixsgid v4.0 |
| 257 | osyncisdsync/osyncisosync v4.0 |
Eric Sandeen | 1c02d50 | 2018-07-26 09:11:27 -0700 | [diff] [blame] | 258 | barrier v4.19 |
| 259 | nobarrier v4.19 |
Sheriff Esseson | 89b408a | 2019-07-15 09:15:09 -0700 | [diff] [blame] | 260 | =========================== ======= |
Nathan Scott | fc97bbf | 2005-11-03 13:46:43 +1100 | [diff] [blame] | 261 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 262 | sysctls |
| 263 | ======= |
| 264 | |
| 265 | The following sysctls are available for the XFS filesystem: |
| 266 | |
| 267 | fs.xfs.stats_clear (Min: 0 Default: 0 Max: 1) |
Nathan Scott | fc97bbf | 2005-11-03 13:46:43 +1100 | [diff] [blame] | 268 | Setting this to "1" clears accumulated XFS statistics |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 269 | in /proc/fs/xfs/stat. It then immediately resets to "0". |
Nathan Scott | fc97bbf | 2005-11-03 13:46:43 +1100 | [diff] [blame] | 270 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 271 | fs.xfs.xfssyncd_centisecs (Min: 100 Default: 3000 Max: 720000) |
Dave Chinner | 3e5b7d8 | 2013-07-10 07:03:59 +1000 | [diff] [blame] | 272 | The interval at which the filesystem flushes metadata |
| 273 | out to disk and runs internal cache cleanup routines. |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 274 | |
Dave Chinner | 3e5b7d8 | 2013-07-10 07:03:59 +1000 | [diff] [blame] | 275 | fs.xfs.filestream_centisecs (Min: 1 Default: 3000 Max: 360000) |
| 276 | The interval at which the filesystem ages filestreams cache |
| 277 | references and returns timed-out AGs back to the free stream |
| 278 | pool. |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 279 | |
Dave Chinner | 3e5b7d8 | 2013-07-10 07:03:59 +1000 | [diff] [blame] | 280 | fs.xfs.speculative_prealloc_lifetime |
Randy Dunlap | 99528ef | 2019-12-11 13:18:37 -0800 | [diff] [blame] | 281 | (Units: seconds Min: 1 Default: 300 Max: 86400) |
Dave Chinner | 3e5b7d8 | 2013-07-10 07:03:59 +1000 | [diff] [blame] | 282 | The interval at which the background scanning for inodes |
| 283 | with unused speculative preallocation runs. The scan |
| 284 | removes unused preallocation from clean inodes and releases |
| 285 | the unused space back to the free pool. |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 286 | |
| 287 | fs.xfs.error_level (Min: 0 Default: 3 Max: 11) |
| 288 | A volume knob for error reporting when internal errors occur. |
| 289 | This will generate detailed messages & backtraces for filesystem |
| 290 | shutdowns, for example. Current threshold values are: |
| 291 | |
| 292 | XFS_ERRLEVEL_OFF: 0 |
| 293 | XFS_ERRLEVEL_LOW: 1 |
| 294 | XFS_ERRLEVEL_HIGH: 5 |
| 295 | |
Marco Benatto | d519da4 | 2019-02-01 09:12:20 -0800 | [diff] [blame] | 296 | fs.xfs.panic_mask (Min: 0 Default: 0 Max: 256) |
Nathan Scott | fc97bbf | 2005-11-03 13:46:43 +1100 | [diff] [blame] | 297 | Causes certain error conditions to call BUG(). Value is a bitmask; |
Eric Sandeen | de8bd0e | 2015-02-06 09:20:29 +1100 | [diff] [blame] | 298 | OR together the tags which represent errors which should cause panics: |
Nathan Scott | fc97bbf | 2005-11-03 13:46:43 +1100 | [diff] [blame] | 299 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 300 | XFS_NO_PTAG 0 |
| 301 | XFS_PTAG_IFLUSH 0x00000001 |
| 302 | XFS_PTAG_LOGRES 0x00000002 |
| 303 | XFS_PTAG_AILDELETE 0x00000004 |
| 304 | XFS_PTAG_ERROR_REPORT 0x00000008 |
| 305 | XFS_PTAG_SHUTDOWN_CORRUPT 0x00000010 |
| 306 | XFS_PTAG_SHUTDOWN_IOERROR 0x00000020 |
| 307 | XFS_PTAG_SHUTDOWN_LOGERROR 0x00000040 |
Eric Sandeen | de8bd0e | 2015-02-06 09:20:29 +1100 | [diff] [blame] | 308 | XFS_PTAG_FSBLOCK_ZERO 0x00000080 |
Marco Benatto | d519da4 | 2019-02-01 09:12:20 -0800 | [diff] [blame] | 309 | XFS_PTAG_VERIFIER_ERROR 0x00000100 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 310 | |
Nathan Scott | fc97bbf | 2005-11-03 13:46:43 +1100 | [diff] [blame] | 311 | This option is intended for debugging only. |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 312 | |
| 313 | fs.xfs.irix_symlink_mode (Min: 0 Default: 0 Max: 1) |
| 314 | Controls whether symlinks are created with mode 0777 (default) |
| 315 | or whether their mode is affected by the umask (irix mode). |
| 316 | |
| 317 | fs.xfs.irix_sgid_inherit (Min: 0 Default: 0 Max: 1) |
| 318 | Controls files created in SGID directories. |
| 319 | If the group ID of the new file does not match the effective group |
Nathan Scott | fc97bbf | 2005-11-03 13:46:43 +1100 | [diff] [blame] | 320 | ID or one of the supplementary group IDs of the parent dir, the |
| 321 | ISGID bit is cleared if the irix_sgid_inherit compatibility sysctl |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 322 | is set. |
| 323 | |
Nathan Scott | fc97bbf | 2005-11-03 13:46:43 +1100 | [diff] [blame] | 324 | fs.xfs.inherit_sync (Min: 0 Default: 1 Max: 1) |
| 325 | Setting this to "1" will cause the "sync" flag set |
Sheriff Esseson | 89b408a | 2019-07-15 09:15:09 -0700 | [diff] [blame] | 326 | by the **xfs_io(8)** chattr command on a directory to be |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 327 | inherited by files in that directory. |
| 328 | |
Nathan Scott | fc97bbf | 2005-11-03 13:46:43 +1100 | [diff] [blame] | 329 | fs.xfs.inherit_nodump (Min: 0 Default: 1 Max: 1) |
| 330 | Setting this to "1" will cause the "nodump" flag set |
Sheriff Esseson | 89b408a | 2019-07-15 09:15:09 -0700 | [diff] [blame] | 331 | by the **xfs_io(8)** chattr command on a directory to be |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 332 | inherited by files in that directory. |
| 333 | |
Nathan Scott | fc97bbf | 2005-11-03 13:46:43 +1100 | [diff] [blame] | 334 | fs.xfs.inherit_noatime (Min: 0 Default: 1 Max: 1) |
| 335 | Setting this to "1" will cause the "noatime" flag set |
Sheriff Esseson | 89b408a | 2019-07-15 09:15:09 -0700 | [diff] [blame] | 336 | by the **xfs_io(8)** chattr command on a directory to be |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 337 | inherited by files in that directory. |
Nathan Scott | fc97bbf | 2005-11-03 13:46:43 +1100 | [diff] [blame] | 338 | |
| 339 | fs.xfs.inherit_nosymlinks (Min: 0 Default: 1 Max: 1) |
| 340 | Setting this to "1" will cause the "nosymlinks" flag set |
Sheriff Esseson | 89b408a | 2019-07-15 09:15:09 -0700 | [diff] [blame] | 341 | by the **xfs_io(8)** chattr command on a directory to be |
Nathan Scott | fc97bbf | 2005-11-03 13:46:43 +1100 | [diff] [blame] | 342 | inherited by files in that directory. |
| 343 | |
Dave Chinner | 3e5b7d8 | 2013-07-10 07:03:59 +1000 | [diff] [blame] | 344 | fs.xfs.inherit_nodefrag (Min: 0 Default: 1 Max: 1) |
| 345 | Setting this to "1" will cause the "nodefrag" flag set |
Sheriff Esseson | 89b408a | 2019-07-15 09:15:09 -0700 | [diff] [blame] | 346 | by the **xfs_io(8)** chattr command on a directory to be |
Dave Chinner | 3e5b7d8 | 2013-07-10 07:03:59 +1000 | [diff] [blame] | 347 | inherited by files in that directory. |
| 348 | |
Nathan Scott | fc97bbf | 2005-11-03 13:46:43 +1100 | [diff] [blame] | 349 | fs.xfs.rotorstep (Min: 1 Default: 1 Max: 256) |
| 350 | In "inode32" allocation mode, this option determines how many |
| 351 | files the allocator attempts to allocate in the same allocation |
| 352 | group before moving to the next allocation group. The intent |
| 353 | is to control the rate at which the allocator moves between |
| 354 | allocation groups when allocating extents for new files. |
Dave Chinner | 3e5b7d8 | 2013-07-10 07:03:59 +1000 | [diff] [blame] | 355 | |
| 356 | Deprecated Sysctls |
| 357 | ================== |
| 358 | |
Pavel Reichl | 3442de9 | 2020-09-25 11:11:37 -0700 | [diff] [blame] | 359 | =========================== ================ |
| 360 | Name Removal Schedule |
| 361 | =========================== ================ |
| 362 | fs.xfs.irix_sgid_inherit September 2025 |
| 363 | fs.xfs.irix_symlink_mode September 2025 |
| 364 | =========================== ================ |
Dave Chinner | 3e5b7d8 | 2013-07-10 07:03:59 +1000 | [diff] [blame] | 365 | |
Dave Chinner | 3e5b7d8 | 2013-07-10 07:03:59 +1000 | [diff] [blame] | 366 | |
Dave Chinner | 64af7a6 | 2015-01-09 10:47:43 +1100 | [diff] [blame] | 367 | Removed Sysctls |
| 368 | =============== |
Dave Chinner | 3e5b7d8 | 2013-07-10 07:03:59 +1000 | [diff] [blame] | 369 | |
Sheriff Esseson | 38a449f | 2019-07-23 12:48:13 +0100 | [diff] [blame] | 370 | ============================= ======= |
Dave Chinner | 64af7a6 | 2015-01-09 10:47:43 +1100 | [diff] [blame] | 371 | Name Removed |
Sheriff Esseson | 38a449f | 2019-07-23 12:48:13 +0100 | [diff] [blame] | 372 | ============================= ======= |
Fanael Linithien | 4d66ea0 | 2015-06-01 07:15:38 +1000 | [diff] [blame] | 373 | fs.xfs.xfsbufd_centisec v4.0 |
| 374 | fs.xfs.age_buffer_centisecs v4.0 |
Sheriff Esseson | 38a449f | 2019-07-23 12:48:13 +0100 | [diff] [blame] | 375 | ============================= ======= |
Carlos Maiolino | 5694fe9 | 2016-09-19 09:38:25 +1000 | [diff] [blame] | 376 | |
| 377 | Error handling |
| 378 | ============== |
| 379 | |
| 380 | XFS can act differently according to the type of error found during its |
| 381 | operation. The implementation introduces the following concepts to the error |
| 382 | handler: |
| 383 | |
| 384 | -failure speed: |
| 385 | Defines how fast XFS should propagate an error upwards when a specific |
| 386 | error is found during the filesystem operation. It can propagate |
| 387 | immediately, after a defined number of retries, after a set time period, |
| 388 | or simply retry forever. |
| 389 | |
| 390 | -error classes: |
| 391 | Specifies the subsystem the error configuration will apply to, such as |
| 392 | metadata IO or memory allocation. Different subsystems will have |
| 393 | different error handlers for which behaviour can be configured. |
| 394 | |
| 395 | -error handlers: |
| 396 | Defines the behavior for a specific error. |
| 397 | |
Sheriff Esseson | 89b408a | 2019-07-15 09:15:09 -0700 | [diff] [blame] | 398 | The filesystem behavior during an error can be set via ``sysfs`` files. Each |
Carlos Maiolino | 5694fe9 | 2016-09-19 09:38:25 +1000 | [diff] [blame] | 399 | error handler works independently - the first condition met by an error handler |
| 400 | for a specific class will cause the error to be propagated rather than reset and |
| 401 | retried. |
| 402 | |
| 403 | The action taken by the filesystem when the error is propagated is context |
| 404 | dependent - it may cause a shut down in the case of an unrecoverable error, |
| 405 | it may be reported back to userspace, or it may even be ignored because |
| 406 | there's nothing useful we can with the error or anyone we can report it to (e.g. |
| 407 | during unmount). |
| 408 | |
| 409 | The configuration files are organized into the following hierarchy for each |
| 410 | mounted filesystem: |
| 411 | |
| 412 | /sys/fs/xfs/<dev>/error/<class>/<error>/ |
| 413 | |
| 414 | Where: |
| 415 | <dev> |
| 416 | The short device name of the mounted filesystem. This is the same device |
| 417 | name that shows up in XFS kernel error messages as "XFS(<dev>): ..." |
| 418 | |
| 419 | <class> |
| 420 | The subsystem the error configuration belongs to. As of 4.9, the defined |
| 421 | classes are: |
| 422 | |
| 423 | - "metadata": applies metadata buffer write IO |
| 424 | |
| 425 | <error> |
| 426 | The individual error handler configurations. |
| 427 | |
| 428 | |
| 429 | Each filesystem has "global" error configuration options defined in their top |
| 430 | level directory: |
| 431 | |
| 432 | /sys/fs/xfs/<dev>/error/ |
| 433 | |
| 434 | fail_at_unmount (Min: 0 Default: 1 Max: 1) |
| 435 | Defines the filesystem error behavior at unmount time. |
| 436 | |
| 437 | If set to a value of 1, XFS will override all other error configurations |
| 438 | during unmount and replace them with "immediate fail" characteristics. |
| 439 | i.e. no retries, no retry timeout. This will always allow unmount to |
| 440 | succeed when there are persistent errors present. |
| 441 | |
| 442 | If set to 0, the configured retry behaviour will continue until all |
| 443 | retries and/or timeouts have been exhausted. This will delay unmount |
| 444 | completion when there are persistent errors, and it may prevent the |
| 445 | filesystem from ever unmounting fully in the case of "retry forever" |
| 446 | handler configurations. |
| 447 | |
Will Deacon | 806654a | 2018-11-19 11:02:45 +0000 | [diff] [blame] | 448 | Note: there is no guarantee that fail_at_unmount can be set while an |
Sheriff Esseson | 89b408a | 2019-07-15 09:15:09 -0700 | [diff] [blame] | 449 | unmount is in progress. It is possible that the ``sysfs`` entries are |
Carlos Maiolino | 5694fe9 | 2016-09-19 09:38:25 +1000 | [diff] [blame] | 450 | removed by the unmounting filesystem before a "retry forever" error |
| 451 | handler configuration causes unmount to hang, and hence the filesystem |
| 452 | must be configured appropriately before unmount begins to prevent |
| 453 | unmount hangs. |
| 454 | |
| 455 | Each filesystem has specific error class handlers that define the error |
| 456 | propagation behaviour for specific errors. There is also a "default" error |
| 457 | handler defined, which defines the behaviour for all errors that don't have |
Sheriff Esseson | 89b408a | 2019-07-15 09:15:09 -0700 | [diff] [blame] | 458 | specific handlers defined. Where multiple retry constraints are configured for |
Carlos Maiolino | 5694fe9 | 2016-09-19 09:38:25 +1000 | [diff] [blame] | 459 | a single error, the first retry configuration that expires will cause the error |
| 460 | to be propagated. The handler configurations are found in the directory: |
| 461 | |
| 462 | /sys/fs/xfs/<dev>/error/<class>/<error>/ |
| 463 | |
| 464 | max_retries (Min: -1 Default: Varies Max: INTMAX) |
| 465 | Defines the allowed number of retries of a specific error before |
| 466 | the filesystem will propagate the error. The retry count for a given |
| 467 | error context (e.g. a specific metadata buffer) is reset every time |
| 468 | there is a successful completion of the operation. |
| 469 | |
| 470 | Setting the value to "-1" will cause XFS to retry forever for this |
| 471 | specific error. |
| 472 | |
| 473 | Setting the value to "0" will cause XFS to fail immediately when the |
| 474 | specific error is reported. |
| 475 | |
| 476 | Setting the value to "N" (where 0 < N < Max) will make XFS retry the |
| 477 | operation "N" times before propagating the error. |
| 478 | |
| 479 | retry_timeout_seconds (Min: -1 Default: Varies Max: 1 day) |
| 480 | Define the amount of time (in seconds) that the filesystem is |
| 481 | allowed to retry its operations when the specific error is |
| 482 | found. |
| 483 | |
| 484 | Setting the value to "-1" will allow XFS to retry forever for this |
| 485 | specific error. |
| 486 | |
| 487 | Setting the value to "0" will cause XFS to fail immediately when the |
| 488 | specific error is reported. |
| 489 | |
| 490 | Setting the value to "N" (where 0 < N < Max) will allow XFS to retry the |
| 491 | operation for up to "N" seconds before propagating the error. |
| 492 | |
Sheriff Esseson | 89b408a | 2019-07-15 09:15:09 -0700 | [diff] [blame] | 493 | **Note:** The default behaviour for a specific error handler is dependent on both |
Carlos Maiolino | 5694fe9 | 2016-09-19 09:38:25 +1000 | [diff] [blame] | 494 | the class and error context. For example, the default values for |
| 495 | "metadata/ENODEV" are "0" rather than "-1" so that this error handler defaults |
| 496 | to "fail immediately" behaviour. This is done because ENODEV is a fatal, |
| 497 | unrecoverable error no matter how many times the metadata IO is retried. |