Why the root block of a large IPFS file looks too small
A backup process retrieved a block by CID and wrote a few hundred bytes for a multi-megabyte artifact. The CID may name a UnixFS root with links to the blocks holding the file.
Measure the two byte streams
Choose a reachable, multi-block UnixFS file and set FILE_CID to its root. Run these commands in a shell with pipeline failure reporting enabled, such as Bash with set -o pipefail. The middle command counts bytes in one encoded block. The final command reconstructs the file and counts the bytes a reader receives.
ipfs block stat "$FILE_CID"
ipfs block get "$FILE_CID" | wc -c
ipfs cat "$FILE_CID" | wc -c
Pick the unit your backup promises to restore
For a downloadable artifact, compare the bytes from ipfs cat to the producer’s file size and digest. For a block-level backup, preserve every linked block needed to traverse the root. Saving the small root block alone leaves links without their targets. A one-block raw file may give equal counts in both commands, so use a chunked fixture when testing this distinction.