Learn how to resolve bad magic number in super-block error in Linux. This process describes step by step procedure to resolve bad magic number in super-block error.
Error: bad magic number in super-block error
So Below is the error that you may get while booting of the server.
fsck.ext4: Bad magic number in super-block while trying to open /dev/sdel /dev/sdel: The superblock could not be read or does not describe a correct ext2 filesystem. If the device is valid and it really contains an ext2 filesystem (and not swap or ufs or something else), then the superblock is corrupt, and you might try running e2fsck with an alternate superblock: e2fsck -b 8193 <device>
Now to solve this error of “bad magic number in super-block error” firstly you need to know the location of the super-block by which you can resolve the issue.
Step1: Get the location of backup superblock
This will not format file system or create any new file system. However this command will give the location of the backup superblock.
[root@rhel1 ~]# mke2fs -n /dev/sde1 mke2fs 1.41.12 (17-May-2010) Filesystem label= OS type: Linux Block size=4096 (log=2) Fragment size=4096 (log=2) Stride=0 blocks, Stripe width=0 blocks 78400 inodes, 313259 blocks 15662 blocks (5.00%) reserved for the super user First data block=0 Maximum filesystem blocks=322961408 10 block groups 32768 blocks per group, 32768 fragments per group 7840 inodes per group Superblock backups stored on blocks: 32768, 98304, 163840, 229376, 294912
As per output backup super blocks are stored at location “32768” and also at “98304”. Now let’s use location “32768” and supply this as parameter to command “e2fsck” to resolve “bad magic number in super-block” error.