Skip to main content
1 of 5
valepu
  • 192
  • 10

Rebuild superblock of disk that completely lost it

I found myself in a weird situation with my system's disk. It's Linux system with 3 partitions, boot, swap and filesystem (ext4). A few days ago i used knoppix from a pendrive (I made the bootable usb drive from a knoppix image myself) because i wanted to check an unreadable disk...and i found myself with 2 unreadable disks!

When i rebooted the system i started getting on my screen errors like this:

error: failure reading sector ... from 'hd0'.

and then i got the grub shell after a few attempts.

  1. I created another bootable stick with Linux Mint and i tried to see what went wrong.
    When checking the disk using the "disks" tool it said the disk was ok but has 8 bad sectors (i'm not sure they were there before), the filesystem partition was there but the type for the data partition was unkown.

  2. I tried running testdisk. It found the partitions, and once i checked the superblocks and set the Filesystem type (ext4) i could see the data from testdisk itself but still could not mount the partition.

  3. Testdisk suggested to run e2fsck -p -b and i tried with all the superblocks testdisk gave me but every time fsck tried to fix something it ended with a disk write error.
    At this point it was late, so i gave up for the night, but kinda reassured that the data was still readable

  4. The day after with my suprise the data was not there anymore, probably some run of fsck made things worse because testdisk would not give me any superblock number anymore (and i couldn't see the files from testdisk anymore no matter what i tried), and if i tried running fsck with the numbers i got previously (i had saved them) i got Bad magic number in super-block while trying to open /dev/sda3 no matter the number

  5. At this point i made an image with safecopy (which i admit, i shouldve done as first thing but I was a bit panicked so i didn't think about that) and duplicated it so that i could test different solutions

  6. All the things i tried did not help tho. I found a suggestion to use mkfs with the -S option so that it would only rebuild the superblocks, but when i tried that and ran fsck on it (as suggested by the tool) it would give me access to the partition again, but the partition would be completely empty. So empty that not even photorec could find data anymore (it would find data on the image before running mkfs + fsck).

At the moment of writing i'm running R-Linux on the drive as a last attempt to at least recover the data, but I would like to know if there's some way to recover the disk as it is.

valepu
  • 192
  • 10