Could you please try --mode=lowmem ? Besides requiring drastically less
memory, it's also a cleanish rewrite of the code, and seems quite mature
already. Thus, it's likely it can succeed where --mode=original fails.
Yes! It succeeded, although it took three days to finish, while copying
all data with rsync took 14 hours:
Opening filesystem to check...
Checking filesystem on /dev/sda1
UUID: 666a7089-d716-44ff-8081-56b969b58eff
[1/7] checking root items
[2/7] checking extents
[3/7] checking free space cache
[4/7] checking fs roots
[5/7] checking only csums items (without verifying data)
[6/7] checking root refs done with fs roots in lowmem mode, skipping
[7/7] checking quota groups skipped (not enabled on this FS)
found 1515751325696 bytes used, no error found
total csum bytes: 1407037120
total tree bytes: 74490691584
total fs tree bytes: 71160676352
total extent tree bytes: 1746927616
btree space waste bytes: 15397847798
file data blocks allocated: 5376395280384
referenced 5376395280384
Then cleared v2 free space cache:
# btrfs check --mode=lowmem --clear-space-cache v2 --progress /dev/sda1
Opening filesystem to check...
Checking filesystem on /dev/sda1
UUID: 666a7089-d716-44ff-8081-56b969
And with "v1" i got an error:
# btrfs check --mode=lowmem --clear-space-cache v1 --progress /dev/sda1
Opening filesystem to check...
Checking filesystem on /dev/sda1
UUID: 666a7089-d716-44ff-8081-56b969b58eff
Failed to find [1198869790720, 168, 16384]
btrfs unable to find ref byte nr 1198869807104 parent 0 root 2 owner 0
offset 0
transaction.c:168: btrfs_commit_transaction: BUG_ON `ret` triggered,
value -5
btrfs(+0x3c0ad)[0x4900ad]
btrfs(btrfs_commit_transaction+0x68)[0x4904bb]
btrfs(btrfs_clear_free_space_cache+0x3d8)[0x4845ef]
btrfs(+0x4fb0f)[0x4a3b0f]
btrfs(cmd_check+0x716)[0x4b1dd9]
btrfs(main+0x22c)[0x460edc]
/lib/i386-linux-gnu/libc.so.6(__libc_start_main+0xf1)[0xb7c9bb41]
btrfs(_start+0x31)[0x460f21]
Przerwane
Same failure:
# btrfs check --clear-space-cache v1 /dev/sda1
Opening filesystem to check...
Checking filesystem on /dev/sda1
UUID: 666a7089-d716-44ff-8081-56b969b58eff
Failed to find [1198869790720, 168, 16384]
btrfs unable to find ref byte nr 1198869807104 parent 0 root 2 owner 0
offset 0
transaction.c:168: btrfs_commit_transaction: BUG_ON `ret` triggered,
value -5
btrfs(+0x3c0ad)[0x47d0ad]
btrfs(btrfs_commit_transaction+0x68)[0x47d4bb]
btrfs(btrfs_clear_free_space_cache+0x3d8)[0x4715ef]
btrfs(+0x4fb0f)[0x490b0f]
btrfs(cmd_check+0x716)[0x49edd9]
btrfs(main+0x22c)[0x44dedc]
/lib/i386-linux-gnu/libc.so.6(__libc_start_main+0xf1)[0xb7c5bb41]
btrfs(_start+0x31)[0x44df21]
Przerwane
# btrfs fi show /dev/sda1
Label: none uuid: 666a7089-d716-44ff-8081-56b969b58eff
Total devices 1 FS bytes used 1.38TiB
devid 1 size 1.82TiB used 1.82TiB path /dev/sda1