Btrfs calculates a crc32c checksum for each file. Is there a way I can view what checksum is stored (as opposed to just reading the file and recalculating it)?
Btrfs calculates a crc32c checksum for each file.
This is not correct. Both of the open-source checksumming file-systems (ZFS and BTRFS) calculate a checksum for each logical block (the unnamed source Awe used is correct). This is a checksum of the on-disk data.
If the file-system has compression enabled (an increasingly common setting), this checksum is of the data after compression. This means that, even if the file fits in one logical block, it's possible (and increasingly likely) that the file-system's checksum data will be useless to you.
If you need a file checksum, the best way to get it would be to calculate it.
From a similar answer at superuser:
I don't believe it is possible to extract the block level checksums from a ZFS filesystem, but since the checksums are at the block level, not the file level, it probably wouldn't help you anyway.
Meaning. Checksums are not created per file by btrfs. It is mentioned @superuser there is a patch to add a functionality to the inspect-internal subcommand: btrfs inspect-internal dump-csums this dumps - for all blocks being occupied by a given file - the block checksums. Plural, unless the file fits into one block.
I think this isn't possible via btrfs CLI, but here there is a source code that, I hope, could help you to read chechsum for a single block in a btrfs filesystem. Needs root.