1

I have several errors on my BTRFS partition (SSD -> luks -> BTRFS):

btrfs check --check-data-csum -p --force /dev/mapper/sda3_crypt
...
mirror 0 bytenr 1337316519936 csum 850178701 expected csum 2442214357
mirror 1 bytenr 1337316519936 csum 850178701 expected csum 2442214357
mirror 1 bytenr 1337316524032 csum 3411875857 expected csum 208994536

I'd like to know which files are affected but there are no inodes given.

Is there a way to resolve the listed bytenr values to an actual file path?

1

To resolve the bytenr use the following command:

btrfs inspect-internal logical-resolve <bytenr> <path>

where <path> should point to the BTRFS top-level subvolume to be able to list the affected files in all snapshots (one bytenr may be linked by a file that exists in several snapshots).

Example:

mkdir /mnt/btrfs-root
mount -t btrfs -o subvolid=5 /dev/sda2 /mnt/btrfs-root

btrfs inspect-internal logical-resolve 1337316519936 /mnt/btrfs-root

umount /mnt/btrfs-root && rmdir /mnt/btrfs-root

Please note: subvolid=5 will mount the "BTRFS root" (or top-level subvolume). A freshly created filesystem is also a subvolume, called top-level, internally has an id 5. (Kernel.org)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.