最新消息:20190717 VPS服务器:Vultr新加坡,WordPress主题:大前端D8,统一介绍入口:关于

【未解决】Mac中尝试用fsck_exfat修复被损坏的exFAT移动硬盘

Mac crifan 265浏览 0评论
折腾:
【未解决】Mac中无法识别exFAT的外接移动硬盘
期间,发现mac中有个工具,fsck_exfat,貌似可以用来修复此处出了问题,被破坏了的exFAT的4T的希捷硬盘。
然后遇到:
➜  ~ sudo fsck_exfat -d disk2s2
Password:
Opening /dev/rdisk2s2
fsck_exfat: Can't open /dev/rdisk2s2: Resource busy
所以去:
【已解决】Mac中fsck_exfat出错Can’t open /dev/rdisk2s2 Resource busy
然后就是等待修复:
...
Directory /Backup/20180601/Offline/xxx/user/36752158
Directory /Backup/20180601/Offline/xxx/user/31190871
Directory /Backup/20180601/Offline/xxx/user/5340798
...
然后就是一直等待吧
然后此处执行fsck_exfat太占用CPU了。所以中断:
Directory /Backup/20180601/Offline/xxx/user/4566620
vm.memory_pressure = 4027
vm.page_free_wanted = 278
--- [1459] Evicted 5 buffers (1310720 bytes; 320 pages)
Read      offset = 0x000001468000  length = 0x001000
vm.memory_pressure = 4027
vm.page_free_wanted = 389
--- [1460] Evicted 7 buffers (1835008 bytes; 448 pages)
Read      offset = 0x004c34080000  length = 0x040000
Directory /Backup/20180601/Offline/xxx/user/3260903
减少CPU占用:
去换另外一个Mac去执行。
当前mac继续用于工作。
结果另外一个mac中,出现其他错误:
xxxdeMacBook-Pro:~ xxx$ diskutil list
/dev/disk0 (internal, physical):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                        *240.1 GB   disk0
   1:                        EFI EFI                     209.7 MB   disk0s1
   2:                 Apple_APFS Container disk2         239.9 GB   disk0s2

/dev/disk1 (internal, physical):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                        *320.1 GB   disk1
   1:                        EFI EFI                     209.7 MB   disk1s1
   2:                  Apple_HFS Toshiba 320G            319.2 GB   disk1s2
   3:                 Apple_Boot Recovery HD             650.0 MB   disk1s3

/dev/disk2 (synthesized):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      APFS Container Scheme -                      +239.9 GB   disk2
                                 Physical Store disk0s2
   1:                APFS Volume SandDisk 240G           37.1 GB    disk2s1
   2:                APFS Volume Preboot                 22.4 MB    disk2s2
   3:                APFS Volume Recovery                516.1 MB   disk2s3
   4:                APFS Volume VM                      2.1 GB     disk2s4

/dev/disk3 (external, physical):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                        *4.0 TB     disk3
   1:                        EFI EFI                     209.7 MB   disk3s1
   2:       Microsoft Basic Data 内容备份2               4.0 TB     disk3s2

xxxdeMacBook-Pro:~ xxx$ sudo fsck_exfat -d disk3s2
Password:
Opening /dev/rdisk3s2
fsck_exfat: Can't open /dev/rdisk3s2: Resource busy
xxxdeMacBook-Pro:~ xxx$ ps aux | grep fsck
root               392   4.4  1.0  4336616  41184   ??  U    11:32上午  22:19.49 /System/Library/Filesystems/exfat.fs/Contents/Resources/./fsck_exfat -y /dev/rdisk3s2
xxx          706   0.0  0.0  4267752    676 s004  R+   12:07下午   0:00.00 grep fsck
xxxdeMacBook-Pro:~ xxx$ sudo pkill -f fsck
xxxdeMacBook-Pro:~ xxx$ ps aux | grep fsck
root               709  40.2  0.3  4312916  13592   ??  R    12:07下午   0:00.42 /System/Library/Filesystems/exfat.fs/Contents/Resources/./fsck_exfat -y /dev/rdisk3s2
xxx          711   0.0  0.0  4276968    900 s004  S+   12:07下午   0:00.00 grep fsck
xxxdeMacBook-Pro:~ xxx$ sudo fsck_exfat -d disk3s2
Opening /dev/rdisk3s2
fsck_exfat: Can't open /dev/rdisk3s2: Resource busy
xxxdeMacBook-Pro:~ xxx$ kill -9 13592
-bash: kill: (13592) - No such process
xxxdeMacBook-Pro:~ xxx$ kill -9 709
macOS 无法修复磁盘“内容备份2”。
您仍可打开或拷贝磁盘上的文件,但是您无法存储对磁盘上的文件所做的更改。请备份此磁盘并尽快重新格式化此磁盘。
此处的弹框感觉是:
kill掉了fsck后,系统提示fsck没有正常修复完毕。
所以可以忽略。
继续去操作
sudo fsck_exfat -d disk3s2
然后就是漫长的等待了:
现在是:20181024 13:40
    /Backup/20180601/Offline/xxx/user/31365865/user_31365865_info.json
