恢复实时 USB 中损坏的超级块

恢复实时 USB 中损坏的超级块

我在外部 USB 驱动器上使用 Ubuntu 16.04。最近,在鲁莽地从旧台式机上拔下文件系统和所有超级块备份后,它们都损坏了。我尝试使用fsckfdisk从备份超级块和正确的扇区中恢复,但不幸的是,都没有帮助。我可以从实时 USB 打开它,但在打开可启动分区后,我更改了文件的所有权以将它们传输到另一个磁盘。我不知道这是否会影响情况,但它无法启动并在启动时出现以下错误。

在此处输入图片描述

/dev/sda1: clean, 4965840/30220288 files, 101135365/120875244 blocks
[   9.870902] systemd[1]: networking-routes.service: Job networking-routes.service/start deleted to break ordering cycle starting with sysinit.target/start
[   9.907296] systemd[1]: Failed to start Uncomplicated firewall.
[FAILED] Failed to start Uncomplicated firewall.
See 'systemctl status ufw.service' for details.
[   9.908207] systemd[1]: Failed to start Create list of required static device nodes for the current kernel.
[FAILED] Failed to start Create list of required static device nodes for the current kernel
See 'systemctl status kmode-static-nodes.service' for details.
[   9.908718] systemd[1]: Failed to mount POSIX Message Queue File System.
[FAILED] Failed to mount POSIX Message Queue File System.
See 'systemctl status dev-mqueue.mount' for details.
[   9.909226] systemd[1]: Failed to start Set console keymap.
[FAILED] Failed to start Set console keymap.
See 'systemctl status keyboard-setup.service' for details.
[   9.909634] systemd[1]: Failed to mount Debug File System.
[FAILED] Failed to mount Debug File System.
See 'systemctl status sys-kernel-debug.mount' for details.
[   9.910156] systemd[1]: Failed to mount Huge Pages File System.
[FAILED] Failed to mount Huge Pages File System.
See 'systemctl status dev-hugepages.mount' for details.
[ OK ] Started Load Kernel Modules.
[ OK ] Started Journal Service.
       Starting Apply Kernel Variables...
       Mounting FUSE Control File System...
       Starting Create Static Device Nodes in /dev...
[FAILED] Failed to mount Fuse Control File System.  
See 'systemctl status sys-fs-fuse-connections.mount' for details.   
[FAILED] Failed to start Static Device Nodes in /dev.   
See 'systemctl status systemd-tmpfiles-setup-dev.service' for details.  
[ OK ] Started Apply Kernel Variables.
       Starting udev Kernel Device Manager...
[ OK ] Started udev Kernel Device Manager.
       Starting LSB: QEMU KVM module loading script...
       Starting Remount Root and Kernel File Systems...
[FAILED] Failed to start LSB: QEMU KVM module loading script.   
See 'systemctl status qemu-kvm.service' for details.    
[FAILED] Failed to start Remount Root and Kernel File Systems.  
See 'systemctl status systemd-remount-fs.service' for details.
       Activating swap /swapfile...
       Starting udev Coldplug all Devices...
[ OK ] Reached target Local File Systems (Pre).
       Starting Flush Journal to Persistent Storage...
       Starting Load/Save Random Seed...
[FAILED] Failed to start udev Coldplug all Devices. 
See 'systemctl status systemd.udev-trigger.service' for details.    
[FAILED] Failed to start Flush Journal to Persistent Storage.   
See 'systemctl status systemd-journal-flush.service' for details.
[FAILED] Failed to activate swap /swapfile.
See 'Systemctl status swapfile.swap' for details.
[DEPEND] Dependency failed for Swap.
[ OK ] Started Load/Save Random Seed.
       Starting Show Plymouth Boot Screen...

Dmesg 输出

fdisk 输出

Disk /dev/sdb: 465.8 GiB, 500107862016 bytes, 976773168 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 33553920 bytes
Disklabel type: dos
Disk identifier: 0x1c297f28

Device     Boot     Start       End   Sectors   Size Id Type
/dev/sdb1  *         2048 967004001 967001954 461.1G 83 Linux
/dev/sdb2       967004160 976773119   9768960   4.7G 82 Linux swap / Solaris

需要时我可以发布其他详细信息。

答案1

重新安装系统通常比尝试修复系统更容易、更快捷,但如果有重要数据没有备份,您别无选择。

当计算机从另一个驱动器启动时,您能读取您的个人文件吗?在这种情况下,我建议您将所有这些文件保存到另一个驱动器。您可以尝试备份整个主目录(从超级块损坏的驱动器中的系统中备份)。

如果你无法读取你的个人文件,并且数据非常有价值,我建议你使用以下方法克隆驱动器救援并对克隆的副本进行修复/恢复工作,以避免对文件系统造成更多损坏。否则,您可以直接在驱动器本身上进行操作。

我会先e2fsck并尝试修复文件系统,我注意到您已经尝试过了。您使用了哪些选项?

测试盘相簿您可以尝试以下两种工具e2fsck无法修复。Testdisk 可以修复“损坏程度不大”的文件系统。即使文件系统损坏到无法修复,PhotoRec 也可以恢复文件,只要磁盘上的数据单元没有被覆盖。

您可以在以下链接及其中的链接中找到详细信息。

修复 U 盘的分区表和文件系统

如果您需要更多帮助,欢迎询问:-)

答案2

我通过casper/initrd.lz在 USB 上替换原始 ISO 文件解决了这个问题。

相关内容