xfs.txt 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470
  1. The SGI XFS Filesystem
  2. ======================
  3. XFS is a high performance journaling filesystem which originated
  4. on the SGI IRIX platform. It is completely multi-threaded, can
  5. support large files and large filesystems, extended attributes,
  6. variable block sizes, is extent based, and makes extensive use of
  7. Btrees (directories, extents, free space) to aid both performance
  8. and scalability.
  9. Refer to the documentation at http://oss.sgi.com/projects/xfs/
  10. for further details. This implementation is on-disk compatible
  11. with the IRIX version of XFS.
  12. Mount Options
  13. =============
  14. When mounting an XFS filesystem, the following options are accepted.
  15. For boolean mount options, the names with the (*) suffix is the
  16. default behaviour.
  17. allocsize=size
  18. Sets the buffered I/O end-of-file preallocation size when
  19. doing delayed allocation writeout (default size is 64KiB).
  20. Valid values for this option are page size (typically 4KiB)
  21. through to 1GiB, inclusive, in power-of-2 increments.
  22. The default behaviour is for dynamic end-of-file
  23. preallocation size, which uses a set of heuristics to
  24. optimise the preallocation size based on the current
  25. allocation patterns within the file and the access patterns
  26. to the file. Specifying a fixed allocsize value turns off
  27. the dynamic behaviour.
  28. attr2
  29. noattr2
  30. The options enable/disable an "opportunistic" improvement to
  31. be made in the way inline extended attributes are stored
  32. on-disk. When the new form is used for the first time when
  33. attr2 is selected (either when setting or removing extended
  34. attributes) the on-disk superblock feature bit field will be
  35. updated to reflect this format being in use.
  36. The default behaviour is determined by the on-disk feature
  37. bit indicating that attr2 behaviour is active. If either
  38. mount option it set, then that becomes the new default used
  39. by the filesystem.
  40. CRC enabled filesystems always use the attr2 format, and so
  41. will reject the noattr2 mount option if it is set.
  42. discard
  43. nodiscard (*)
  44. Enable/disable the issuing of commands to let the block
  45. device reclaim space freed by the filesystem. This is
  46. useful for SSD devices, thinly provisioned LUNs and virtual
  47. machine images, but may have a performance impact.
  48. Note: It is currently recommended that you use the fstrim
  49. application to discard unused blocks rather than the discard
  50. mount option because the performance impact of this option
  51. is quite severe.
  52. grpid/bsdgroups
  53. nogrpid/sysvgroups (*)
  54. These options define what group ID a newly created file
  55. gets. When grpid is set, it takes the group ID of the
  56. directory in which it is created; otherwise it takes the
  57. fsgid of the current process, unless the directory has the
  58. setgid bit set, in which case it takes the gid from the
  59. parent directory, and also gets the setgid bit set if it is
  60. a directory itself.
  61. filestreams
  62. Make the data allocator use the filestreams allocation mode
  63. across the entire filesystem rather than just on directories
  64. configured to use it.
  65. ikeep
  66. noikeep (*)
  67. When ikeep is specified, XFS does not delete empty inode
  68. clusters and keeps them around on disk. When noikeep is
  69. specified, empty inode clusters are returned to the free
  70. space pool.
  71. inode32
  72. inode64 (*)
  73. When inode32 is specified, it indicates that XFS limits
  74. inode creation to locations which will not result in inode
  75. numbers with more than 32 bits of significance.
  76. When inode64 is specified, it indicates that XFS is allowed
  77. to create inodes at any location in the filesystem,
  78. including those which will result in inode numbers occupying
  79. more than 32 bits of significance.
  80. inode32 is provided for backwards compatibility with older
  81. systems and applications, since 64 bits inode numbers might
  82. cause problems for some applications that cannot handle
  83. large inode numbers. If applications are in use which do
  84. not handle inode numbers bigger than 32 bits, the inode32
  85. option should be specified.
  86. largeio
  87. nolargeio (*)
  88. If "nolargeio" is specified, the optimal I/O reported in
  89. st_blksize by stat(2) will be as small as possible to allow
  90. user applications to avoid inefficient read/modify/write
  91. I/O. This is typically the page size of the machine, as
  92. this is the granularity of the page cache.
  93. If "largeio" specified, a filesystem that was created with a
  94. "swidth" specified will return the "swidth" value (in bytes)
  95. in st_blksize. If the filesystem does not have a "swidth"
  96. specified but does specify an "allocsize" then "allocsize"
  97. (in bytes) will be returned instead. Otherwise the behaviour
  98. is the same as if "nolargeio" was specified.
  99. logbufs=value
  100. Set the number of in-memory log buffers. Valid numbers
  101. range from 2-8 inclusive.
  102. The default value is 8 buffers.
  103. If the memory cost of 8 log buffers is too high on small
  104. systems, then it may be reduced at some cost to performance
  105. on metadata intensive workloads. The logbsize option below
  106. controls the size of each buffer and so is also relevant to
  107. this case.
  108. logbsize=value
  109. Set the size of each in-memory log buffer. The size may be
  110. specified in bytes, or in kilobytes with a "k" suffix.
  111. Valid sizes for version 1 and version 2 logs are 16384 (16k)
  112. and 32768 (32k). Valid sizes for version 2 logs also
  113. include 65536 (64k), 131072 (128k) and 262144 (256k). The
  114. logbsize must be an integer multiple of the log
  115. stripe unit configured at mkfs time.
  116. The default value for for version 1 logs is 32768, while the
  117. default value for version 2 logs is MAX(32768, log_sunit).
  118. logdev=device and rtdev=device
  119. Use an external log (metadata journal) and/or real-time device.
  120. An XFS filesystem has up to three parts: a data section, a log
  121. section, and a real-time section. The real-time section is
  122. optional, and the log section can be separate from the data
  123. section or contained within it.
  124. noalign
  125. Data allocations will not be aligned at stripe unit
  126. boundaries. This is only relevant to filesystems created
  127. with non-zero data alignment parameters (sunit, swidth) by
  128. mkfs.
  129. norecovery
  130. The filesystem will be mounted without running log recovery.
  131. If the filesystem was not cleanly unmounted, it is likely to
  132. be inconsistent when mounted in "norecovery" mode.
  133. Some files or directories may not be accessible because of this.
  134. Filesystems mounted "norecovery" must be mounted read-only or
  135. the mount will fail.
  136. nouuid
  137. Don't check for double mounted file systems using the file
  138. system uuid. This is useful to mount LVM snapshot volumes,
  139. and often used in combination with "norecovery" for mounting
  140. read-only snapshots.
  141. noquota
  142. Forcibly turns off all quota accounting and enforcement
  143. within the filesystem.
  144. uquota/usrquota/uqnoenforce/quota
  145. User disk quota accounting enabled, and limits (optionally)
  146. enforced. Refer to xfs_quota(8) for further details.
  147. gquota/grpquota/gqnoenforce
  148. Group disk quota accounting enabled and limits (optionally)
  149. enforced. Refer to xfs_quota(8) for further details.
  150. pquota/prjquota/pqnoenforce
  151. Project disk quota accounting enabled and limits (optionally)
  152. enforced. Refer to xfs_quota(8) for further details.
  153. sunit=value and swidth=value
  154. Used to specify the stripe unit and width for a RAID device
  155. or a stripe volume. "value" must be specified in 512-byte
  156. block units. These options are only relevant to filesystems
  157. that were created with non-zero data alignment parameters.
  158. The sunit and swidth parameters specified must be compatible
  159. with the existing filesystem alignment characteristics. In
  160. general, that means the only valid changes to sunit are
  161. increasing it by a power-of-2 multiple. Valid swidth values
  162. are any integer multiple of a valid sunit value.
  163. Typically the only time these mount options are necessary if
  164. after an underlying RAID device has had it's geometry
  165. modified, such as adding a new disk to a RAID5 lun and
  166. reshaping it.
  167. swalloc
  168. Data allocations will be rounded up to stripe width boundaries
  169. when the current end of file is being extended and the file
  170. size is larger than the stripe width size.
  171. wsync
  172. When specified, all filesystem namespace operations are
  173. executed synchronously. This ensures that when the namespace
  174. operation (create, unlink, etc) completes, the change to the
  175. namespace is on stable storage. This is useful in HA setups
  176. where failover must not result in clients seeing
  177. inconsistent namespace presentation during or after a
  178. failover event.
  179. Deprecated Mount Options
  180. ========================
  181. Name Removal Schedule
  182. ---- ----------------
  183. barrier no earlier than v4.15
  184. nobarrier no earlier than v4.15
  185. Removed Mount Options
  186. =====================
  187. Name Removed
  188. ---- -------
  189. delaylog/nodelaylog v4.0
  190. ihashsize v4.0
  191. irixsgid v4.0
  192. osyncisdsync/osyncisosync v4.0
  193. sysctls
  194. =======
  195. The following sysctls are available for the XFS filesystem:
  196. fs.xfs.stats_clear (Min: 0 Default: 0 Max: 1)
  197. Setting this to "1" clears accumulated XFS statistics
  198. in /proc/fs/xfs/stat. It then immediately resets to "0".
  199. fs.xfs.xfssyncd_centisecs (Min: 100 Default: 3000 Max: 720000)
  200. The interval at which the filesystem flushes metadata
  201. out to disk and runs internal cache cleanup routines.
  202. fs.xfs.filestream_centisecs (Min: 1 Default: 3000 Max: 360000)
  203. The interval at which the filesystem ages filestreams cache
  204. references and returns timed-out AGs back to the free stream
  205. pool.
  206. fs.xfs.speculative_prealloc_lifetime
  207. (Units: seconds Min: 1 Default: 300 Max: 86400)
  208. The interval at which the background scanning for inodes
  209. with unused speculative preallocation runs. The scan
  210. removes unused preallocation from clean inodes and releases
  211. the unused space back to the free pool.
  212. fs.xfs.error_level (Min: 0 Default: 3 Max: 11)
  213. A volume knob for error reporting when internal errors occur.
  214. This will generate detailed messages & backtraces for filesystem
  215. shutdowns, for example. Current threshold values are:
  216. XFS_ERRLEVEL_OFF: 0
  217. XFS_ERRLEVEL_LOW: 1
  218. XFS_ERRLEVEL_HIGH: 5
  219. fs.xfs.panic_mask (Min: 0 Default: 0 Max: 255)
  220. Causes certain error conditions to call BUG(). Value is a bitmask;
  221. OR together the tags which represent errors which should cause panics:
  222. XFS_NO_PTAG 0
  223. XFS_PTAG_IFLUSH 0x00000001
  224. XFS_PTAG_LOGRES 0x00000002
  225. XFS_PTAG_AILDELETE 0x00000004
  226. XFS_PTAG_ERROR_REPORT 0x00000008
  227. XFS_PTAG_SHUTDOWN_CORRUPT 0x00000010
  228. XFS_PTAG_SHUTDOWN_IOERROR 0x00000020
  229. XFS_PTAG_SHUTDOWN_LOGERROR 0x00000040
  230. XFS_PTAG_FSBLOCK_ZERO 0x00000080
  231. This option is intended for debugging only.
  232. fs.xfs.irix_symlink_mode (Min: 0 Default: 0 Max: 1)
  233. Controls whether symlinks are created with mode 0777 (default)
  234. or whether their mode is affected by the umask (irix mode).
  235. fs.xfs.irix_sgid_inherit (Min: 0 Default: 0 Max: 1)
  236. Controls files created in SGID directories.
  237. If the group ID of the new file does not match the effective group
  238. ID or one of the supplementary group IDs of the parent dir, the
  239. ISGID bit is cleared if the irix_sgid_inherit compatibility sysctl
  240. is set.
  241. fs.xfs.inherit_sync (Min: 0 Default: 1 Max: 1)
  242. Setting this to "1" will cause the "sync" flag set
  243. by the xfs_io(8) chattr command on a directory to be
  244. inherited by files in that directory.
  245. fs.xfs.inherit_nodump (Min: 0 Default: 1 Max: 1)
  246. Setting this to "1" will cause the "nodump" flag set
  247. by the xfs_io(8) chattr command on a directory to be
  248. inherited by files in that directory.
  249. fs.xfs.inherit_noatime (Min: 0 Default: 1 Max: 1)
  250. Setting this to "1" will cause the "noatime" flag set
  251. by the xfs_io(8) chattr command on a directory to be
  252. inherited by files in that directory.
  253. fs.xfs.inherit_nosymlinks (Min: 0 Default: 1 Max: 1)
  254. Setting this to "1" will cause the "nosymlinks" flag set
  255. by the xfs_io(8) chattr command on a directory to be
  256. inherited by files in that directory.
  257. fs.xfs.inherit_nodefrag (Min: 0 Default: 1 Max: 1)
  258. Setting this to "1" will cause the "nodefrag" flag set
  259. by the xfs_io(8) chattr command on a directory to be
  260. inherited by files in that directory.
  261. fs.xfs.rotorstep (Min: 1 Default: 1 Max: 256)
  262. In "inode32" allocation mode, this option determines how many
  263. files the allocator attempts to allocate in the same allocation
  264. group before moving to the next allocation group. The intent
  265. is to control the rate at which the allocator moves between
  266. allocation groups when allocating extents for new files.
  267. Deprecated Sysctls
  268. ==================
  269. None at present.
  270. Removed Sysctls
  271. ===============
  272. Name Removed
  273. ---- -------
  274. fs.xfs.xfsbufd_centisec v4.0
  275. fs.xfs.age_buffer_centisecs v4.0
  276. Error handling
  277. ==============
  278. XFS can act differently according to the type of error found during its
  279. operation. The implementation introduces the following concepts to the error
  280. handler:
  281. -failure speed:
  282. Defines how fast XFS should propagate an error upwards when a specific
  283. error is found during the filesystem operation. It can propagate
  284. immediately, after a defined number of retries, after a set time period,
  285. or simply retry forever.
  286. -error classes:
  287. Specifies the subsystem the error configuration will apply to, such as
  288. metadata IO or memory allocation. Different subsystems will have
  289. different error handlers for which behaviour can be configured.
  290. -error handlers:
  291. Defines the behavior for a specific error.
  292. The filesystem behavior during an error can be set via sysfs files. Each
  293. error handler works independently - the first condition met by an error handler
  294. for a specific class will cause the error to be propagated rather than reset and
  295. retried.
  296. The action taken by the filesystem when the error is propagated is context
  297. dependent - it may cause a shut down in the case of an unrecoverable error,
  298. it may be reported back to userspace, or it may even be ignored because
  299. there's nothing useful we can with the error or anyone we can report it to (e.g.
  300. during unmount).
  301. The configuration files are organized into the following hierarchy for each
  302. mounted filesystem:
  303. /sys/fs/xfs/<dev>/error/<class>/<error>/
  304. Where:
  305. <dev>
  306. The short device name of the mounted filesystem. This is the same device
  307. name that shows up in XFS kernel error messages as "XFS(<dev>): ..."
  308. <class>
  309. The subsystem the error configuration belongs to. As of 4.9, the defined
  310. classes are:
  311. - "metadata": applies metadata buffer write IO
  312. <error>
  313. The individual error handler configurations.
  314. Each filesystem has "global" error configuration options defined in their top
  315. level directory:
  316. /sys/fs/xfs/<dev>/error/
  317. fail_at_unmount (Min: 0 Default: 1 Max: 1)
  318. Defines the filesystem error behavior at unmount time.
  319. If set to a value of 1, XFS will override all other error configurations
  320. during unmount and replace them with "immediate fail" characteristics.
  321. i.e. no retries, no retry timeout. This will always allow unmount to
  322. succeed when there are persistent errors present.
  323. If set to 0, the configured retry behaviour will continue until all
  324. retries and/or timeouts have been exhausted. This will delay unmount
  325. completion when there are persistent errors, and it may prevent the
  326. filesystem from ever unmounting fully in the case of "retry forever"
  327. handler configurations.
  328. Note: there is no guarantee that fail_at_unmount can be set whilst an
  329. unmount is in progress. It is possible that the sysfs entries are
  330. removed by the unmounting filesystem before a "retry forever" error
  331. handler configuration causes unmount to hang, and hence the filesystem
  332. must be configured appropriately before unmount begins to prevent
  333. unmount hangs.
  334. Each filesystem has specific error class handlers that define the error
  335. propagation behaviour for specific errors. There is also a "default" error
  336. handler defined, which defines the behaviour for all errors that don't have
  337. specific handlers defined. Where multiple retry constraints are configuredi for
  338. a single error, the first retry configuration that expires will cause the error
  339. to be propagated. The handler configurations are found in the directory:
  340. /sys/fs/xfs/<dev>/error/<class>/<error>/
  341. max_retries (Min: -1 Default: Varies Max: INTMAX)
  342. Defines the allowed number of retries of a specific error before
  343. the filesystem will propagate the error. The retry count for a given
  344. error context (e.g. a specific metadata buffer) is reset every time
  345. there is a successful completion of the operation.
  346. Setting the value to "-1" will cause XFS to retry forever for this
  347. specific error.
  348. Setting the value to "0" will cause XFS to fail immediately when the
  349. specific error is reported.
  350. Setting the value to "N" (where 0 < N < Max) will make XFS retry the
  351. operation "N" times before propagating the error.
  352. retry_timeout_seconds (Min: -1 Default: Varies Max: 1 day)
  353. Define the amount of time (in seconds) that the filesystem is
  354. allowed to retry its operations when the specific error is
  355. found.
  356. Setting the value to "-1" will allow XFS to retry forever for this
  357. specific error.
  358. Setting the value to "0" will cause XFS to fail immediately when the
  359. specific error is reported.
  360. Setting the value to "N" (where 0 < N < Max) will allow XFS to retry the
  361. operation for up to "N" seconds before propagating the error.
  362. Note: The default behaviour for a specific error handler is dependent on both
  363. the class and error context. For example, the default values for
  364. "metadata/ENODEV" are "0" rather than "-1" so that this error handler defaults
  365. to "fail immediately" behaviour. This is done because ENODEV is a fatal,
  366. unrecoverable error no matter how many times the metadata IO is retried.