Recovering the Ext4 file system Superblock

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.