btrfs.txt 9.0 KB

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