How to find the file at a certain btrfs inode

btrfsinode

I have a corrupt file according to btrfs

BTRFS info (device sdb1): csum failed ino 367 off 310013952 csum 1601485211 expected csum 3692975992

I assumed ino 367 means inode 367, so I can use find and try to restore the file. However find /path -inum 367 finds nothing. Anyone know how to find the corrupt file?

Best Answer

Example:

sudo btrfs inspect-internal inode-resolve 15380 /home

man btrfs-inspect-internal says:

   inode-resolve [-v] <ino> <path>
       (needs root privileges)

       resolve paths to all files with given inode number ino in a given
       subvolume at path, ie. all hardlinks

       Options

       -v
           verbose mode, print count of returned paths and ioctl()
           return value