So i've had a directory for years (modifed date is 2016 and btrfs filesystem was created in 2015-06) that contained 2 unremovable files. Like ls would list a file but not be able to show any info about it even as root. Dir a broken file Dir b another broken file in b : #ls -l ls: cannot access '9193E7A71E8820B8D4C0D786AA679FFF2356189D.dat': No such file or directory total 0 -????????? ? ? ? ? ? 9193E7A71E8820B8D4C0D786AA679FFF2356189D.dat rm and every other command i tried just said No such file or directory even though ls could list its name so i just ignored the directory as it is non essential. >From what i remember dmesg never showed any errors last time i tried to remove those files. Last attempt was on 2020-03-06 but on old 2019-autum kernel due to broken wifi driver in newer kernels. Now i recently updated the kernel to 5.6.0 (own compile based on arch default linux kernel with minor fix for the broken wifi driver). btrfs-progs is v5.4 . Today i was listing files in my home directory and got a Input/Output error on dir a (which used to work fine, it was the files inside that were problematic) and another directory .gnome2 (no idea if this one contained broken files too, never checked before, but i think it did as the backup shows no files in there which it also does not for the other dir a). Dmesg shows these lines each access attempt (always exactly the same): [389277.482811] BTRFS critical (device dm-0): corrupt leaf: root=259 block=24071061798912 slot=167 ino=7742, invalid location key offset:has 9223372036854775808 expect 0 [389277.495923] BTRFS error (device dm-0): block=24071061798912 read time tree block corruption detected [389277.518900] BTRFS critical (device dm-0): corrupt leaf: root=259 block=24071061798912 slot=167 ino=7742, invalid location key offset:has 9223372036854775808 expect 0 [389277.532118] BTRFS error (device dm-0): block=24071061798912 read time tree block corruption detected Disk layout is 4 SATA disks of 3TB each with individual full disk luks encryption and then btrfs raid 5 (data) raid 1 (metadata). I use 3 subvolumes, / and /storage and /home. Both problematic directories are in /home. I have backups for / and /home subvolumes on a separate 2TB ext4 drive. /storage has no backups as i don't have 8TB to spare. I run a scrub each month and last results were: UUID: 33a10d7b-819b-4a61-b35c-d47738ab698f Scrub started: Wed Apr 1 03:00:03 2020 Status: finished Duration: 70:13:46 Total to scrub: 7.73TiB Rate: 33.37MiB/s Error summary: no errors found No other file seems to have access problems (ran ncdu on / which accesses every file) or read errors (most files are read and checked by torrent program over time as it seeds). btrfs device stats / [/dev/mapper/cryptoroota].write_io_errs 0 [/dev/mapper/cryptoroota].read_io_errs 0 [/dev/mapper/cryptoroota].flush_io_errs 0 [/dev/mapper/cryptoroota].corruption_errs 304 [/dev/mapper/cryptoroota].generation_errs 0 [/dev/mapper/cryptorootb].write_io_errs 0 [/dev/mapper/cryptorootb].read_io_errs 0 [/dev/mapper/cryptorootb].flush_io_errs 0 [/dev/mapper/cryptorootb].corruption_errs 426 [/dev/mapper/cryptorootb].generation_errs 0 [/dev/mapper/cryptorootc].write_io_errs 0 [/dev/mapper/cryptorootc].read_io_errs 0 [/dev/mapper/cryptorootc].flush_io_errs 0 [/dev/mapper/cryptorootc].corruption_errs 425 [/dev/mapper/cryptorootc].generation_errs 0 [/dev/mapper/cryptorootd].write_io_errs 0 [/dev/mapper/cryptorootd].read_io_errs 0 [/dev/mapper/cryptorootd].flush_io_errs 0 [/dev/mapper/cryptorootd].corruption_errs 0 [/dev/mapper/cryptorootd].generation_errs 0 I did have some checksum errors a few years back so i think most errors are from that. Data was fine but the checksum was wrong. At least I can't see anything else recent in dmesg relating to btrfs. Any clues to what might have caused this? And secondly how do i get rid of that broken leaf? (Assuming only those 2 directories and their contents are affected) btrfs-progs v5.4 Linux 5.6.0-arch1-1-custom #1 SMP PREEMPT Sat, 04 Apr 2020 23:33:26 +0000 x86_64 GNU/Linux Kernel compiled with standard Archlinux settings + minor patch for wifi driver (continue even with communication errors) -- Anton 'exuvo' Olsson +46732193727 http://exuvo.se
