最新消息:20210816 当前crifan.com域名已被污染,为防止失联,请关注(页面右下角的)公众号

【已解决】Mac中fsck_exfat出错Can’t open /dev/rdisk2s2 Resource busy

Mac crifan 3640浏览 0评论
折腾:
【已解决】Mac中无法识别exFAT的外接移动硬盘
期间,去试试fsck_exfat,结果出错:
➜  ~ sudo fsck_exfat -d disk2s2
Password:
Opening /dev/rdisk2s2
fsck_exfat: Can't open /dev/rdisk2s2: Resource busy
fsck_exfat Can’t open   Resource busy
macos – Get rid of “Resource Busy” message on Mac OS X – Super User
linux – How to fix ‘Resource busy’ when mounting a vfat disk on a Mac? – Super User
macos – External hard drive can’t be mounted. OS X(10.10.4) running huge fsck_hfs process – Super User
Repairing a Corrupted Mac OSX ExFAT Partition | Craig Smith
exFAT volume often gets corrupted – Apple Community
Recovering my DATA from USB External HD – Apple Community
➜  ~ diskutil info /dev/disk2s2
   Device Identifier:        disk2s2
   Device Node:              /dev/disk2s2
   Whole:                    No
   Part of Whole:            disk2

   Volume Name:              内容备份2
   Mounted:                  No

   Partition Type:           Microsoft Basic Data
   File System Personality:  ExFAT
   Type (Bundle):            exfat
   Name (User Visible):      ExFAT

   OS Can Be Installed:      No
   Media Type:               Generic
   Protocol:                 USB
   SMART Status:             Not Supported
   Volume UUID:              756A5BF4-881A-3D0A-8384-13EB4A3EEC22
   Disk / Partition UUID:    A7D34A12-9ABE-4683-B315-270416FE215F
   Partition Offset:         209735680 Bytes (409640 512-Byte-Device-Blocks)

   Disk Size:                4.0 TB (4000576417792 Bytes) (exactly 7813625816 512-Byte-Units)
   Device Block Size:        512 Bytes

   Volume Total Space:       0 B (0 Bytes) (exactly 0 512-Byte-Units)
   Volume Free Space:        0 B (0 Bytes) (exactly 0 512-Byte-Units)

   Read-Only Media:          No
   Read-Only Volume:         Not applicable (not mounted)

   Device Location:          External
   Removable Media:          Fixed
是可以识别的啊
难道是 磁盘工具 读写造成了 此移动硬盘 的 busy?
那把 磁盘工具去掉试试,然后强制重新拔插移动硬盘,再去试试fsck_exfat
没反应。
拔了算了。
然后问题依旧:
➜  ~ sudo fsck_exfat -d disk2s2
Password:
Sorry, try again.
Password:
Opening /dev/rdisk2s2
fsck_exfat: Can't open /dev/rdisk2s2: Resource busy
➜  ~ sudo fsck_exfat -d disk2s2
fsck_exfat: Can't open /dev/rdisk2s2: No such file or directory
Opening /dev/rdisk2s2
➜  ~ sudo fsck_exfat -d disk2s2
fsck_exfat: Can't open /dev/rdisk2s2: Resource busy
Opening /dev/rdisk2s2
➜  ~ sudo fsck_exfat -d disk2s2
Opening /dev/rdisk2s2
fsck_exfat: Can't open /dev/rdisk2s2: Resource busy
diskutil info /dev/disk2s2
输出的:
Read-Only Volume:         Not applicable (not mounted)
去试试用 磁盘工具 装载
点了 装载 没反应
参考:
https://discussions.apple.com/thread/8050213
去:
➜  ~ sudo fsck_exfat -d /dev/disk2s2
fsck_exfat: Can't open /dev/rdisk2s2: Resource busy
问题依旧。
➜  ~ diskutil repairVolume /dev/disk2s2
Started file system repair on disk2s2 内容备份2
Repairing file system
Volume is already unmounted
Performing fsck_exfat -y -x /dev/rdisk2s2
File system check exit code is 1
Restoring the original state found as unmounted
Error: -69845: File system verify or repair failed
Underlying error: 1: Operation not permitted
然后:
➜  ~  diskutil repairDisk disk2
Repairing the partition map might erase disk2s1, proceed? (y/N) N
Repair canceled
怕数据被擦除了,所以放弃。
参考:
https://superuser.com/questions/906513/get-rid-of-resource-busy-message-on-mac-os-x
去:
➜  ~ diskutil list
/dev/disk0 (internal, physical):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                        *500.3 GB   disk0
   1:                        EFI EFI                     209.7 MB   disk0s1
   2:                 Apple_APFS Container disk1         500.1 GB   disk0s2

