I have a broken XFS filesystem on one of my HDD. I ran xfs_repair which was not able to find a secondary superblock to repair the filesystem. Therefore, I am not able to mount the HDD/partition.

I tried to make a backup to a NTFS HDD via ddrescure to an iso-file. Unfortunately, I discovered now that my target drive is 4 KiB smaller than the source drive. That's why I was not able to complete the backup. ddrescure showed that there were actually no bad blocks or sectors on my HDD, which lets me assume, that my data is still there but I cannot access it.

I am doing this from a Live-Ubuntu-Stick, because I was not able to see/mount the HDD via Windows and some tools for this use case (mounting XFS in Windows).

Is there any way to access/recover my data from the incomplete image or directly from my HDD?

Edit: My out from xfs_repair /dev/sdc1

Phase 1 - find and verify superblock...
couldn't verify primary superblock - not enough secondary superblocks with matching geometry !!!

attempting to find secondary superblock...

[then plenty of these lines]

found candidate secondary superblock...
unable to verify superblock, continuing...

[then it finishes with this]

Sorry, could not find valid secondary superblock
Exiting now.
  • Did your hard disk fail? – ewwhite May 20 '18 at 19:21
  • Nope. Nothing is wrong with the disk at all. The disk was connected to a raspberry with rasbian installed. Everytime I restarted the raspberry, the filesystem got corrupted. But this time, I was not able to repair it with xfs_repair. ddrescue read from the whole disk and did not mention any errors or bad blocks. – Michael Walter May 20 '18 at 19:25
  • Please post the complete output of xfs_repair -n and whether it returned 1 for corruption detected. – John Mahowald May 21 '18 at 12:27
  • @JohnMahowald thanks for looking into this. I ran it without the -n option and updated my post with its output. Does this help? It would take one and half day to redo the scan with that option and the output seems to be the same. – Michael Walter May 21 '18 at 12:39
  • It tried and failed to load two superblocks. You are past the point where reading the manual helps. Get a metadata dump to someone who understands XFS, like your operating system support channels. Or other data recovery specialists. – John Mahowald May 21 '18 at 21:49

Clone the disk so that you have more than one copy of it.

Open a support case with whomever maintains XFS for your operating system. Get xfs_metadump output to show the current state of the file system, including if you have a secondary superblock.

Restore any backups you have. Or prepare users to rebuild what was on there.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.