ext4 / XFS: Superblocks, Inodes and Group Descriptors
On ext4 and XFS, the metadata layout tells you where to look when the filesystem will not mount.
ext4
Backup superblocks exist in every block group. With a good one, the group descriptors and inode tables can be rebuilt and the tree walked. Journals help with recent changes.
XFS
XFS spreads metadata across allocation groups; the AG headers and the inode B-trees are the entry points. XFS repair tools write aggressively — never run them on the original.
FAQ
Is fsck safe?
It writes. On failing media, image first; run repair tools on the image.
What about LVM?
Reassemble the volume group before touching the filesystem.