Repair broken ext4 partition with wrong superblock checksum

How to use TestDisk to recover lost partition
Forum rules
When asking for technical support:
- Search for posts on the same topic before posting a new question.
- Give clear, specific information in the title of your post.
- Include as many details as you can, MOST POSTS WILL GET ONLY ONE OR TWO ANSWERS.
- Post a follow up with a "Thank you" or "This worked!"
- When you learn something, use that knowledge to HELP ANOTHER USER LATER.
Before posting, please read https://www.cgsecurity.org/testdisk.pdf
Locked
Message
Author
KirillK
Posts: 1
Joined: 28 Nov 2022, 01:09

Repair broken ext4 partition with wrong superblock checksum

#1 Post by KirillK »

Hello!

A few weeks ago I gave my laptop to the service to replace the keyboard.
There were two operating systems on the computer: windows 10 and linux (ubuntu 20.04).
The folder /home of my Ubuntu system was moved to a separate partition on the disk.
After the computer returned from the service, the partition /home stopped mounting due to problems with the superblock.

Testdisk, when trying to determine the backup superblocks, outputs the following:

Linux file systems. data 570617856 975675391 405057536
superblock 0, block size=4096 []
To restore the file system using an alternative superblock, run
fsck.ext4 -p -b superblock is a B block size device.

When i try use fsck it returns:

fsck.ext4: superblock checksum does not match superblock when trying to open /dev/sda8
/dev/sda8:
The super block could not be read or does not describe a valid ext2/ext3/ext4
FS. If the device is valid and it does contain ext2/ext3/ext4
FZ (and do not exchange, or us, or something else), then the super block
is damaged, and you can try to run e2fsck with an alternative superblock:
e2fsck -b 8193 <device>
or
e2fsck -b 32768 <device>

I found other backup superblocks with "mke2fs -n /dev/xxx":

Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
4096000, 7962624, 11239424, 20480000, 23887872

But unfortunately i got the same result with each of them.

However, when I try to display the contents of the partition using testdisk, it displays all the files and folders and I even could copy them.

drwxr-xr-x 0 0 4096 6-Nov-2022 22:57 .
drwxr-xr-x 0 0 4096 6-Nov-2022 22:57 ..
drwx------ 0 0 16384 11-Feb-2022 23:55 lost+found
drwxr-xr-x 1000 1000 4096 29-Sep-2022 07:59 kirill
drwxr-xr-x 0 0 4096 6-Nov-2022 22:57 www-data


So I can't understand if testdisk lists the contents of the partition, why does fsck say that the superblock is corrupted?

Is there a way to repair the partition or i need to format it and paste copied by testdisk files?

Thank you!

User avatar
cgrenier
Site Admin
Posts: 5432
Joined: 18 Feb 2012, 15:08
Location: Le Perreux Sur Marne, France
Contact:

Re: Repair broken ext4 partition with wrong superblock checksum

#2 Post by cgrenier »

When you try TestDisk, Advanced, SuperBlock. it should display several backup superblocks.
It's strange that only one is displayed. So it may be safer to copy the files using testdisk.
Check that that the recovered files are valid before reformating the partition.

Locked