Wilmer2k wrote:
So today I've done some proof of concept on the issue, just to check that my method of creating a dmg of this pictures library actually works. I took my macbook, now formatted on apfs since the reinstall, and entered recovery mode, made an image of a folder and selected the photos library. The whole process looked exactly the same like it did the first time. Takes ages and finishes off by "freezing" with an empty bar until suddenly it marks it with a green check mark. This dmg mounted and opened just like expected once I came back into macos and inserted the usb drive it was created on.
from original post:
saved onto a 32gb stick
USB sticks are not good choices for storing data. Many of them even from a reputable vendor are just junk. I've run data integrity checks on various USB sticks and almost all of them invariably flip a bit once in a while.
FYI, when creating an archive always make sure you can open it after it has been created.
This I guess raises a couple questions;
Could storing these dmgs on a windows based PC make for corrupt dmgs? They were merely moved and stored using the MacDrive application.
No, storing a file on another OS won't damage it. Now if the drive on the other computer has issues, then that is another thing. Most likely your original USB stick is to blame for the corruption of the .dmg file.
Were the dmgs to be corrupt, damaged or otherwise broken, is there a way one can tell what happened and resolve it?
The idea of splitting the dmg into segments, could this make parts of it openable? Make a copy and try?
Don't try anything on the original .dmg. Make a copy and work from the copy instead.
You might want to try converting the .dmg file to a straight uncompressed raw image file. You may be able to do this the Terminal command line utility "hdiutil", but an even better way would be to use the Linux "dmg2img" utility to uncompress the archive into a plain raw image file. I don't use Windows so I'm not sure if there is any third party utility to do the same using Windows. You may be able to install "dmg2img" on macOS using HomeBrew. Sometimes using a utility from another OS makes all the difference in the world.
I know it is possible for Linux to repair the file system on raw image files, but I don't know if Disk Utility can do the same or not. You would probably need to use "hdiutil" to create an access point from which to work. I'm not familiar enough with "hdiutil" to provide instructions or examples. It would be best to work from an uncompressed image file. See if you can get the "hdiutil" utility to "mount" or rather "open" the image file. It isn't really mounted yet. Consider it more like opening the .dmg image archive to peek inside a bit. It is hard to explain. I've never really done this with macOS, although I have done it a few times using Linux. If you can "open" the image file with "hdiutil", then perhaps you can use a data recovery program such as Data Rescue to extract the contents.
If the .dmg file used the HFS+ file system, then it may be possible to fix it, but unfortunately if it was created with APFS, then you are out of luck since there are no third party utilities available to repair APFS since Apple has not released the necessary documentation.
I was successfully able to use the command line tool "testdisk" to access data from a cloned drive with a corrupted file system (it used HFS+). Testdisk can work on .dmg raw image files as well as unmounted drives/partitions (with HFS+ file system).
You may want to consider contacting a professional data recovery service such as Drive Savers or Ontrack. Both vendors provide free estimates and are recommended by Apple and other OEMs.
Always work from a copy so you don't damage the original file or drive.