xfs-doctor
The usual story: a NAS dropped a disk, the filesystem will not mount, and every
tool that could help wants to mount it first. xfs-doctor reads the
image as bytes — no mount, no xfs_db, nothing written.
What changes for you
- You do not need the array working. Headers are found at any offset, and a RAID0 half-image's geometry can be worked out from one member.
- You can inspect before you commit. Superblocks and AGIs are decoded and printed, so you know what you are looking at before salvaging.
- Directory structure survives. Inodes and directories are salvaged by scanning rather than by asking the filesystem to mount.
- Content survives metadata damage. When the structure is gone, files are carved by signature: JPEG, PNG, PDF, ZIP, RIFF, MP4, gzip, tar.
- The original never changes. Every command is read-only, which is what makes it usable before a repair or as a forensic pass.
Getting it
cargo install xfs-doctorA damaged image is usually explored in this order:
xfs-doctor read --device disk.img sb # find the superblock
xfs-doctor read --device disk.img --offset 0x100000 sb # ...or at an offset
xfs-doctor salvage --device disk.img --sb sb.bin \
--chunk 512K --data-offset 8K --member 1 --out salvage/ --scan 256M
xfs-doctor carve --device disk.img --out carve/ --types jpeg,png,mp4 --max 16M
Half of a RAID0 that lost its partner is a geometry problem;
xfs-doctor map is for that.