BTRFS 快照失败并显示“没有剩余空间”

BTRFS 快照失败并显示“没有剩余空间”

在创建 BTRFS RAID10 子卷快照时,我点击了:

[21816375.986061] ? btrfs_cleanup_transaction+0x530/0x530 [btrfs]
[21816375.986065] kthread+0x112/0x130
[21816375.986066] ? kthread_bind+0x30/0x30
[21816375.986070] ret_from_fork+0x1f/0x40
[21816375.986072] ---[ end trace a2d9b072102a4b9d ]---
[21816375.986116] BTRFS: error (device sdb) in btrfs_run_delayed_refs:2934: errno=-28 No space left
[21816375.986157] BTRFS info (device sdb): forced readonly
[21816375.986160] BTRFS warning (device sdb): Skipping commit of aborted transaction.
[21816375.986161] BTRFS: error (device sdb) in cleanup_transaction:1870: errno=-28 No space left
[21816376.167051] BTRFS error (device sdb): pending csums is 188416

这对我来说是一个惊喜,因为我看到了很多空闲和未分配的空间:

Overall:
    Device size:                  87.32TiB
    Device allocated:             67.31TiB
    Device unallocated:           20.00TiB
    Device missing:                  0.00B
    Used:                         56.73TiB
    Free (estimated):             15.29TiB      (min: 15.29TiB)
    Data ratio:                       2.00
    Metadata ratio:                   2.00
    Global reserve:              512.00MiB      (used: 0.00B)

Data,RAID10: Size:33.57TiB, Used:28.28TiB
   /dev/sdb       11.19TiB
   /dev/sdc       11.19TiB
   /dev/sdd       11.19TiB
   /dev/sde       11.19TiB
   /dev/sdf       11.19TiB
   /dev/sdg       11.19TiB

Metadata,RAID10: Size:92.72GiB, Used:89.08GiB
   /dev/sdb       30.91GiB
   /dev/sdc       30.91GiB
   /dev/sdd       30.91GiB
   /dev/sde       30.91GiB
   /dev/sdf       30.91GiB
   /dev/sdg       30.91GiB

System,RAID10: Size:103.88MiB, Used:3.05MiB
   /dev/sdb       34.62MiB
   /dev/sdc       34.62MiB
   /dev/sdd       34.62MiB
   /dev/sde       34.62MiB
   /dev/sdf       34.62MiB
   /dev/sdg       34.62MiB

Unallocated:
   /dev/sdb        3.33TiB
   /dev/sdc        3.33TiB
   /dev/sdd        3.33TiB
   /dev/sde        3.33TiB
   /dev/sdf        3.33TiB
   /dev/sdg        3.33TiB

因此理论上我预计至少有 10TB 可用空间(RAID10 上为 3x3.33)

我们像这样进行了第一次重新平衡:

btrfs fi balance start -dusage=5 /mnt

并得到这个:

Overall:
    Device size:                  87.32TiB
    Device allocated:             56.86TiB
    Device unallocated:           30.45TiB
    Device missing:                  0.00B
    Used:                         56.21TiB
    Free (estimated):             15.54TiB      (min: 15.54TiB)
    Data ratio:                       2.00
    Metadata ratio:                   2.00
    Global reserve:              512.00MiB      (used: 0.00B)

Data,RAID10: Size:28.34TiB, Used:28.02TiB
   /dev/sdb        9.45TiB
   /dev/sdc        9.45TiB
   /dev/sdd        9.45TiB
   /dev/sde        9.45TiB
   /dev/sdf        9.45TiB
   /dev/sdg        9.45TiB

Metadata,RAID10: Size:92.72GiB, Used:81.35GiB
   /dev/sdb       30.91GiB
   /dev/sdc       30.91GiB
   /dev/sdd       30.91GiB
   /dev/sde       30.91GiB
   /dev/sdf       30.91GiB
   /dev/sdg       30.91GiB

System,RAID10: Size:7.88MiB, Used:2.58MiB
   /dev/sdb        2.62MiB
   /dev/sdc        2.62MiB
   /dev/sdd        2.62MiB
   /dev/sde        2.62MiB
   /dev/sdf        2.62MiB
   /dev/sdg        2.62MiB

Unallocated:
   /dev/sdb        5.08TiB
   /dev/sdc        5.08TiB
   /dev/sdd        5.08TiB
   /dev/sde        5.08TiB
   /dev/sdf        5.08TiB
   /dev/sdg        5.08TiB

我有一些问题:

  1. 当“btrfs fi us”显示大量“未分配”空间,但我们遇到空间不足问题(可能在元数据数据 - 子卷快照上)时,这意味着什么,为什么元数据不扩展到该未分配空间自动地?
  2. 我们应该定期(多久)运行一次 btrfs 余额吗?
  3. -usage 的最佳值是多少?
  4. 这是否危险?我们是否应该重新平衡元数据:例如 -musage=5?
  5. 我们了解 btrfs 使用低级块进行数据/元数据分配,但我们不知道是否有办法以某种方式监控它们的使用情况?

相关内容