我正在尝试调整 Linux 分区的大小,但在对该磁盘进行了大量调整后,我不知道我是否已完全损坏它。
Device Boot Start End Sectors Size Id Type
/dev/sdd1 * 64 5913631 5913568 2.8G 17 Hidden HPFS/NTFS
/dev/sdd2 5913632 5915039 1408 704K 1 FAT12
/dev/sdd3 5915040 17578125 11663086 5.6G 83 Linux
/dev/sdd4 17578126 28320312 10742187 5.1G 83 Linux
使用dd
删除分区并创建新分区我得到
Device Boot Start End Sectors Size Id Type
/dev/sdd1 * 64 5913631 5913568 2.8G 17 Hidden HPFS/NTFS
/dev/sdd2 5913632 5915039 1408 704K 1 FAT12
/dev/sdd3 5915040 40000000 34084961 16.3G 83 Linux
/dev/sdd4 40000001 62521343 22521343 10.8G 83 Linux
然后按照我做的一些教程
$ e2fsck -f /dev/sdd1
$ e2fsck 1.43.7 (16-Oct-2017)
$ ext2fs_open2: Bad magic number in super-block
$ e2fsck: Superblock invalid, trying backup blocks...
$ e2fsck: Bad magic number in super-block while trying to open /dev/sdd1
The superblock could not be read or does not describe a valid ext2/ext3/ext4
filesystem. If the device is valid and it really contains an ext2/ext3/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>
or
e2fsck -b 32768 <device>
/dev/sdd1 contains a iso9660 file system labelled 'Kali Live'
(接下来的 3 个分区的其余部分依此类推)
尝试调整大小会产生相同的效果:
$ resize2fs /dev/sdd3
resize2fs 1.43.7 (16-Oct-2017)
resize2fs: Bad magic number in super-block while trying to open /dev/sdd3
Couldn't find valid filesystem superblock.
我已经按照互联网上的教程进行操作,但不起作用,标题为:如何:在 Ubuntu 中修复损坏的 Ext4 Superblock。
$ mke2fs -n /dev/sdd4
$ e2fsck -b block_number /dev/sdd4
$ e2fsck 1.43.7 (16-Oct-2017)
e2fsck: Bad magic number in super-block while trying to open /dev/sdd4
The superblock could not be read or does not describe a valid ext2/ext3/ext4
filesystem. If the device is valid and it really contains an ext2/ext3/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>
or
e2fsck -b 32768 <device>
所以我绝对不知道该怎么做。它完全浪费了还是我应该从头开始重新安装所有东西?
答案1
用于mke2fs
获取超级块备份:
sudo mke2fs -n /dev/sdaX
示例输出:
Super-block backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
4096000
重启超级块:
sudo e2fsck -b 32768 /dev/sdaX
如果第一个不起作用,请尝试下一个,直到找到一个有效的为止。完成后中断操作然后运行:
sudo fsck -y /dev/sdaX