btrfs.txt 9.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270
  1. BTRFS
  2. =====
  3. Btrfs is a copy on write filesystem for Linux aimed at
  4. implementing advanced features while focusing on fault tolerance,
  5. repair and easy administration. Initially developed by Oracle, Btrfs
  6. is licensed under the GPL and open for contribution from anyone.
  7. Linux has a wealth of filesystems to choose from, but we are facing a
  8. number of challenges with scaling to the large storage subsystems that
  9. are becoming common in today's data centers. Filesystems need to scale
  10. in their ability to address and manage large storage, and also in
  11. their ability to detect, repair and tolerate errors in the data stored
  12. on disk. Btrfs is under heavy development, and is not suitable for
  13. any uses other than benchmarking and review. The Btrfs disk format is
  14. not yet finalized.
  15. The main Btrfs features include:
  16. * Extent based file storage (2^64 max file size)
  17. * Space efficient packing of small files
  18. * Space efficient indexed directories
  19. * Dynamic inode allocation
  20. * Writable snapshots
  21. * Subvolumes (separate internal filesystem roots)
  22. * Object level mirroring and striping
  23. * Checksums on data and metadata (multiple algorithms available)
  24. * Compression
  25. * Integrated multiple device support, with several raid algorithms
  26. * Online filesystem check (not yet implemented)
  27. * Very fast offline filesystem check
  28. * Efficient incremental backup and FS mirroring (not yet implemented)
  29. * Online filesystem defragmentation
  30. Mount Options
  31. =============
  32. When mounting a btrfs filesystem, the following option are accepted.
  33. Options with (*) are default options and will not show in the mount options.
  34. alloc_start=<bytes>
  35. Debugging option to force all block allocations above a certain
  36. byte threshold on each block device. The value is specified in
  37. bytes, optionally with a K, M, or G suffix, case insensitive.
  38. Default is 1MB.
  39. noautodefrag(*)
  40. autodefrag
  41. Disable/enable auto defragmentation.
  42. Auto defragmentation detects small random writes into files and queue
  43. them up for the defrag process. Works best for small files;
  44. Not well suited for large database workloads.
  45. check_int
  46. check_int_data
  47. check_int_print_mask=<value>
  48. These debugging options control the behavior of the integrity checking
  49. module (the BTRFS_FS_CHECK_INTEGRITY config option required).
  50. check_int enables the integrity checker module, which examines all
  51. block write requests to ensure on-disk consistency, at a large
  52. memory and CPU cost.
  53. check_int_data includes extent data in the integrity checks, and
  54. implies the check_int option.
  55. check_int_print_mask takes a bitmask of BTRFSIC_PRINT_MASK_* values
  56. as defined in fs/btrfs/check-integrity.c, to control the integrity
  57. checker module behavior.
  58. See comments at the top of fs/btrfs/check-integrity.c for more info.
  59. commit=<seconds>
  60. Set the interval of periodic commit, 30 seconds by default. Higher
  61. values defer data being synced to permanent storage with obvious
  62. consequences when the system crashes. The upper bound is not forced,
  63. but a warning is printed if it's more than 300 seconds (5 minutes).
  64. compress
  65. compress=<type>
  66. compress-force
  67. compress-force=<type>
  68. Control BTRFS file data compression. Type may be specified as "zlib"
  69. "lzo" or "no" (for no compression, used for remounting). If no type
  70. is specified, zlib is used. If compress-force is specified,
  71. all files will be compressed, whether or not they compress well.
  72. If compression is enabled, nodatacow and nodatasum are disabled.
  73. degraded
  74. Allow mounts to continue with missing devices. A read-write mount may
  75. fail with too many devices missing, for example if a stripe member
  76. is completely missing.
  77. device=<devicepath>
  78. Specify a device during mount so that ioctls on the control device
  79. can be avoided. Especially useful when trying to mount a multi-device
  80. setup as root. May be specified multiple times for multiple devices.
  81. nodiscard(*)
  82. discard
  83. Disable/enable discard mount option.
  84. Discard issues frequent commands to let the block device reclaim space
  85. freed by the filesystem.
  86. This is useful for SSD devices, thinly provisioned
  87. LUNs and virtual machine images, but may have a significant
  88. performance impact. (The fstrim command is also available to
  89. initiate batch trims from userspace).
  90. noenospc_debug(*)
  91. enospc_debug
  92. Disable/enable debugging option to be more verbose in some ENOSPC conditions.
  93. fatal_errors=<action>
  94. Action to take when encountering a fatal error:
  95. "bug" - BUG() on a fatal error. This is the default.
  96. "panic" - panic() on a fatal error.
  97. noflushoncommit(*)
  98. flushoncommit
  99. The 'flushoncommit' mount option forces any data dirtied by a write in a
  100. prior transaction to commit as part of the current commit. This makes
  101. the committed state a fully consistent view of the file system from the
  102. application's perspective (i.e., it includes all completed file system
  103. operations). This was previously the behavior only when a snapshot is
  104. created.
  105. inode_cache
  106. Enable free inode number caching. Defaults to off due to an overflow
  107. problem when the free space crcs don't fit inside a single page.
  108. max_inline=<bytes>
  109. Specify the maximum amount of space, in bytes, that can be inlined in
  110. a metadata B-tree leaf. The value is specified in bytes, optionally
  111. with a K, M, or G suffix, case insensitive. In practice, this value
  112. is limited by the root sector size, with some space unavailable due
  113. to leaf headers. For a 4k sector size, max inline data is ~3900 bytes.
  114. metadata_ratio=<value>
  115. Specify that 1 metadata chunk should be allocated after every <value>
  116. data chunks. Off by default.
  117. acl(*)
  118. noacl
  119. Enable/disable support for Posix Access Control Lists (ACLs). See the
  120. acl(5) manual page for more information about ACLs.
  121. barrier(*)
  122. nobarrier
  123. Enable/disable the use of block layer write barriers. Write barriers
  124. ensure that certain IOs make it through the device cache and are on
  125. persistent storage. If disabled on a device with a volatile
  126. (non-battery-backed) write-back cache, nobarrier option will lead to
  127. filesystem corruption on a system crash or power loss.
  128. datacow(*)
  129. nodatacow
  130. Enable/disable data copy-on-write for newly created files.
  131. Nodatacow implies nodatasum, and disables all compression.
  132. datasum(*)
  133. nodatasum
  134. Enable/disable data checksumming for newly created files.
  135. Datasum implies datacow.
  136. treelog(*)
  137. notreelog
  138. Enable/disable the tree logging used for fsync and O_SYNC writes.
  139. recovery
  140. Enable autorecovery attempts if a bad tree root is found at mount time.
  141. Currently this scans a list of several previous tree roots and tries to
  142. use the first readable.
  143. rescan_uuid_tree
  144. Force check and rebuild procedure of the UUID tree. This should not
  145. normally be needed.
  146. skip_balance
  147. Skip automatic resume of interrupted balance operation after mount.
  148. May be resumed with "btrfs balance resume."
  149. space_cache (*)
  150. Enable the on-disk freespace cache.
  151. nospace_cache
  152. Disable freespace cache loading without clearing the cache.
  153. clear_cache
  154. Force clearing and rebuilding of the disk space cache if something
  155. has gone wrong.
  156. ssd
  157. nossd
  158. ssd_spread
  159. Options to control ssd allocation schemes. By default, BTRFS will
  160. enable or disable ssd allocation heuristics depending on whether a
  161. rotational or non-rotational disk is in use. The ssd and nossd options
  162. can override this autodetection.
  163. The ssd_spread mount option attempts to allocate into big chunks
  164. of unused space, and may perform better on low-end ssds. ssd_spread
  165. implies ssd, enabling all other ssd heuristics as well.
  166. subvol=<path>
  167. Mount subvolume at <path> rather than the root subvolume. <path> is
  168. relative to the top level subvolume.
  169. subvolid=<ID>
  170. Mount subvolume specified by an ID number rather than the root subvolume.
  171. This allows mounting of subvolumes which are not in the root of the mounted
  172. filesystem.
  173. You can use "btrfs subvolume list" to see subvolume ID numbers.
  174. subvolrootid=<objectid> (deprecated)
  175. Mount subvolume specified by <objectid> rather than the root subvolume.
  176. This allows mounting of subvolumes which are not in the root of the mounted
  177. filesystem.
  178. You can use "btrfs subvolume show " to see the object ID for a subvolume.
  179. thread_pool=<number>
  180. The number of worker threads to allocate. The default number is equal
  181. to the number of CPUs + 2, or 8, whichever is smaller.
  182. user_subvol_rm_allowed
  183. Allow subvolumes to be deleted by a non-root user. Use with caution.
  184. MAILING LIST
  185. ============
  186. There is a Btrfs mailing list hosted on vger.kernel.org. You can
  187. find details on how to subscribe here:
  188. http://vger.kernel.org/vger-lists.html#linux-btrfs
  189. Mailing list archives are available from gmane:
  190. http://dir.gmane.org/gmane.comp.file-systems.btrfs
  191. IRC
  192. ===
  193. Discussion of Btrfs also occurs on the #btrfs channel of the Freenode
  194. IRC network.
  195. UTILITIES
  196. =========
  197. Userspace tools for creating and manipulating Btrfs file systems are
  198. available from the git repository at the following location:
  199. http://git.kernel.org/?p=linux/kernel/git/mason/btrfs-progs.git
  200. git://git.kernel.org/pub/scm/linux/kernel/git/mason/btrfs-progs.git
  201. These include the following tools:
  202. * mkfs.btrfs: create a filesystem
  203. * btrfs: a single tool to manage the filesystems, refer to the manpage for more details
  204. * 'btrfsck' or 'btrfs check': do a consistency check of the filesystem
  205. Other tools for specific tasks:
  206. * btrfs-convert: in-place conversion from ext2/3/4 filesystems
  207. * btrfs-image: dump filesystem metadata for debugging