resize2fs Superblock Checksum Error – What It Means and How to Fix It
After extending a logical volume (e.g., using LVM), it’s common to resize the filesystem to make use of the newly allocated space. However, in some cases, the resize operation fails with an error like:
Superblock checksum does not match superblock while trying to open /dev/sdX
Couldn’t find valid filesystem superblock.
This indicates that the filesystem’s primary superblock is corrupted or unreadable.
The superblock contains critical metadata about the filesystem, since resize2fs relies on a valid superblock to understand and safely modify the filesystem layout, it cannot proceed and resize the filesystem.
This issue can occur due to:
- Power loss or unclean shutdowns
- Corrupted disk metadata
- Incorrect volume extension or device mismatch
To finally also resize the filesystem successfully, we first need to unmount the affected filesystem and then trying to repair it by using the e2fsck utility and finally resize and mount it again.
e2fsck stands for ext2 filesystem check, but it also works on ext3 and ext4 filesystems. It’s used to check and repair the integrity of a Linux filesystem on a disk or logical volume.
It scans for errors in the filesystem’s structure and metadata and attempts to fix them.
So first unmount the affected filesystem.
# umount /data1/folder1 # umount /data2/folder2
Then run the e2fsck utility on the filesystem.
# sudo e2fsck -vfy /dev/mapper/<path volume> # sudo e2fsck -vfy /dev/mapper/<path volume> e.g. # sudo e2fsck -vfy /dev/mapper/data1_vg-folder1 # sudo e2fsck -vfy /dev/mapper/data2_vg-folder2 -v for verbose output -f this will force a check even if the system thinks the file system is clean. -y assume an answer of yes to all questions; allows e2fsck to be used non-interactively.
After the filesystem was successfully repaired, we can resize the filesystem (still offline).
# resize2fs /dev/mapper/<path volume> # resize2fs /dev/mapper/<path volume> e.g. # resize2fs /dev/mapper/data1_vg-folder1 # resize2fs /dev/mapper/data2_vg-folder2
And finally we can mount it again.
# mount /dev/mapper/data1_vg-folder1 /data1/folder1 # mount /dev/mapper/data2_vg-folder2 /data2/folder2
Links
e2fsck
https://man.archlinux.org/man/e2fsck.8.ene2fsck(8) – Linux man page
https://linux.die.net/man/8/e2fsckresize2fs(8) – Linux man page
https://linux.die.net/man/8/resize2fs
Tags In
Related Posts
Latest posts
Step-by-Step Guide Part 4: How to build your own NetApp ONTAP 9 LAB – Day-to-Day Operations
Follow me on LinkedIn
