Cannot restore an APFS disk image with asr
I'm working within the Recovery Environment, using High Sierra 10.13.0 (public release).
I have made a disk image from an APFS container like this, just as described in the hdiutil man page:
hdiutil create -srcdevice disk2 -format UDZO /Volumes/external-disk/my-image
(disk2 is the /dev node of the APFS container holding all the volumes on this Mac).
And I have also tried like this:
hdiutil create -srcfolder '/Volumes/Macintosh HD' -volname 'Macintosh HD' /Volumes/external-disk/my-image
I then imagescan the "my-image" with
asr imagescan --source /Volumes/external-disk/my-image.dmg
If I made the disk image of the APFS container (ie. "-srcdevice disk2" above), an "asr info" outputs some useful information about the volumes in the container. According to asr's man page, that's what I should be doing.
According to the man page for asr, I should restore the image with
asr restore --source /Volumes/external-disk/my-image.dmg --target '/Volumes/Macintosh HD' --erase
but that always fails as soon as it tries to validate the source, saying the image "doesn't have any appropriate volumes to restore".
If I make the image with the "-srcfolder" option instead, as above, then it restores the blocks into a new file inside /Volumes/Macintosh HD as expected, but then fails with "APFS inverter failed to invert the volume - Invalid argument".
From everything I've read in the man page for asr about using it with APFS, one of these combinations should work.
But neither of them do.
And there is no other documentation available at all, if you ignore the "feature list" document.
Can anyone help, please?
macOS High Sierra (10.13), asr hdiutil disk images