
- #Mac cannot mount disk for repair how to
- #Mac cannot mount disk for repair mac os x
- #Mac cannot mount disk for repair free
Be sure to seek to the position where you found the string, minus 4088. If you find it, try to copy that block back to a file (best on another device, to avoid overwriting it). dev/disk0s3), searching for one of those strings (presumably "cdsaencr", as version 1 headers are the ones that break more often). To do this, the best thing is to write a script in perl, php, or a program in C, which reads your hard drive partition device (the one containing the broken image, e.g.

#Mac cannot mount disk for repair free
If you have no backup image from which to restore the header, there is some chance to find these on the free space of your hard disk.
#Mac cannot mount disk for repair how to
How to possibly find a lost image header (if you have no backup)Īs You can see from the above, both headers have a string to recognize them: version 1 headers END with the string "cdsaencr", while version 2 headers BEGIN with the string "encrcdsa". If you have a version 1 header (bad! risky!), the latter line will output 1. If You still have an old backup of the broken image, you can try the following, (on a copy of the broken image of course): user% dd if=WorkingBackup.sparseimage bs=1 skip=`ls -al WorkingBackup.sparseimage | awk ''` 2>/dev/null | grep -c cdsaencr Step-by-step description of what I did (given an older backup) The filesystem was broken, but with the help of Disk Warrior 4 I was able to rebuild the filesystem (fsck was not enough in this case). I used the tool referenced as vfdecrypt below to decrypt it first into an unencrypted sparse image, but that should not be usually necessary, hdiutil should attach the image device if it finds a valid header. I copied the last 4kb of the old image to the end of the broken one, and then I was able to attach the device. So my advice is: If you have older encrypted sparse images, make new ones immediately and copy the files onto them!įortunately, I had an old copy of that same, corrupt image, from which I could recover the lost header. But this actually happens only for new images.
#Mac cannot mount disk for repair mac os x
The new format (version 2) introduced with Mac OS X 10.4.7 stores the header at the BEGINNING of the image, which is a much safer idea. If the computer freezes, or you have a power interruption, mac os x fails to write this down and you lose the most importan piece of information. With version 1 of the header, at every sync, it has to be attached at the end of the file. Last but NOT least, Apple has (by now) 2 formats for the header and 2 places for them: the old one, version 1, (concerning my case and all FileVault/encrypted images created before Mac OS X 10.4.7), was stored at the END of the image. Without this header, you're basically LOST. The Key, the salt, the information needed for the iv and other info are stored into the image header, a 4kb block, which is in turn encrypted using 3DES-EDE. This function generates the 128-bit key needed using your passphrase, a salt, and a certain number of iterations. Your passphrase gets thru a method called pbkdf2. Why? Because AES encryption is not just your passphrase molded into your data. Just because a little bit is gone all my data gone?! Without even the possibility to repair it somehow!? It was then clear that some sort of header was broken. WARNING flushing header and index nodes failed.DIResolveBackingStoreToDiskImage: unable to resolve to any disk image class. Using the -debug option in hdiutil showed some more (taken the most informative lines): user% hdiutil attach -nomount -noverify -noautofsck -stdinpass -debug MyImage.sparseimage. Trying to mount the image (by finder or hdiutil) yielded.: user% hdiutil attach -nomount -noverify -noautofsck -stdinpass MyImage.sparseimage hdiutil: attach failed - corrupt image I only had an older backup (I should have had a newer one, I know.) Version 1.3, April 2007 General considerationsĪn important, encrypted sparse image (like file vault), got corrupted after a system freeze.


Recover a corrupt AES-128 encrypted sparse image (using an older backup - without it, you're almost lost) I've copied and pasted the original posters hint here so that it is preserved in this sites archive. I'm not a fan of having the entire hint posted at a site that may or may not exist in the future.