/dev/disk1 (synthesized):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      APFS Container Scheme -                      +500.1 GB   disk1
                                 Physical Store disk0s2
   1:                APFS Volume Macintosh HD            412.6 GB   disk1s1
   2:                APFS Volume Preboot                 21.9 MB    disk1s2
   3:                APFS Volume Recovery                519.0 MB   disk1s3
   4:                APFS Volume VM                      9.7 GB     disk1s4

/dev/disk2 (external, physical):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                        *4.0 TB     disk2
   1:                        EFI EFI                     209.7 MB   disk2s1
   2:       Microsoft Basic Data 内容备份2               4.0 TB     disk2s2
再去:
➜  ~ diskutil unmountDisk force /dev/disk2
Forced unmount of all volumes on disk2 was successful
然后:
➜  ~ diskutil mountDisk force /dev/disk2
Usage:   diskutil mountDisk DiskIdentifier|DeviceNode
Attempt to mount the directly-mountable volumes on all of a whole disk's
partitions. However, virtual volumes which are implied by e.g. Core Storage
Physical Volumes, AppleRAID Members, etc. are not handled. If you specify
a partition, then that partition's whole-disk parent is assumed.
然后还是:
➜  ~ sudo fsck_exfat -d /dev/disk2s2
Password:
Opening /dev/rdisk2s2
fsck_exfat: Can't open /dev/rdisk2s2: Resource busy
➜  ~ sudo fsck_exfat -d /dev/disk2s2
Opening /dev/rdisk2s2
fsck_exfat: Can't open /dev/rdisk2s2: Resource busy
fsck_exfat Resource busy
hdd – External drive does not mount after plug off without eject – Ask Different
➜  ~ diskutil unmountDisk /dev/disk2
Unmount of all volumes on disk2 was successful
➜  ~ diskutil eject /dev/disk2
始终没反应
最后超时了:
➜  ~ diskutil eject /dev/disk2
Volume timed out while waiting to eject
然后去看看:
➜  ~ ps aux | grep fsck
root             20886  98.2  0.3  4346088  21132   ??  R    11:03上午  14:52.61 /System/Library/Filesystems/exfat.fs/Contents/Resources/./fsck_exfat -y /dev/rdisk2s2
crifan           21290   0.0  0.0  4286184    900 s006  R+   11:19上午   0:00.00 grep --color=auto --exclude-dir=.bzr --exclude-dir=CVS --exclude-dir=.git --exclude-dir=.hg --exclude-dir=.svn fsck
➜  ~ sudo pkill -f fsck
Password:
然后再去
sudo fsck_exfat -d /dev/disk2s2
就可以了。
【总结】
此处,去执行:
sudo fsck_exfat -d disk2s2
但是出错:
fsck_exfat: Can’t open /dev/rdisk2s2: Resource busy
的原因是
此处(exFAT的)本身出了问题的外接移动硬盘,插入Mac中后,Mac估计是检测出硬盘有问题,无法正常挂载,就自动,擅自主张的去尝试去修复,所以内部在执行fsck方面的命令。
所以导致此处硬盘被占用,别的命令,包括此处的fsck_exfat,无法继续操作,报Resource busy
解决办法:
干掉,杀掉之前的fsck
先用:
ps aux | grep fsck
确认的确有fsck进程在运行
再去杀掉:
sudo pkill -f fsck
注:或通过pid杀掉 
kill -9 fsck_pid
然后其他命令,包括:
sudo fsck_exfat -d disk2s2
就都可以正常执行了。

转载请注明:在路上 » 【已解决】Mac中fsck_exfat出错Can’t open /dev/rdisk2s2 Resource busy

发表我的评论
取消评论

表情

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

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

网友最新评论 (1)

  1. Thank you, your post was the only one that worked out of all of the solutions out there
    Kevin3年前 (2021-07-22)回复
92 queries in 0.197 seconds, using 22.08MB memory