btrfs check Causes File Corruption
Hello everyone, I use Btrfs as the file system on my laptop. Yesterday, I was preparing to backup a snapshot to an external hard drive using btrfs send, and the following error occurred:
ERROR: send ioctl failed with -5: Input/Output error
I used btrfs scrub to scan the disk, and the result was:
Error summary: csum=1
Corrected: 0
Uncorrectable: 1
Unverified: 0
Afterwards, I booted a LiveCD and ran:
btrfs check --init-csum-tree
During the running process, many outputs similar to this appeared:
root 1380 inode 5006723 errors 2001, no inode item, link count wrong unresolved ref dir 1164151 index 1566 namelen 28 name <filename> filetype 1 errors 4, no inode ref
Then I found that the file in the above <filename> had disappeared. At this point, I immediately backed up all the existing files and then used:
btrfs check --repair
btrfs rescue
in an attempt to recover the lost files, but was unsuccessful.
The current issues are:
How do I recover the lost files?
Why does btrfs check --init-csum-tree cause file loss? Is this a bug?
LiveCD information:
Linux ubuntu 6.2.0-26-generic #26~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Thu Jul 13 16:27:29 UTC 2 x86_64 x86_64 x86_64 GNU/Linux
Thank you for your help.
Reply to: