2

So I (very stupidly) performed a wipefs on my XFS formatted 4tb Linux (software) raid 5 array in trying to convert over to a bcache setup (I was following some instructions online and should have paid more attention to what wipefs does...).

Is there anyway to recover the file system without deleting all the data?

If the file system is unrecoverable what are my options for recovering the data so I can format the drives?

If I have to I could buy more disks to copy the data over to a new array but I guess it's the price I pay for my stupidity.

Fabby
  • 35,017
cowmix
  • 71

2 Answers2

3

It turns out an xfs_repair is all I needed, it just took a long time since the drives are so large, wipefs doesn't delete the secondary superblocks so xfs is able to recover itself.

Seth
  • 59,332
cowmix
  • 71
0

I don't know about FS recovery exactly like this, and I don't know if XFS has backup superblocks or something that could help. Maybe wipefs didn't erase much, it says When used without options -a or -o, it lists all visible filesystems and the offsets of their signatures. Does running wifefs -n (the -n , --no-act to make sure nothing else gets erased accidentally) on the drive &/or each partition show anything?

A big feature of raid is if you have a drive go bad you can swap it out without losing any data, but it sounds like you avoided that roadblock ;-)

But I have a suggestion on data recovery.

testdisk can sometimes recover from erased partition info or an erased MBR, but I don't think it can do the filesystem itself. But testdisk's application photorec does recover files/data, only without the filenames or directory structure. photorec is pretty easy to use, run as root, point it to a partition or whole drive, pick from a list of filetypes to recover, somewhere to store recovered files, and away it goes.

And you'd need some space somewhere to store the recovered data without writing it back to the same drive (risking overwriting data yet to be recovered). There's plenty of places to get a few gigs of online storage free, but 4TB is a lot. Old computers/hard drives anywhere to borrow for a while?

Xen2050
  • 8,943