When trying to convert or resize a dmg image I get the error:
hdiutil: convert failed Resource Temporarily Unavailable error
hdiutil: resize: failed. Resource temporarily unavailable (35).
(hdiutil error code 35).
Ask Different is a question and answer site for power users of Apple hardware and software. It only takes a minute to sign up.Sign up to join this community
If you are accessing a disk image over a network then it's possible to have various operations interrupted if you encounter any kind of network issue, which can result in the image becoming "temporarily unavailable" when you try to resume whatever you were doing.
This happens because only a single system can have a disk image mounted at once, otherwise corruption could/will occur, but the locking mechanism for preventing double-access can end up being left in an inconsistent state, so even if you only have a single system accessing an image, you can end up with this error, as
hdiutil thinks the image is already open on another system.
As others have pointed out, a restart can resolve this; I'm not actually sure why, as I'm not clear on how
hdiutil/macOS marks an image as in-use. For a sparse bundle this has something to do with the
token file, and there's a handy workaround if you don't want to have to restart.
NOTE: You must be absolutely certain that yours is the only system accessing this disk image, fiddling with the
token file while an image is already mounted could destroy your image completely! Always have backups wherever possible, and be very careful at all times.
cd(with trailing space) then drag your sparse bundle file onto the Terminal window, hit enter)
chown 'user:group' token, with the correct user/group, it should match the user:group of the
Info.plistfile in the same folder.
After copying the token in this way, you should now be able to use
hdiutil attach /path/to/image as normal to attach and mount the image.
NOTE: Be very careful using this method; I move the original out of the way rather than discarding it, so that it is always possible to recover it if anything goes wrong.