![从崩溃的磁盘克隆文件系统](https://linux22.com/image/910589/%E4%BB%8E%E5%B4%A9%E6%BA%83%E7%9A%84%E7%A3%81%E7%9B%98%E5%85%8B%E9%9A%86%E6%96%87%E4%BB%B6%E7%B3%BB%E7%BB%9F.png)
我有一个 Lubuntu 16.04 32 位,安装在 320gb sata 硬盘上。使用一段时间后,硬盘开始损坏,有时我无法正常启动。但标准的 Lubuntu 恢复工具总是能帮助我。最后,我的 MBR 损坏了,我能够使用 fsck 恢复 fs。之后,我决定将硬盘克隆到 1Gb sata3 硬盘。起初我决定使用 dd。在 dd 期间,我收到大量错误,结果 fs 根本无法启动。之后,我格式化了创建的分区并使用 tar 复制了 fs。之后,lubuntu 开始从新磁盘启动,但有时 fs 是只读的。为了解决这个问题,我使用了 live-usb 和 fsck 命令。fsck 通常返回类似以下内容:
Inode 13538762 passes checks, but checksum does not match inode. Fix? yes
Inode 14418178 extent tree (at level 2) could be narrower. Fix? yes
Inode 16131779 extent tree (at level 1) could be narrower. Fix? yes
...
重复了很多次后,我决定重新克隆 fs。这次我使用 gparted 删除了所有分区,然后创建了一个新分区,将其格式化为 ext4。然后使用“cp -afv”克隆 fs,然后使用 grub-install 安装 grub。lubuntu 开始工作,但过了一会儿 fs 又变成了只读。我再次使用 live-usb 和 fsck,再次收到以下信息:
lubuntu@lubuntu:~$ sudo fsck /dev/sdb1 -y
fsck from util-linux 2.30.1
e2fsck 1.43.5 (04-Aug-2017)
/dev/sdb1 contains a file system with errors, check forced.
Pass 1: Checking inodes, blocks, and sizes
Inode 6340227 passes checks, but checksum does not match inode. Fix? yes
Inode 11261598 passes checks, but checksum does not match inode. Fix? yes
Inodes that were part of a corrupted orphan linked list found. Fix? yes
Inode 11819838 was part of the orphaned inode list. FIXED.
Inode 11819994 was part of the orphaned inode list. FIXED.
Inode 11829793 was part of the orphaned inode list. FIXED.
Inode 11829932 was part of the orphaned inode list. FIXED.
Inode 11829943 was part of the orphaned inode list. FIXED.
Inode 13538895 passes checks, but checksum does not match inode. Fix? yes
Deleted inode 13887261 has zero dtime. Fix? yes
Inode 13887265 was part of the orphaned inode list. FIXED.
Inode 14584546 was part of the orphaned inode list. FIXED.
Inode 14584547 was part of the orphaned inode list. FIXED.
Inode 16419601 was part of the orphaned inode list. FIXED.
Inode 16419602 was part of the orphaned inode list. FIXED.
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
Block bitmap differences: -47327301 -47327318 -47362566 -47929343 -47945355 -(48034345--48034349) -(58604061--58604083) -(65354289--65354290)
Fix? yes
Free blocks count wrong for group #1444 (1820, counted=1822).
Fix? yes
Free blocks count wrong for group #1445 (2138, counted=2139).
Fix? yes
Free blocks count wrong for group #1462 (1676, counted=1677).
Fix? yes
Free blocks count wrong for group #1463 (1223, counted=1224).
Fix? yes
Free blocks count wrong for group #1465 (1647, counted=1652).
Fix? yes
Free blocks count wrong for group #1788 (9712, counted=9735).
Fix? yes
Free blocks count wrong for group #1994 (12485, counted=12487).
Fix? yes
Free blocks count wrong (15276277, counted=15276312).
Fix? yes
Inode bitmap differences: -11819838 -11819994 -11829793 -11829932 -11829943 -13887261 -13887265 -(14584546--14584547) -(16419601--16419602)
Fix? yes
Free inodes count wrong for group #1442 (0, counted=2).
Fix? yes
Free inodes count wrong for group #1444 (7360, counted=7363).
Fix? yes
Free inodes count wrong for group #1695 (6367, counted=6369).
Fix? yes
Free inodes count wrong for group #1780 (5403, counted=5405).
Fix? yes
Free inodes count wrong for group #2004 (5358, counted=5360).
Fix? yes
Free inodes count wrong (16196247, counted=16196258).
Fix? yes
/dev/sdb1: ***** FILE SYSTEM WAS MODIFIED *****
/dev/sdb1: 4775262/20971520 files (0.1% non-contiguous), 68609768/83886080 blocks
我忘了说每次 lubuntu 启动时,总是会出现以下提示:“检查磁盘驱动器 / 时发现严重错误。按 I 忽略,...”我按 I,通常启动会继续成功,但有时它不起作用,只有 live-usb 和 fsck 有帮助。如何摆脱它。谢谢你的帮助。