Hi folks, anyone have a tool they can recommend to repair a damaged XFS partition?
I recently received a warning “Attempt to read or write outside of HD0” from my OpenSUSE desktop and booted into the RescueCD I keep handy. I ran fdisk and could see the drive in the device list. Running GParted I could see the hard disk but when I tried to mount it I got a more complete error message “wrong fs type, bad option, bad superblock” with a suggestion to run xfs_repair. The first pass-through of xfs_repair couldn’t find any secondary superblocks for recovery so I tried re-running with the -L option which only caused the hard disk to be completely un-readable by fdisk. That brings me to this point - is there any tools or methodologies I can use to repair the partition and recover the disk?
The messages you are getting suggest to me that the drive controller might be failing. That would probably be the controller on the drive, rather than your motherboard. You can try powering it off and let everything cool down for a while. If it then works, then it would be the right time for a final backup before you replace the drive.
I see you choose OTHER VERSION when you were asked to identify the openSUSE version you use. That means that you use a not supported verion. Which in itself is no barrier to get help here, but it would help when you at least told us which version you use.
Then, please, when you say you got a message, be more specific. Where was that meassge, in a tool,/program, a pop-up window, any details are important.
Also please, when you say that you did some fdisk commando, show it here. Copy/paste the whole, inclusnig the prompt/command line, the output and the next prompt line, between CODE tags in your post (you get the CODE tags by clicking on the # button n the post editor).
Same for your mount. Please show it. For others it gives much more information and for you it is much less story telling.
In short, we want to see the same as you see.
But, when I read your last remarks, I am afraid that something realy bad happened to your disk. You could of course check the hardware, but first I assume you have to try to save as much as possible. So depending on the partitioning (which you did not show), save the other partitions that are still working (or check that your normal backups are up-to-date). For the damaged partition, we have no idea what is on it (where it is mounted normaly), but I assume that your normal backup should cover that.
Thanks for the response - I’m running OpenSuse 13.1 on a 10-year old desktop and didn’t think it was worth the effort to install a newer version of Leap to such old hardware.
When I first used GParted from a RescueCD here was the error message shown for the hard disk:
Error mounting /dev/sda3 at /run/media/linux/26133824-1393-4c14-83e8-d25cbaa70ac: Command line mount -t “sfx” -o “uhelper=disks2.nodev.nosuid” “dev/sda3” “/run/media/linux/26133824-1393-4c14-83e8-d25cbaa70ac” exited with non-zero exit status 32:mount:wrong fs type, bad option, bad superblock on /dev/sda3, missing codepage or helper program, or other error
After I tried running xfs_repair and found the disk still unusable I looked at it again from GParted, The basic device information was shown for model (ATA ST2000DM001-9YN1), size (1.82 Tb) and path (/dev/sda) but the partition table shows as “unrecognized”, and in the disk partition table area the Partition shows as unallocated with a orange triangle warning icon and the file system shows as unallocated.
This information comes from screen shots I took before and after the xfs_repair process, but I didn’t gather any additional logs. The fdisk command I used was just the simple “fdisk -l” for looking to see what devices are available, and it returns " fdisk: cannot open /dev/sda: Input/output error".
Partitions are just walls, and has no effect on the data except to be able to locate the data (in relation to the partition).
In one situation, I experienced a damaged partition due to a specific action so in that case I was very certain the problem was specific to the partition and wasn’t caused by something unknown.
To recover, I simply reset the partition by recreating the partition with exactly the same parameters as before.
To assist in knowing those exact parameters, I knew that the partitions were created using the default layout of the openSUSE install, so I created an exact install duplicate to identify the parameters which may or may not be an option for you.
Once the new partitions were created exactly as before, presto! All the data in the partition was accessible again.
Whatever you decide to do, it can put your data at high risk, if you value your data I’d recommend either cloning your drive (which would replicate on a byte by byte basis so does not depend on readable file structures) first or just run a data recovery app like photorec, then test your drive for whether it’s salvageable before taking your next step.