前言
今天晚上在阿里云服务器做的挂载在进行文件系统扩容的时候出错了。
输出如下所示
1 2 3 4 5 6 7 8 9 10 |
fsck /dev/sda5 fsck 1.41.4 (27-Jan-2009) e2fsck 1.41.4 (27-Jan-2009) fsck.ext4: Group descriptors look bad... trying backup blocks... fsck.ext4: Bad magic number in super-block while trying to open /dev/sda5 The superblock could not be read or does not describe a correct ext4 filesystem. If the device is valid and it really contains an ext4 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> |
现在找到超级块备份保存位置
1 |
sudo mke2fs -n /dev/xxx |
在这个输出的底部,应该是备份列表:
1 2 |
Superblock backups stored on blocks: 32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208 |
从备份恢复超级块,XXX就是你的分区名,block_number写第一个备份超级块。
1 |
sudo e2fsck -b block_number /dev/xxx |
现在重启,你的超级块应该被修复了。如果没有,请重复上面的步骤,但还原第二个备份超级块,以此类推。