kilork.github.io

xfs-doctor

Read-only rescue tools for damaged XFS filesystems and disk images.

A disk image with superblock, AGI, inode and data regions, read without mounting

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

Getting it

cargo install xfs-doctor

A 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.

Where to look

source · crate