Такая проблема:
Имеется виртуальная машина на которой запущенны контейнеры. Один раз отволился на хостовой машине коннектор питания от жёсткого диска. После этого теперь файловая система с этим контейнером уходит в read only. При попытке исправить файловую систему возникает:
root@lxd-two:/var/snap/lxd/common/lxd/disks# btrfs check --repair ./default.img
enabling repair mode
Opening filesystem to check...
warning, bad space info total_bytes 2147483648 used 2147725312
Checking filesystem on ./default.img
UUID: 5b91b327-bce3-4e45-a7ee-86fa0a774573
[1/7] checking root items
Fixed 0 roots.
[2/7] checking extents
ref mismatch on [3582070784 94208] extent item 0, found 1
data backref 3582070784 root 438 owner 559207 offset 0 num_refs 0 not found in extent tree
incorrect local backref count on 3582070784 root 438 owner 559207 offset 0 found 1 wanted 0 back 0x55b659277050
backpointer mismatch on [3582070784 94208]
repair deleting extent record: key [3582070784,168,241664]
adding new data backref on 3582070784 root 438 owner 559207 offset 0 found 1
Repaired extent references for 3582070784
ref mismatch on [3582164992 114688] extent item 0, found 1
data backref 3582164992 root 516 owner 18532 offset 0 num_refs 0 not found in extent tree
incorrect local backref count on 3582164992 root 516 owner 18532 offset 0 found 1 wanted 0 back 0x55b6790b4a20
backpointer mismatch on [3582164992 114688]
adding new data backref on 3582164992 root 516 owner 18532 offset 0 found 1
Repaired extent references for 3582164992
ref mismatch on [3582279680 12288] extent item 0, found 1
data backref 3582279680 root 516 owner 18591 offset 0 num_refs 0 not found in extent tree
incorrect local backref count on 3582279680 root 516 owner 18591 offset 0 found 1 wanted 0 back 0x55b67ac215c0
backpointer mismatch on [3582279680 12288]
adding new data backref on 3582279680 root 516 owner 18591 offset 0 found 1
Repaired extent references for 3582279680
ref mismatch on [3582291968 12288] extent item 0, found 1
data backref 3582291968 root 542 owner 61178 offset 0 num_refs 0 not found in extent tree
incorrect local backref count on 3582291968 root 542 owner 61178 offset 0 found 1 wanted 0 back 0x55b67b4e5b90
backpointer mismatch on [3582291968 12288]
adding new data backref on 3582291968 root 542 owner 61178 offset 0 found 1
Repaired extent references for 3582291968
ref mismatch on [3582304256 8192] extent item 0, found 1
data backref 3582304256 root 542 owner 61287 offset 0 num_refs 0 not found in extent tree
incorrect local backref count on 3582304256 root 542 owner 61287 offset 0 found 1 wanted 0 back 0x55b67ad842d0
backpointer mismatch on [3582304256 8192]
adding new data backref on 3582304256 root 542 owner 61287 offset 0 found 1
Repaired extent references for 3582304256
Failed to find [29638656, 168, 16384]
btrfs unable to find ref byte nr 29720576 parent 0 root 2 owner 0 offset 0
transaction.c:195: btrfs_commit_transaction: BUG_ON `ret` triggered, value -5
btrfs(+0x3b748)[0x55b6539de748]
btrfs(btrfs_commit_transaction+0x12a)[0x55b6539debcc]
btrfs(+0x55861)[0x55b6539f8861]
btrfs(cmd_check+0x1288)[0x55b6539f9e75]
btrfs(main+0x1f3)[0x55b6539b6e63]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xeb)[0x7f08f464409b]
btrfs(_start+0x2a)[0x55b6539b6eaa]
Aborted
Как теперь исправить файловую систему?