I have external CDROM connected to MBP and I wanted to read one data CD. The media was in bad shape (scratched) so macOS could not read anything. I wanted to eject the disk and try another media, just to find out I am completely stuck.
Disk Utility would spin "Loading disks" indefinitely, and all my efforts to unmount/eject disk from command line have failed. Not even eject button on CDROM drive worked. When I physically disconnected CDROM drive - diskutil still kept showing it:
/dev/disk6 (external, physical): #: TYPE NAME SIZE IDENTIFIER 0: CD_partition_scheme *109.6 MB disk6
With CDROM connected this did absolutely nothing:
I tried following with CDROM connected and disconnected (tldr; everything failed):
diskutil unmountDisk /dev/disk6 Unmount of disk6 failed: at least one volume could not be unmounted diskutil umount force /dev/disk6 disk6 was already unmounted or it has a partitioning scheme so use "diskutil unmountDisk" instead diskutil eject /dev/disk6 Volume timed out while waiting to eject diskutil eject /dev/rdisk6 Volume timed out while waiting to eject diskutil eject disk6 Volume timed out while waiting to eject
sync to force cache flushing - it did nothing.
I checked all open handles with
lsof - and could not find any.
This happened to me couple of times before due to bad (corrupted) USB drives (or HDD drives with esoteric Linux partition scheme), and only way I could get out of this type of hang was - reboot (not even logout/login worked).
Is there a way to recover from Disk Utility hang without system restart?
Only workaround I have so far is Windows in VM to do USB copying.
Any help would be appreciated.