Recovering the Ext4 file system Superblock
1. Create ext4 file System.
[Email protected] ~]# MKFS.EXT4/DEV/VDB1
[Email protected] ~]# PARTPROBE/DEV/VDB
2. Mounting the file system
[[email protected] ~]# grep vdb2/etc/fstab
/DEV/VDB1/EXT4 EXT4 Defaults 0 0
[Email protected] ~]# mount-a
[Email protected] ~]# df-h
Filesystem Size used Avail use% mounted on
/DEV/VDB1 100G 1.7G 94G 2%/EXT4
3. unmount the file system and destroy Super Block
[Email protected] ~]# UMOUNT/EXT4
[Email protected] ~]#
[[email protected] ~]# dd If=/dev/zero of=/dev/vdb1 bs=1024 count=5
5+0 Records in
5+0 Records out
5120 bytes (5.1 kB) copied, 0.00481915 s, 1.1 mb/s
[Email protected] ~]# PARTX/DEV/VDB
PARTX:/dev/vdb:failed to read partition table
[Email protected] ~]#
[Email protected] ~]# MOUNT/EXT4
Mount:wrong fs type, bad option, bad Superblock on/dev/vdb1,
Missing codepage or helper program, or other error
In some cases useful info are found in Syslog-try
DMESG | Tail or so
[Email protected] ~]# DMESG
[22600278.492089] Ext4-fs (VDB1): Vfs:can ' t find EXT4 filesystem
4. Restore Superblock
[Email protected] ~]# fsck-t EXT4/DEV/VDB1
Fsck from Util-linux 2.20.1
E2fsck 1.41.14 (22-dec-2010)
Fsck.ext4:Superblock invalid, trying backup blocks ...
One or more block group descriptor checksums is invalid.Fix? Yes
Group Descriptor 0 Checksum is invalid. FIXED.
Group Descriptor 1 Checksum is invalid. FIXED.
Group Descriptor 2 Checksum is invalid. FIXED.
...
Fix? Yes
/DEV/VDB1: * * * * * FILE SYSTEM was MODIFIED * * * * *
/dev/vdb1:11/6553600 files (0.0% non-contiguous), 459349/26214144 blocks
5. The test is resumed.
[Email protected] ~]# mount-a
[Email protected] ~]# df-h
Filesystem Size used Avail use% mounted on
/DEV/VDB1 100G 1.7G 94G 2%/ext4
Recovering the Ext4 file system Superblock