使用 dd 进行备份和恢复可以解决文件系统损坏问题吗?

使用 dd 进行备份和恢复可以解决文件系统损坏问题吗?

在运行 raspbian jessy 的树莓派 3 上运行“sudo apt-get update && sudo apt-get update”后,我得到:

E: Failed to fetch http://mirrordirector.raspbian.org/raspbian/pool/main/g/ghostscript/libgs9-common_9.06~dfsg-2+deb8u5_all.deb  rename failed, Structure needs cleaning (/var/cache/apt/archives/partial/libgs9-common_9.06~dfsg-2+deb8u5_all.deb -> /var/cache/apt/archives/libgs9-common_9.06~dfsg-2+deb8u5_all.deb).

E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?

在网络上快速搜索并这里据透露,这可能与 SD 卡上的文件系统损坏有关。因为这是我的文件服务器,我不想重新配置它:我可以用 dd 进行备份,然后在新的 SD 卡上恢复,还是这也会复制文件系统损坏?

答案1

这也会复制文件系统损坏(dd复制块设备的内容,而不关心它们的结构)。

要解决您的问题,我建议运行apt-get clean以清除您的包缓存,并且fsck.如果您的文件系统检测到错误,重新启动 Pi 应该会强制执行完整的fsck.

相关内容