Convert a plain disk “legacy image” so that it can be mounted

apfsdisk-utilitydmgmount

I have a plain disk image, created from using dd. When I try to mount it in Sierra (10.12.6), DiskImageMounter.app tells me:

legacy image should be converted

enter image description here

How do I perform such a conversion?

I tried hdiutil but had no success:

$ hdiutil convert -format UDCO -o output.img input.dimg 
hdiutil: convert failed - image not recognized

The trouble may come from the fact that this image contains the contents of the APFS container partition, so DU may not recognize it as any known format. Still, it should allow me to convert it into a plain disk image so that I can at least attach it, even if it won't mount.

Alternatively, how can I attempt to attach a plain disk image with some other command (not hdiutil) so that I could then use Disk Utility to make a new image from it? I mean the way I can use the loopback interface on Linux, for instance.

Note: The original Disk Utility (pre-10.11) was apparently still able to convert such an image, but the new one isn't.

Best Answer

This worked on High Sierra. This is from an ancient DC42 image format from a 512Ke system disk.

Todds-MBP-7:$ hdiutil convert Utilities1.image -format UDRO -o Converted
Preparing imaging engine…
Reading whole disk (Apple_HFS : 0)
.........................................................
(CRC32 $7335686D: whole disk (Apple_HFS : 0))
Adding resources
Elapsed Time:   2.822ms
File size: 729282 bytes, Checksum: CRC32 $E4490B5F
Sectors processed: 1600, 1417 copied
Speed: 245.2Mbytes/sec
Savings: 11.0%
created: /Users/WFN32919/Downloads/converted.dmg