APFS DMG Check?

musat
Contributor III

Hello,
Is there a way to check whether a DMG has been saved as a APFS image rather than HFS+? We mostly export PKG files from Composer, but sometimes someone here creates a DMG. We ran into the issue today where a DMG wouldn't install on any of our El Cap MacBooks because it was saved in APFS format. I went in and remade it (as a PKG since it didn't need to be a DMG) but now am hoping to have some sort of script to scan through our distribution site to see if there are any other APFS DMG files out there. Is this possible?
Tim

1 ACCEPTED SOLUTION

mm2270
Legendary Contributor III
hdiutil fsid /full/path/to/image.dmg | egrep "HFS|APFS"

You could also drop the egrep and just get the full output and visually scan it. Usually one of the partitions will show something like HFS+ or APFS to indicate which format it's in. For example, you might see a section like this:

Analyzing partition 5: disk image Apple_HFS
HFS+

The fsid flag shows a lot of information in the output, most of which won't make much sense, but it should help you figure out which ones might need to be rebuilt.

View solution in original post

2 REPLIES 2

mm2270
Legendary Contributor III
hdiutil fsid /full/path/to/image.dmg | egrep "HFS|APFS"

You could also drop the egrep and just get the full output and visually scan it. Usually one of the partitions will show something like HFS+ or APFS to indicate which format it's in. For example, you might see a section like this:

Analyzing partition 5: disk image Apple_HFS
HFS+

The fsid flag shows a lot of information in the output, most of which won't make much sense, but it should help you figure out which ones might need to be rebuilt.

musat
Contributor III

Thanks @mm2270 , using that I was able to scan the recent DMGs in the folder to determine that this was the only one.