Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Random failure with "hdiutil create"

Hi everyone

I'm working on a Shell script supposed to build disk image files with hdiutil. The problem is that it randomly fails. Here is the output :
+hdiutil: create failed - erreur 49168+

That's all I get when using
+hdiutil create -format UDBZ -volname "SFML-1.6-dev-macosx" -srcfolder "/Users/me/sfml/trunk/dist/SFML-1.5-dev-macosx" "$/Users/me/sfml/trunk/dist/SFML-1.6-dev-macosx.dmg" > /dev/null+

When dropping "> /dev/null" and adding -debug, I noticed these lines before the end :
+2009-07-24 18:31:40.620 diskimages-helper\[25526:1603] deleting /Users/lucas/sfml/trunk/dist/SFML-1.6-dev-macosx.dmg+
+2009-07-24 18:31:40.620 diskimages-helper\[25526:1603] DIHelperNBI performOperation: returning 49168+
[...]
+DIHLDiskImageCreate() returned 49168+
+2009-07-24 18:31:40.842 diskimages-helper\[25526:10b] DIHelper dealloc.+
+2009-07-24 18:31:40.843 diskimages-helper\[25526:10b] -DIHelperAgentMaster terminateUIAgentConnection.+
+hdiutil: create failed - erreur 49168+

I don't understand why it would try to delete the dmg file I'm trying to make...
Here is the full log is you want to have look at it : http://pagesperso-orange.fr/c.sobecki/ceylo/data/hdiutil-failure-log.txt

All I was able to find on this error is here : http://lists.apple.com/archives/Carbon-dev/2007/Aug/msg00357.html

Where it says :
+1) Some of the files you're trying to archive are being used exclusively by another process. A couple of people figured that their Anti-Virus software (Norton AV) was to blame.+

+2) Disk space is low, and the hdiutil tool cannot perform its internal caching.+

+3) A file system error which is not detected by Disk Utility prevents proper accessing some crucial files. Repairing the disk using "Disk Warrior" did help.+

+4) Files which were put into the trash can but were not deleted yet cause problems when tried to being put into the disk image.+

1) I'm not using an antivirus
2) I've about 70 GB remaining
3) But why would it be random ? It's always the same files that are being packed.
4) I've no file in my trash.

Does anyone have an idea why it fails ?

Thanks
Ceylo

MacBook, Mac OS X (10.5.7)

Posted on Jul 24, 2009 11:24 AM

Reply
6 replies

Jul 24, 2009 11:35 AM in response to Ceylo

Ceylo wrote:
Hi everyone

I'm working on a Shell script supposed to build disk image files with hdiutil. The problem is that it randomly fails. Here is the output :
+hdiutil: create failed - erreur 49168+


Where it says :
+1) Some of the files you're trying to archive are being used exclusively by another process. A couple of people figured that their Anti-Virus software (Norton AV) was to blame.+
1) I'm not using an antivirus

That's not the only reason, it's just one example. If the file is locked because it's being used by another process, that might explain the randomness of what is happening.
Try running
lsof
and seeing if any of the files in question are open.

Jul 24, 2009 11:50 AM in response to nerowolfe

Here is what I get :

lsof | grep .dmg
diskimage 7044 lucas 4u REG 14,2 23642526 5516332 /Users/lucas/.Trash/dist/SFML-1.6-sdk-macosx.dmg
diskimage 7901 lucas 4u REG 14,2 14399634 5519678 /Users/lucas/sfml/trunk/dist/SFML-1.6-dev-macosx.dmg
diskimage 19567 lucas 4u REG 14,2 13590033 5537493 /Users/lucas/sfml/trunk/dist/SFML-1.6-sdk-macosx/dist/SFML-1.6-sdk-macosx.dmg
diskimage 24398 lucas 4u REG 14,2 4450329 5543896 /Users/lucas/.Trash/dist/SFML-1.6-c-sdk-macosx.dmg
diskimage 24676 lucas 4u REG 14,2 4333930 5546231 /Users/lucas/.Trash/dist/SFML-1.6-c-sdk-macosx.dmg


I don't understand why these files are still opened... and why there are not shown in my trash. How can I fix this ?

Jul 24, 2009 12:04 PM in response to Ceylo

Well I think you have found the problem, or perhaps a new one? 🙂
Somehow the images are in the trash but hidden. I don't know why you are not getting a warning or error message when you empty the trash.

I suggest going into the .Trash directory directly using terminal and either deleting the directory dist which seem to hold the files, or IMO, it's better to move that folder onto your desktop for further examination, since it might happen again.

Once you are in .Trashes, first enter
ls -al
just to confirm that the directory is there.
Then use something like
sudo mv dist ~/desktop
and see if that works.

Jul 24, 2009 12:25 PM in response to nerowolfe

ls -lA ~/.Trash

gives absolutely nothing...
and yet I still get the same output with "lsof | grep .dmg" 😟

Edit: hum no.. not exactly the same thing, after having moved .Trash to Trash and unhidden it, lsof tells me the opened file is in ~/Trash not in ~/.Trash anymore, so it noticed my move.

Message was edited by: Ceylo

Random failure with "hdiutil create"

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.