Read      offset = 0x004855ec0000  length = 0x040000
File      /Backup/20180601/Offline/xxx/user/31442047/user_31442047_info.json
...
File      /Backup/20180601/Offline/xxx/user/32054152/user_32054152_info.json
Directory /Backup/20180601/Offline/xxx/user/32054152/show
Read      offset = 0x004871c40000  length = 0x040000
File      /Backup/20180601/Offline/xxx/user/38407978/user_38407978_info.json
对于硬盘中有2T数据的前提下,经过很多个小时之后,终于看到提示了:
Read      offset = 0x0200e8f00000  length = 0x040000
File      /Backup/20180601/Offline/xxx/user/2770921/show/26247454/show_26247454_info.json
Read      offset = 0x0200e9000000  length = 0x040000
File      /Backup/20180601/Offline/xxx/user/2770921/show/26243645/show_26243645_info.json
** Checking active bitmap.
Checking bitmap cluster 2
Read      offset = 0x000005000000  length = 0x040000
Read      offset = 0x000001000000  length = 0x001000
Checking bitmap cluster 3
Read      offset = 0x000005040000  length = 0x040000
Checking bitmap cluster 4
Read      offset = 0x000005080000  length = 0x040000
Checking bitmap cluster 5
Read      offset = 0x0000050c0000  length = 0x040000
Checking bitmap cluster 6
Read      offset = 0x000005100000  length = 0x040000
Checking bitmap cluster 7
Read      offset = 0x000005140000  length = 0x040000
Checking bitmap cluster 8
Read      offset = 0x000005180000  length = 0x040000
Checking bitmap cluster 9
Read      offset = 0x0000051c0000  length = 0x040000
0 clusters were marked used, but not referenced
0 clusters were marked used and CLUST_BAD
0 clusters were marked free, but referenced
** Rechecking main boot region.
** Rechecking alternate boot region.
Mark volume clean?
参考:
https://gist.github.com/scottopell/595717f0f77ef670f75498bd01f8cab1
但是没有说如何处理此处情况
fsck_exfat Mark volume clean
Fix Dirty ExFAT Partition on macOS · Zihao Zhang
macos – Recover a corrupted exFAT volume under OS X – Super User
How to Repair a Mac Disk with fsck from Single User Mode
hard drive – fsck_msdos keep blocking external HD – Ask Different
Super weird – USB HD hidden files? : raspberry_pi
算了,输入Y或Yes试试
结果出错:
Mark volume clean? Y
Mark volume clean? Yes
fsck_exfat: Could not update main boot region: Bad file descriptor
fsck_exfat: Could not update main boot region: Bad file descriptor
fsck_exfat: Could not update main boot region: Bad file descriptor – Mac OS X – external hard drive – Super User
算了,拔掉硬盘,重新插入,看看,希望,能在Finder识别,且希望数据都恢复了。
果然还真的可以了:
Finder中可以看到盘符,且可以正常看到已用空间大小了。
看来应该损失恢复了。
那就暂时认为是恢复了。
然后继续去爬去数据,实时保存到此移动硬盘中。
此处以为修复了,实际上后来证实是没修复。
此处是exFAT的移动硬盘,感觉Mac对于exFAT兼容性不够好,有bug
在用爬虫爬取数据实时保存到此exFAT的移动硬盘中时,前后共出现2次,硬盘数据出错,Mac无法识别。
最后是参考:
Fix corrupted exFAT disk macOS/OSX
去:
sudo fsck_exfat -d disk3s2
最终貌似恢复了数据,Mac中可以识别,但是后续无法写入数据。只能是read-only模式加载而已。
其中:disk3s2是此的移动硬盘本身。
可以通过:
磁盘工具-》外置-》设备 
diskutil list
-》看到类似于:
/dev/disk3 (external, physical)
中的
2:       Microsoft Basic Data 内容备份2               4.0 TB     disk3s2
而得到disk3s2
另外:
fsck_exfat -d disk3s2
最后,提示:
Mark volume clean?
输入Yes后,提示:
fsck_exfat: Could not update main boot region: Bad file descriptor
但是好像不用管,此时Finder中已可以正常识别硬盘和读写数据了。
后来是拔掉后再插上,Finder中竟然找不到硬盘。。。
然后只能再去试试之前的步骤
最后经过多次尝试发现:
插入硬盘后,mac尝试去修复,内部会调用fsck
所以:
  • 后续再去用fsck_exfat -d disk3s2会提示busy
  • 然后去用 ps aux | grep fsck 和 sudo kill -9 xxx 后就可以看到盘符了
然后磁盘工具也当然可以检测和看到正常信息了:
结果后续爬去还是不行:
是read only
还是要去修复才能写入
然后继续修复
重复执行:
sudo fsck_exfat -d disk3s2
然后
Mark volume clean?
输入N后No
exFat G-Drive will not mount on iMac OS X 10.11.6 – G-Technology / G-DRIVE – WD Community
Disk Utility from local SSD and Recovery … – Apple Community
hard drive – Fixing a malformed Partition.(Mac or WIn7) – Super User
-》
Download EaseUS Partition Recovery and Free EaseUS Data Recovery
结果是windows中的软件,不是mac的
** Rechecking alternate boot region.
Mark volume clean? No
** The volume 内容备份2 appears to be OK.
 
Mac fsck_exfat
macos – Disable the disk check when reconnecting an improperly disconnected disk to OS X – Ask Different
还是无法用fsck_exfat修复此出了问题的exFAT硬盘。
mavericks – How can I repair a disk that Disk Utility says it can’t repair? – Ask Different
How to Repair Hard Disks with fsck on macOS – Make Tech Easier
  • fsck
    • fsck_hfs
    • fsck_msdos
    • fsck_exfat
    • fsck_udf
    • 参数
      • -y ==yes
      • -f ==force

转载请注明:在路上 » 【未解决】Mac中尝试用fsck_exfat修复被损坏的exFAT移动硬盘

发表我的评论
取消评论

表情

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址
88 queries in 0.139 seconds, using 20.67MB memory