Recover ext4 partition superblock `Free blocks count wrong for group #0`
0
votes
0
answers
2524
views
I have a broken ext4 partition which I want to recover. The problem occurred because of a sudden power loss. The partition is an encrypted luks partition. Opening the luks container works. Say I open it to
/dev/mapper/test
.
Then I am able to mount the partition like
mount -t ext4 -o sb=131072,ro /dev/mapper/test /mnt
Where 131072 is the location of the [superblock multiplied by 4](https://superuser.com/q/1137415/53616) .
Then I can access the files (which I already backed up after the successful mount).
However if I try to [repair the superblock](https://linuxexpresso.wordpress.com/2010/03/31/repair-a-broken-ext4-superblock-in-ubuntu/) the following happens:
e2fsck -b 32768 /dev/mapper/test
e2fsck 1.46.3 (27-Jul-2021)
/dev/mapper/test was not cleanly unmounted, check forced.
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
Free blocks count wrong for group #0 (23391, counted=280).
Fix?
If I press y
the same message Free blocks count wrong for group #0 (23391, counted=280).
appears again and again (with another number at the end). I already pressed yes several times and then hold the y
key down for a certain time.
Now I am looking for an advice what to do to repair the the partition. Is there an automatic way to answer y
to this question so I don't have to hold the y
key for an indefinite time? I could use the -y
command line parameter, but then other questions would be also answered with yes.
Or should I do something else?
Asked by student
(18865 rep)
Jan 14, 2023, 08:10 PM
Last activity: Jan 15, 2023, 05:30 AM
Last activity: Jan 15, 2023, 05:30 AM