sudo -s
cd ~
hdiutil create <DiskImageFilename> -type SPARSE
-size 256g -fs HFS+ -volname "Macintosh HD Image"
open <DiskImageFilename>
ditto -rsrcFork /Volumes/<SourceVolumeName> /Volumes/Macintosh\
HD\ Image
hdiutil convert -format UDZO <pathtoimage> -o <ReadOnlyImageFilePath>
asr -imagescan <ReadOnlyImageFilePath>
chmod 644 /path/to/<ReadOnlyImageFilePath>
mv /path/to/<ReadOnlyImageFilePath> /path/to/RestoreImages