BTRFS(5) BTRFS BTRFS(5) btrfs - BTRFS ( ) BTRFS . : 1. 2. 3. 4. 5. 6. sysfs 7. 8. 9. 10. 11. 12. 13. 14. 15. RAID56 16. 17. BTRFS BTRFS. mount(8) BTRFS . ( no). : . . ( ) nodatacow nodatasum compress . Linux VFS. ( nodatacow compress). mount . acl, noacl (: ) / POSIX (ACLs). acl(5) ACL. ACL (BTRFS_FS_POSIX_ACL) acl . autodefrag, noautodefrag (: 3.0 : ) . ( 64KiB) . . . : Linux < 3.9 >= 3.14-rc2 Linux >= 3.10.31 >= 3.12.12 >= 3.13.4 (reflinks) COW ( cp --reflink ). . barrier, nobarrier (: ) / . (flush) (superblock) . / . (barriers) . . nobarrier . clear_cache . . v1 ( nospace_cache) . v1 btrfs check --clear-space-cache v1. v2 . btrfs check --clear-space-cache v2. : space_cache. commit= (: 3.12 : 30) . . 300 (5 ). . sync ( cgroups). compress, compress=, compress-force, compress-force= (: : 5.1) BTRFS. zlib lzo zstd no ( ). zlib. compress-force . zlib zstd ( 5.1) ( zstd) . . ZLIB [1, 9] ZSTD [1, 15]. 3. 0 . . . compress-force . 4.15 . : nodatacow nodatasum. datacow, nodatacow (: ) (copy-on-write) . Nodatacow nodatasum compression. nodatacow NOCOW ( chattr(1) ). : nodatacow nodatasum . (in-place) ( ). datasum, nodatasum (: ) . Datasum datacow . nodatasum " " ( chattr(1) ). : nodatacow nodatasum . . / . degraded (: ) RAID. ( ) RAID0. 4.14 (chunk) . (degraded) RAID . : -- raid1 -- (single) -- /dev/sda /dev/sdb sda sdb () single. sdb . device= BTRFS . ( udev) btrfs device scan ( ). device. : RAID1 device . discard, discard=sync, discard=async, nodiscard (: (async) 6.2 : 5.6) (discard) . SSD/NVMe LUN . (sync ) TRIM TRIM . TRIM SATA 3.1 . (async) (extents) TRIM. . fstrim . TRIM . TRIM . enospc_debug, noenospc_debug (: ) (ENOSPC). . fatal_errors= (: 3.4 : bug) . bug BUG() panic panic() . panic oops crashkernel. flushoncommit, noflushoncommit (: ) ( ) . ( ). . (buffered) . fragment= ( CONFIG_BTRFS_DEBUG : 4.4 : ) type . data metadata all. CONFIG_BTRFS_DEBUG . nologreplay (: ) (tree-log) . . treelog. nologreplay norecovery. : ! nologreplay. max_inline= (: (2048 ) ) (inline) b-tree . K ( ). ( sectorsize mkfs) . (sectorsize) b-tree. 4KiB 3900 . 0. (slack) . : 2048 4.6. metadata_ratio= (: 0 ) value . . ( xattrs ). norecovery (: 4.5 : ) . logreplay . nologreplay. : recovery norecovery . BTRFS . rescan_uuid_tree (: 3.12 : ) UUID . . btrfs rescue clear-uuid-tree <#man-rescue-clear-uuid-tree> ( ). rescue (: 5.9) . . o usebackuproot ( 5.9) . usebackuproot o nologreplay ( 5.9) . nologreplay o ignorebadroots ibadroots (: 5.11) . o ignoredatacsums idatacsums (: 5.11) . o ignoremetacsums imetacsums ( 6.12) . o all (: 5.9) . skip_balance (: 3.3 : ) . btrfs balance resume btrfs balance cancel. . space_cache, space_cache=, nospace_cache (nospace_cache : 3.2 space_cache=v1 space_cache=v2 4.5 : space_cache=v2) . . . . v1 v2. v1 nospace_cache . ( ) v1 . v2 b-tree . v2 . clear_cache,space_cache=v1 clear_cache,nospace_cache . v2 v1 ( ) v2 . ( ) "btrfs check --clear-space-cache". btrfs-check(8) <> :doc:`mkfs.btrfs v2 v4.19. v2. ssd, ssd_spread, nossd, nossd_spread (: SSD ) SSD. BTRFS SSD . /sys/block/DEV/queue/rotational). 0 ssd. nossd . . . : 4.14 . SSD (FTL) . SSD . . ssd_spread. ssd_spread SSD . ssd_spread ssd SSD . nossd SSD nossd_spread ssd_spread . subvol= path . path . . subvolid= subvolid . btrfs subvolume list btrfs subvolume show . . : subvolid subvol . thread_pool= (: min(NRCPUS + 2, 8) ) . NRCPUS . . treelog, notreelog (: ) fsync O_SYNC. . . . : ! nologreplay. / . usebackuproot (: 4.6 : ) . . . : recovery . user_subvol_rm_allowed (: ) . (root) . : . . . 4.18 rmdir(2) . rmdir_subvol FILESYSTEM FEATURES. . recovery (: 3.2 : : 4.5) : usebackuproot 4.5 . inode_cache, noinode_cache ( : 5.11 : 3.0 : ) : 5.11 inode_cache btrfs rescue clear-ino-cache <#man-rescue-clear-ino-cache>. check_int, check_int_data, check_int_print_mask= ( : 6.7 : 3.0 : ) ( BTRFS_FS_CHECK_INTEGRITY). . check_int . check_int_data check_int . check_int_print_mask BTRFSIC_PRINT_MASK_* fs/btrfs/check-integrity.c . fs/btrfs/check-integrity.c . mount(8) BTRFS . context SELinux . v6.8 ( BTRFS ). noatime noatime . relatime atime (inode) strictatime. atime relatime (atime) 24 . (COW) - - . - Atime and btrfs: a bad combination? (LWN, 2012-05-31). noatime (atime) Mutt ( maildir). . . : mkfs b-tree mkfs.btrfs(8) <> . mkfs btrfstune(8) <>. btrfs inspect-internal dump-super /dev/sdx incompat_flags mkfs ( UUID ) /sys/fs/btrfs/UUID/features/ . . 1 0 . /sys/fs/btrfs/features/ . 1 . ( mkfs.btrfs(8) <> FILESYSTEM FEATURES <# man-mkfs-filesystem-features>): big_metadata (: 3.4) nodesize block_group_tree (: 6.1) b-tree compress_lzo (: 2.6.38) lzo btrfs filesystem defrag. compress_zstd (: 4.14) zstd btrfs filesystem defrag. default_subvol (: 2.6.34) extended_iref (: 3.7) 65536 free_space_tree (: 4.5) b-tree v1 metadata_uuid (: 5.0) UUID metadata_uuid UUID UUID mkfs btrfstune(8) <> mixed_backref (: 2.6.31) mixed_groups (: 2.6.37) ( ) no_holes (: 3.14) raid1c34 (: 5.5) RAID1 3 4 raid_stripe_tree (: 6.7) RAID RAID56 (: 3.9) RAID56 rmdir_subvol (: 4.18) rmdir(2) . . skinny_metadata (: 3.10) (extent references) send_stream_version (: 5.10) (send stream) simple_quota (: 6.7) supported_checksums (: 5.5) . supported_sectorsizes (: 5.13) (mkfs.btrfs --sectorsize) supported_rescue_options (: 5.11) rescue btrfs(5) <> zoned (: 5.12) (zoned mode) / (swapfile) . 5.0. swapon(8) ( swapoff(8) ) ( NODATACOW) . BTRFS : o - o - o - o - ( ) o - NODATACOW ( NODATASUM ) (COW) . . ( ) . . : o - dmesg o scrub - ditto o (resize grow) - o (resize shrink) - o (device add) - o (device delete) - o (device replace) - btrfs . . . / ENOSPC . . . . ( ) . . : # truncate -s 0 swapfile # chattr +C swapfile # fallocate -l 2G swapfile # chmod 0600 swapfile # mkswap swapfile # swapon swapfile 6.1 ( ): # btrfs filesystem mkswapfile --size 2G swapfile # swapon swapfile UUID mkswap " " . /proc/swaps: # cat /proc/swaps Filename Type Size Used Priority /path/swapfile file 2097152 0 -2 swapon -a ( ). /etc/fstab /path . ( BTRFS). /path/swapfile none swap defaults 0 0 swapoff. . ( ) . . . HIBERNATION (hibernation) . (resume offset) /sys/power/resume_offset resume_offset. . filefrag ! Btrfs . . 6.1 btrfs inspect-internal map-swapfile <#man-inspect-map-swapfile> /sys/power/resume_offset. . # btrfs filesystem mkswapfile swapfile # btrfs inspect-internal map-swapfile swapfile Physical start: 811511726080 Resume offset: 198122980 -r : # btrfs inspect-internal map-swapfile -r swapfile 198122980 map-swapfile . TROUBLESHOOTING ( dmesg journalctl) . swapon : # swapon /path/swapfile swapon: /path/swapfile: swapon failed: Invalid argument btrfs: # journalctl -t kernel | grep swapfile kernel: BTRFS warning (device sda): swapfile must have single data profile . . - (b-tree). . : btrfs (writeback). (buffered write) btrfs (O_DIRECT) btrfs / ( ). . 6.14 (inode) . . (zero-copy) NODATASUM / . . crc32c. 5.5 . . CRC32C ( 32 ) . . XXHASH ( 64 ) CRC32C. (instruction pipelining) . SHA256 ( 256 ) . . FIPS . BLAKE2b ( 256 ) . SIMD . BLAKE SHA3 . BLAKE2b-256 64 . . 256 (32 ) . - (b-tree leaves). CRC32C intel 3.6 : +-------------------+-------------+--------------------+--------------------------+ | | Cycles/4KiB | | | +-------------------+-------------+--------------------+--------------------------+ |CRC32C | 470 | 1.00 | | | | | | | | | | | PCL | +-------------------+-------------+--------------------+--------------------------+ |XXHASH | 870 | 1.9 | | | | | | | +-------------------+-------------+--------------------+--------------------------+ |SHA256 | 7600 | 16 | libgcrypt | +-------------------+-------------+--------------------+--------------------------+ |SHA256 | 8500 | 18 | openssl | +-------------------+-------------+--------------------+--------------------------+ |SHA256 | 8700 | 18 | botan | +-------------------+-------------+--------------------+--------------------------+ |SHA256 | 32000 | 68 | | | | | | | | | | | | +-------------------+-------------+--------------------+--------------------------+ |SHA256 | 37000 | 78 | libsodium | +-------------------+-------------+--------------------+--------------------------+ |SHA256 | 78000 | 166 | | | | | | | | | | | | +-------------------+-------------+--------------------+--------------------------+ |BLAKE2b | 10000 | 21 | builtin/AVX2 | +-------------------+-------------+--------------------+--------------------------+ |BLAKE2b | 10900 | 23 | libgcrypt | +-------------------+-------------+--------------------+--------------------------+ |BLAKE2b | 13500 | 29 | builtin/SSE41 | +-------------------+-------------+--------------------+--------------------------+ |BLAKE2b | 13700 | 29 | libsodium | +-------------------+-------------+--------------------+--------------------------+ |BLAKE2b | 14100 | 30 | openssl | +-------------------+-------------+--------------------+--------------------------+ |BLAKE2b | 14500 | 31 | kcapi | +-------------------+-------------+--------------------+--------------------------+ |BLAKE2b | 14500 | 34 | | | | | | | | | | | | +-------------------+-------------+--------------------+--------------------------+ SHA256 . v6.15 (modprobe sha256) . /sys/fs/btrfs/FSID/checksum . sha256-generic . . v6.16 . /proc/crypto : name : sha256 driver : sha256-generic module : kernel priority : 100 ... : name : sha256 driver : sha256-avx2 module : sha256_ssse3 priority : 170 ... COMPRESSION Btrfs . : ZLIB LZO ZSTD ( v4.14) . (defrag). btrfs LZO ZLIB ( ). . (128KiB) . . . /: ZLIB o o : 1 9 3 o LZO o ZLIB o o ZSTD o ZLIB / o : -15..15 3 o 4.14 o 1..15 5.1 o -15..-1 6.15 . . . (bind mounts) . btrfs(5) <>. $ mount -o compress=zstd /dev/sdx /mnt zstd ( 3). zstd:3. . . $ btrfs filesystem defrag -czstd file file . --level -L 6.14. . : $ chattr +c file $ btrfs property set file compression zstd ext2 zlib . . (: .) ZLIB v4.14 LZO ( ) ZSTD v5.1 v6.15. 9 ZLIB ( 1 9) 1:1 . 3 . 7 8 9 . ZSTD -15 15 ZSTD. -15 -1 1 3 4 8 9 15 . . 0 . . fallocate force-compress. fallocate . (COW). btrfs . btrfs defrag. fallocate . . . compress-force btrfs . . (NOCOMPRESS) . . chattr +m ( e2fsprogs 1.46.2) no none. . : o - o - NOCOMPRESS $ lsattr file ---------------------m file . . . . : . (COW) nodatasum nodatasum . . . . . . SYSFS Btrfs sysfs . /sys/fs/btrfs/ : +-----------------------------+--------------------------+-----------------------+ | | | | | | | | +-----------------------------+--------------------------+-----------------------+ |features/ | | 3.14 | | | | | | | | | +-----------------------------+--------------------------+-----------------------+ |/ | UUID | 3.14 | | | | | | | | | +-----------------------------+--------------------------+-----------------------+ |/allocation/ | | 3.14 | | | | | | | | | +-----------------------------+--------------------------+-----------------------+ |/bdi/ | | 5.9 | | | | | | | | | | | ( | | | | ) | | +-----------------------------+--------------------------+-----------------------+ |/devices// | | 5.6 | | | | | | | sysfs | | | | | | | | | | | | | | +-----------------------------+--------------------------+-----------------------+ |/devinfo// | | 5.6 | | | | | | | Btrfs | | | | | | +-----------------------------+--------------------------+-----------------------+ |/discard/ | | 6.1 | | | | | | | | | +-----------------------------+--------------------------+-----------------------+ |/features/ | | 3.14 | | | | | | | | | +-----------------------------+--------------------------+-----------------------+ |/qgroups/ | | 5.9 | | | qgroup | | | | | | +-----------------------------+--------------------------+-----------------------+ |/qgroups/_/ | | 5.9 | | | qgroup | | +-----------------------------+--------------------------+-----------------------+ /sys/fs/btrfs/features/ . 0. 1 . /sys/fs/btrfs//features/ . . UUID /sys/fs/btrfs// : bg_reclaim_threshold ( : 5.19) . . checksum ( : 5.5) . ( ) ( ). clone_alignment ( : 3.16) clone dedupe. commit_stats ( : 6.0) btrfs . . (max_commit_ms) 0. : commits 70649 last_commit_ms 2 max_commit_ms 131 total_commit_ms 170840 o commits - o last_commit_ms - o max_commit_ms - o total_commit_ms - exclusive_operation ( : 5.10) . . generation ( : 5.11) . label ( : 3.14) . metadata_uuid ( : 5.0) UUID . metadata_uuid . nodesize ( : 3.14) . quota_override ( : 4.13) . 0 . 1 . read_policy ( : 5.11) . pid ( (pid)). round-robin. sectorsize ( : 3.14) . temp_fsid ( 6.7) (FSID) FSID. UUID/allocations /sys/fs/btrfs//allocations : global_rsv_reserved ( : 3.14) . global_rsv_size ( : 3.14) . data/, metadata/ and system/ directories ( : 5.14) . UUID/allocations/{data,metadata,system} /sys/fs/btrfs//allocations/data,metadata,system : bg_reclaim_threshold ( : 5.19) ( ) . . bytes_* (RO) . : bytes_may_use, bytes_pinned, bytes_readonly, bytes_reserved, bytes_used, bytes_zone_unusable chunk_size ( : 6.0) . ( ) . . 10% 256 (256MiB) 0. size_classes ( : 6.3) . none 136 small 374 medium 282 large 93 UUID/bdi sysfs (BDI) . UUID/devices /sys/fs/btrfs//devices ( sda dm-0) sysfs . UUID/devinfo ( ). devid . UUID/devinfo/DEVID /sys/fs/btrfs//devinfo/ : error_stats: ( : 5.14) btrfs device stats (btrfs-device(8) <>). write_errs 0 read_errs 0 flush_errs 0 corruption_errs 0 generation_errs 0 fsid: ( : 5.17) (fsid) . UUID . in_fs_metadata ( : 5.6) . 1 0 DEVID . missing ( : 5.6) . replace_target ( : 5.6) . 0. scrub_speed_max ( : 5.14) . /. 0 . . writeable ( : 5.6) . UUID/qgroups /sys/fs/btrfs//qgroups/ : enabled ( : 6.1) qgroup . qgroup qgroups . inconsistent ( : 6.1) qgroup . 1 (rescan) qgroup. drop_subtree_threshold ( : 6.1) qgroup . (subvolumes) qgroup qgroup. qgroup qgroup . 3 . 8 6.13 qgroup . qgroup qgroup . UUID/qgroups/LEVEL_ID /sys/fs/btrfs//qgroups/_/ : exclusive ( : 5.9) qgroup. limit_flags ( : 5.9) . 0 . max_exclusive ( : 5.9) . max_referenced ( : 5.9) . referenced ( : 5.9) qgroup. rsv_data ( : 5.9) . rsv_meta_pertrans ( : 5.9) . rsv_meta_prealloc ( : 5.9) . UUID/discard /sys/fs/btrfs//discard/ : discardable_bytes ( : 6.1) (async discard) (nodiscard). discardable_extents ( : 6.1) (extents) . discard_bitmap_bytes ( : 6.1) (bitmaps). discard_extent_bytes ( : 6.1) (bitmaps). discard_bytes_saved ( : 6.1) . kbps_limit ( : 6.1) . iops_limit ( : 6.1) . max_discard_size ( : 6.1) . . ( ). 5.10 /sys/fs/UUID/exclusive_operation : o balance o ( 5.17) o device add o device delete o device replace o resize o swapfile activate o none btrfs . . maximum file name length 255 Linux VFS BTRFS . nodesize 4KiB 3949 nodesize 4095 PATH_MAX (NAME_MAX) symlink(3) . (inodes) 264 . (inode) : 256 ( ) : 257 : (264 - 256) 64 256 256 b-tree . BTRFS 264 (16 ) Linux VFS 263 (8 ) 248 (extents) ( ). 64 qgroups 16 . 65536 extref mkfs () 100 mixed-bg () 109 mixed-bg 16 GRUB2 () BTRFS . U-Boot () BTRFS . 1 (primary superblock) 64KiB 4KiB. . (zoned device) . btrfs . . : o : chattr(1) lsattr(1) ( ioctls FS_IOC_GETFLAGS FS_IOC_SETFLAGS) ioctl o xflags: ( ioctls FS_IOC_FSGETXATTR FS_IOC_FSSETXATTR xattrs) xfs_io(8) xfs_io -c chattr . . ( ). . a ( ) A ( ) atime c ( ) . . . 'm' . C ( ) . : / . d () dump(8) BTRFS / D () open(2) O_SYNC O_DSYNC i ( ) ( ) m ( ) . . ( chattr(1) 1.46.2) . c . S () open(2) O_SYNC O_DSYNC V ( ) fs-verity . chattr(1) . XFLAGS xfs_io(8) : i a s S A atime d 5.12 btrfs (zoned mode). / . . btrfs (super blocks) . . SMR/ZBC/ZNS (host-managed). (drive-managed) . 256 1 . . null_blk . o o 8 o 4 o o : o : 0B ( ) o : 512 ( ) o : 4 (4096 ) . : o NODATACOW - o fallocate - o mixed-bg - o - 0 : o single ( ) DUP ( ) o fstrim - v1 . . 0B 512GiB 4TiB. . . . . . 8GiB 0-16GiB . . COW . . ( ) . . . ENOSPC . . WD Ultrastar 600 HM-SMR . : DA ( ) HA ( ). . : DM-SMR. o Ultrastar(R) DC ZN540 NVMe ZNS SSD ( ) : null_blk null_blk . . nr_devices=0 . configfs /sys/kernel/config null_blk /sys/kernel/config/nullb. /dev/nullb0 . : sysfs! : modprobe configfs modprobe null_blk nr_devices=0 mydev 2048MiB 256MiB. : cd /sys/kernel/config/nullb/ mkdir mydev cd mydev echo 2048 > size echo 1 > zoned echo 1 > memory_backed echo 256 > zone_size echo 1 > power /dev/nullb0 index . : rmdir /sys/kernel/config/nullb/mydev mkfs.btrfs /dev/nullb0 . null_blk : nullb setup nullb create -s 2g -z 256 mkfs.btrfs /dev/nullb0 ... nullb rm nullb0 : TCMU runner TCMU SCSI . . . o (incompat bit) ( ) o 3 (0 512GiB 4TiB) o ( ) o o 256MiB 1GiB btrfs 8GiB 5.12 . . o o -- libzbc ZBC/ZAC o -- libzbd ioctl() o -- o -- Btrfs o -- : /dev/btrfs-control 10 234 ( misc). $ ls -l /dev/btrfs-control crw------- 1 root root 10, 234 Jan 1 12:00 /dev/btrfs-control ioctl : o btrfs ( ) o o ( /sys/fs/btrfs/features) btrfs . mkfs . ( ) # mknod --mode=600 /dev/btrfs-control c 10 234 ( 5.11) # btrfs rescue create-control-device . device btrfs device scan. btrfs . ( btrfs-balance(8) <>). btrfs : WARNING: Multiple block group profiles detected, see 'man btrfs(5)'. WARNING: Data: single, raid1 WARNING: Metadata: single, raid1 btrfs filesystem df : WARNING: Multiple block group profiles detected, see 'man btrfs(5)'. WARNING: Data: single, raid1 WARNING: Metadata: single, raid1 Data, RAID1: total=832.00MiB, used=0.00B Data, single: total=1.63GiB, used=0.00B System, single: total=4.00MiB, used=16.00KiB Metadata, single: total=8.00MiB, used=112.00KiB Metadata, RAID1: total=64.00MiB, used=32.00KiB GlobalReserve, single: total=16.25MiB, used=0.00B Data Metadata single RAID1. / . . single. convert=raid1 . convert=raid1 RAID1. : convert=raid1,profiles=single,soft single raid1. raid1 . . RAID56 RAID10 RAID1 RAID0 . . : device add device delete balance cancel balance pause. : filesystem df device usage. filesystem usage : Multiple profiles: yes (data, metadata) COW : . . CD-ROMs . unionmount overlayfs qcow2 . btrfstune -S 1 . btrfs device add. . . UUID UUID . : v6.17 (sprouted). 6.17 . . . umount /path; mount /dev/writable /path remount -o remount,rw /path . : : . 5.11 . . btrfstune -f -S 0 . . : # mkfs.btrfs /dev/sda # mount /dev/sda /mnt/mnt1 ... fill mnt1 with data # umount /mnt/mnt1 # btrfstune -S 1 /dev/sda # mount /dev/sda /mnt/mnt1 # btrfs device add /dev/sdb /mnt/mnt1 # umount /mnt/mnt1 # mount /dev/sdb /mnt/mnt1 ... /mnt/mnt1 is now writable /mnt/mnt1 . /dev/sda : # mount /dev/sda /mnt/mnt2 # btrfs device add /dev/sdc /mnt/mnt2 # umount /mnt/mnt2 # mount /dev/sdc /mnt/mnt2 ... /mnt/mnt2 is now writable (: /dev/sdb) : # btrfs device delete /dev/sda /mnt/mnt1 /dev/sdb . : o single o single dup o btrfs filesystem label o UUID o umount /path; mount /dev/writable /path mount -o remount,rw /path . /dev/sdb /dev/sda. /dev/sdb /dev/sdd . # mkfs.btrfs /dev/sda # mount /dev/sda /mnt/mnt1 ... fill mnt1 with data # umount /mnt/mnt1 # btrfstune -S 1 /dev/sda # mount /dev/sda /mnt/mnt1 # btrfs device add /dev/sdb /mnt/mnt1 # mount -o remount,rw /mnt/mnt1 ... /mnt/mnt1 is now writable # umount /mnt/mnt1 # btrfstune -S 1 /dev/sdb # mount /dev/sdb /mnt/mnt1 # btrfs device add /dev/sdc /mnt # mount -o remount,rw /mnt/mnt1 ... /mnt/mnt1 is now writable # umount /mnt/mnt1 : o sda o sdb sda sdb sda o sdc sdb sda sdb . RAID56 RAID56 (striping) (parity) RAID5/6 . . RAID56 100%. raid5 raid6 . raid1 raid1c3 . . RAID1 btrfs ( raid0) . ( N ): raid5 1GiB raid1 1GiB . 1GiB N * 1GiB 2 * 1GiB. raid1 / . / RAID56 raid df btrfs filesystem df btrfs filesystem usage. ( RAID5 ) . (scrub) RAID56 . . . (write hole). . . (Write journal) . -- . (striping) ( ) . . GLOSSARY . allocator ( ). btrfs . balance btrfs btrfs balance /path. . . RAID . 3.3 <#man-balance-filters>. barrier (barrier) . btrfs . block 4K . (sector) . btrfs. btrfs . RAID . B-tree btrfs. (superblocks) btrfs B-trees . B-trees /. B-trees . btrfs B-trees. btrfsck, fsck, btrfs-check btrfs-progs ( ) . . scrub. btrfs-progs btrfs . . btrfs btrfs mkfs.btrfs btrfstune btrfs-progs. chunk . 1 () 256 ( ) . chunk tree . . cleaner (subvolumes) . . / . (cleaner kernel thread) autodefrag . copy-on-write, COW COW. btrfs . btrfs ( ) . . . COW . (snapshots) . (barriers). default subvolume btrfs subvol=. device LVM (loopback) . btrfs . df . btrfs btrfs-progs df . [[FAQ#Why_does_df_show_incorrect_free_space_for_my_RAID_volume.3F| ]] btrfs. DUP "RAID" . RAID1 . btrfs DUP . ENOSPC . . COW btrfs btrfs ENOSPC ( df) . btrfs enospc_debug btrfs. [[FAQ#if_your_device_is_large_.28.3E16GiB.29| ]] . extent . ( ) (extents) . extent buffer b-tree . . fallocate util-linux . . fallocate(1) fallocate(2) . filefrag . e2fsprogs . ext2 Btrfs . FIEMAP. free space cache "space cache v1". btrfs . . / . . (v1). free space tree "space cache v2" . COW v1. fsync ( ) fsync(2) . fsync(2) . generation . ( ) ( ). key (tuple) B-tree. 3 : objectid type offset. type . item B-tree. . log tree b-tree . fsync. . metadata . btrfs (checksums) . btrfs B-trees. mkfs.btrfs ( btrfs-progs) btrfs. offline (offline). ( btrfsck) . . online (online). btrfs . . orphan ( ) . RAID . RAID0 RAID1 RAID5 RAID6 RAID10 DUP single. RAID RAID btrfs . RAID0 RAID . 64 . RAID1, RAID1C3, RAID1C4 RAID // . . btrfs RAID-1 / . btrfs . RAID5 RAID (parity) . . RAID6 RAID . . RAID10 RAID . reflink . (reflinked) ( cp) . . relocation . balance . scrub <> . RAID DUP / . seed device <> (seed) ( ). / ( ) . ( Btrfs ). / . single . snapshot <> . ( ) . : "" . subvolume <> btrfs . . btrfs . btrfs. . . super block . . . (UUID) . system array / . btrfs device scan device=/path. top-level subvolume . btrfs 5 0 ( set-default btrfs). transaction . btrfs (RAM) 30 ( fsync) () ( * *). (transaction). . transid . writeback (Writeback) "" (dirty) ( ). . . . BTRFS (COW) (atomically). . . ( ) . ( ): 1. / ( ) 2. (flush) (barrier) 3. (offset) 4. 5. BTRFS . . . / (1) o : ( ) / o : o : (2) . . . . . . . ( ) (3) . o : o : o : (3) . . (ghost write). . . . . . . . . . (tree-checker) . . . . ECC . . (rowhammer) . . ( RAID1) . 100% ( ). (tree-log) ( ) . . : o o XMP : o memtest memtest o " " o / (DMA) (DMA) . . . (quirks) ( ) . . : o ( ) o (HDD) HDD . EIO - Input/output error. . . . . . . . : o smartctl (SSD) HDD . . . ( / ) . ECC. SSD ( ). HDD. . . " " ( ) . : o SSD o SSD (" ") / SSD . SSD . (/) DUP : o high end () single o low end () ( DUP) 50 100% SSD DUP btrfs. 50% 100% . SSD SSD DUP. SSD . : o o o o : o smartctl o (NVMe) NVMe (PCIe) SSD. . SCSI . SSD . . (nvme log nvme-cli) . . . ( smartctl). o o . . . . . . : o o ( ) SD . . . FTL ( ). ( ) . DUP . . acl(5) , btrfs(8) <>, chattr(1) , fstrim(8) , ioctl(2) , btrfs-ioctl(2) <>, mkfs.btrfs(8) <>, mount(8) , swapon(8) 3 . . : . 7.0 09 2026 BTRFS(5)