V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
013231
V2EX  ›  macOS

从损坏的 HFS+分区中恢复文件

  •  
  •   013231 · Oct 28, 2014 · 7434 views
    This topic created in 4204 days ago, the information mentioned may be changed or developed.
    故障:一块硬盘上的HFS+分区可见但无法加载。尝试使用系统自带Disk Utility修复分区,失败(Error: Disk Utility can’t repair this disk. Back up as many of your files as possible, reformat the disk, and restore your backed-up files.)。

    修复过程:

    TL;DR: 使用testdisk建立损坏分区的镜像,从镜像中恢复文件.

    1. 安装TestDisk。TestDisk是一个开源磁盘修复软件,可以直接使用brew安装。http://www.cgsecurity.org/wiki/TestDisk

    2. 创建镜像
    2.1 `sudo testdisk`
    2.2 [ Create ] Create a new log file
    2.3 选择磁盘(选择/dev/rdisk*, 速度更快)
    2.4 [ Continue ] Continue even if write access isn't available
    2.5 选择分区表类型([EFI GPT] EFI GPT partition map (Mac i386, some x86_64...))
    2.6 [ Advanced ] Filesystem Utils
    2.7 选择要处理的分区,[Image Creation]
    2.8 选择镜像存储路径,按c开始创建镜像。

    3. testdisk会创建一个名为image.dd的镜像。使用hdiutil挂载它:`hdiutil attach -imagekey diskimage-class=CRawDiskImage image.dd`。

    4. 迁移文件
    6 replies    2018-03-08 10:54:52 +08:00
    orzfly
        1
    orzfly  
       Oct 29, 2014
    提问:“建立损坏分区的镜像”这个 testdisk 相比 dd 有什么优势?
    013231
        2
    013231  
    OP
       Oct 29, 2014
    @orzfly 对于一个损坏的文件系统,dd出的镜像应该同样是损坏的吧?但testdisk做出的镜像是好的。
    lvhongbo22
        3
    lvhongbo22  
       Mar 5, 2018
    是必须在苹果系统下才能完成上述操作么? WIN 系统下不可以么?
    013231
        4
    013231  
    OP
       Mar 5, 2018
    文中提到的工具 TestDisk 有 Windows 版,具体操作方法可能存在差异。hdiutil 可用 OFSMount 代替。
    lvhongbo22
        5
    lvhongbo22  
       Mar 7, 2018
    谢啦 我试试 最近碰到 HFS+分区 无法打开 用了 R-STUDIO、UFS 这种支持 HFS+分区的恢复工具恢复了一下,结果不是很理想。不知道什么原因,很多 20G 以上的大的视频文件恢复出来打不开。而且恢复出来的文件比原始文件少了一半的大小。很头疼。
    lvhongbo22
        6
    lvhongbo22  
       Mar 8, 2018
    镜像 OK 之后 用了软件挂载,然后依旧是损坏的分区…………
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2511 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 30ms · UTC 06:37 · PVG 14:37 · LAX 23:37 · JFK 02:37
    ♥ Do have faith in what you're doing.