Hi there,
It’s possibly a bit heavyweight for what you’re wanting to do, but CloneZilla allows you to boot a device with it, then creates a disk image for a given device (such as an SSD, etc). This should work (though I’ve not tried it) for example on any balenaOS device that allows booting from USB/SD for the x64 architecture (you’d have to rebuild it for any other, I’m not sure if alternative arch packages exist), as well.
Hope this helps!
Best regards,
Heds