I have a disk from a Buffalo LinkStation that has an XFS partition on it that I cannot mount.
Plugging the disk into an SATA->USB caddy on an Ubuntu box. I get the following:
$ sudo fdisk -l /dev/sdb
Disk /dev/sdb: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders, total 976773168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000
Device Boot Start End Blocks Id System
/dev/sdb1 63 594404 297171 83 Linux
/dev/sdb2 594405 1590434 498015 83 Linux
/dev/sdb4 1590435 976768064 487588815 5 Extended
/dev/sdb5 1590498 1863539 136521 82 Linux swap / Solaris
/dev/sdb6 1863603 976494959 487315678+ 83 Linux
The problem partition is /dev/sdb6.
$ sudo xfs_check /dev/sdb6
ERROR: The filesystem has valuable metadata changes in a log which needs to
be replayed. Mount the filesystem to replay the log, and unmount it before
re-running xfs_check. If you are unable to mount the filesystem, then use
the xfs_repair -L option to destroy the log and attempt a repair.
Note that destroying the log may cause corruption -- please attempt a mount
of the filesystem before doing this.
So trying the xfs_repair -L option gets me to the situation I can't get beyond:
$ sudo xfs_repair -L /dev/sdb6
Phase 1 - find and verify superblock...
superblock read failed, offset 382252089344, size 131072, ag 89, rval -1
fatal error -- Input/output error
Using photorec I have been able to pull some files off that partition, so the data is there and the disk is physically working. However, there is a problem with the superblocks.
How would I recover this partition?
Best Answer
After the XFS replay error, try to MOUNT the partition again, as per the error message.
If all gets too messy, I highly recommend downloading UFS Explorer to help with deep file recovery from another system.