Sample Header Ad - 728x90

hdiutil image still busy after unmout

3 votes
0 answers
1896 views
I'm using hdiutil managing disk images. I mount the images with the following command: $ hdiutil mount test.dmg And I unmount them like this: $ umount /Volume/device_name It works fine, the device gets unmounted. However, $ hdiutil info still shows the unmounted images.
framework       : 621
driver          : 621
images          : 3
================================================
image-path      : /private/tmp/test.dmg
shadow-path     : 
icon-path       : /System/Library/PrivateFrameworks/DiskImages.framework/Resources/CDiskImage.icns
image-type      : read/write
system-image    : false
blockcount      : 61440
blocksize       : 512
writeable       : TRUE
autodiskmount   : TRUE
removable       : TRUE
image-encrypted : TRUE
mounting user   : UserName
mounting mode   : -rwx------ 
process ID      : 37029
framework name  : DiskImages
/dev/disk3	GUID_partition_scheme	
/dev/disk3s1	7C3457EF-0000-1100-AA11-00306543ECAC	
/dev/disk4	EF57347C-0000-11AA-AA11-23406543ECAC	
/dev/disk4s1	41504653-0000-11AA-AA11-00306543ECAC
And, df also shows these devices:
$ df -h
Filesystem       Size   Used  Avail Capacity iused      ifree %iused  Mounted on
/dev/disk1s5s1  466Gi   15Gi  156Gi     9%  577263 1640990560    0%   /
devfs           391Ki  391Ki    0Bi   100%    1352          0  100%   /dev
/dev/disk1s4    466Gi  5.0Gi  156Gi     4%       7 1640990560    0%   /System/Volumes/VM
map auto_home     0Bi    0Bi    0Bi   100%       0          0  100%   /System/Volumes/Data/home
/dev/disk7s1    500Mi   24Ki  498Mi     1%       2    5102120    0%   /Volumes/untitled
In this, /dev/disk1s4 is the test.dmg image. When I try to detach it with hdutil detach, it's saying that the resource is busy.
$ hdiutil detach -force /dev/disk1s4
hdiutil: couldn't unmount "disk1" - Resource busy
$ hdiutil detach /dev/disk1s4
hdiutil: couldn't unmount "disk1" - Resource busy
Is there a way I can completely detach these devices such that hdutil info doesn't list these devices?
Asked by sammy (31 rep)
Jan 19, 2022, 09:13 AM