V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
013231
V2EX  ›  macOS

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

  •  
  •   013231 · 2014-10-28 22:18:18 +08:00 · 6704 次点击
    这是一个创建于 3468 天前的主题,其中的信息可能已经有所发展或是发生改变。
    故障:一块硬盘上的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 条回复    2018-03-08 10:54:52 +08:00
    orzfly
        1
    orzfly  
       2014-10-29 00:22:15 +08:00
    提问:“建立损坏分区的镜像”这个 testdisk 相比 dd 有什么优势?
    013231
        2
    013231  
    OP
       2014-10-29 09:47:40 +08:00
    @orzfly 对于一个损坏的文件系统,dd出的镜像应该同样是损坏的吧?但testdisk做出的镜像是好的。
    lvhongbo22
        3
    lvhongbo22  
       2018-03-05 11:43:39 +08:00
    是必须在苹果系统下才能完成上述操作么? WIN 系统下不可以么?
    013231
        4
    013231  
    OP
       2018-03-05 19:16:40 +08:00
    文中提到的工具 TestDisk 有 Windows 版,具体操作方法可能存在差异。hdiutil 可用 OFSMount 代替。
    lvhongbo22
        5
    lvhongbo22  
       2018-03-07 12:05:55 +08:00
    谢啦 我试试 最近碰到 HFS+分区 无法打开 用了 R-STUDIO、UFS 这种支持 HFS+分区的恢复工具恢复了一下,结果不是很理想。不知道什么原因,很多 20G 以上的大的视频文件恢复出来打不开。而且恢复出来的文件比原始文件少了一半的大小。很头疼。
    lvhongbo22
        6
    lvhongbo22  
       2018-03-08 10:54:52 +08:00
    镜像 OK 之后 用了软件挂载,然后依旧是损坏的分区…………
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   2205 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 26ms · UTC 00:30 · PVG 08:30 · LAX 17:30 · JFK 20:30
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.