无法修复具有坏超级块的 ext4 文件系统

无法修复具有坏超级块的 ext4 文件系统

使用该dd命令,我希望能够将前 446 个字节从磁盘 B(250GB)复制到磁盘 A(80GB),以使磁盘 A 像磁盘 B 一样可启动。我发出了以下命令:

dd if=/dev/sdb of=/dev/sda bs=446 count=1

但当我无法从 启动时sda,我重新启动了sdb以查看发生了什么。令我惊恐的是,sda有一个坏的超级块。

更糟糕的是,我无法通过备份超级块来修复它。这就是我所做的。我首先获取了备份超级块地址,如下所示:

[root@localhost liveuser]# mke2fs -n /dev/sda
mke2fs 1.41.14 (22-Dec-2010)
/dev/sda is entire device, not just one partition!
Proceed anyway? (y,n) y
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=0 blocks, Stripe width=0 blocks
4890624 inodes, 19537686 blocks
976884 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=0
597 block groups
32768 blocks per group, 32768 fragments per group
8192 inodes per group
Superblock backups stored on blocks: 
    32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208, 
    4096000, 7962624, 11239424

然后,我使用上面列出的e2fsck -b SUPERBLOCK /dev/sda每个SUPERBLOCK值,如下所示:

    [root@localhost liveuser]# e2fsck -b 32768 /dev/sda 
e2fsck 1.41.14 (22-Dec-2010)
e2fsck: Bad magic number in super-block while trying to open /dev/sda

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>

我尝试了每一个值,但每个值都出现上述消息!

我现在能做什么来挽救我珍贵的磁盘?这是有 2 个分区的 80G 磁盘。该/dev/sda1分区干净且可安装;该/dev/sda2分区无法使用mountdebugfsdumpe2fs等命令。

运行mke2fs -n单个分区给了我这个(注意第一个数据块最大文件系统块都显示0作为其价值):

[root@localhost liveuser]# mke2fs -n /dev/sda1
mke2fs 1.41.14 (22-Dec-2010)
Filesystem label=
OS type: Linux
Block size=1024 (log=0)
Fragment size=1024 (log=0)
Stride=0 blocks, Stripe width=0 blocks
128016 inodes, 512000 blocks
25600 blocks (5.00%) reserved for the super user
First data block=1
Maximum filesystem blocks=67633152
63 block groups
8192 blocks per group, 8192 fragments per group
2032 inodes per group
Superblock backups stored on blocks: 
    8193, 24577, 40961, 57345, 73729, 204801, 221185, 401409

[root@localhost liveuser]# mke2fs -n /dev/sda2
mke2fs 1.41.14 (22-Dec-2010)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=0 blocks, Stripe width=0 blocks
4857856 inodes, 19409408 blocks
970470 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=0
593 block groups
32768 blocks per group, 32768 fragments per group
8192 inodes per group
Superblock backups stored on blocks: 
    32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208, 
    4096000, 7962624, 11239424

我仍然不知道我的命令中到底出了什么问题,dd导致我的 ext4 超级块损坏。你无法想象如果有人能帮我恢复磁盘我会多么高兴……因为除了这个坏的超级块,所有数据都还在那里!

答案1

usenet 上的讨论重要的分区原来是 LVM PV,根本不是文件系统。

相关内容