Use diskutil list
to figure out which disk number the SD card is mounted as. Then:
sudo dd if=/dev/rdisk2 bs=1m | gzip > image.img.gz
Basically the reverse of the above. Make sure you decompress the gzip first if it's compressed. Use diskutil list
to figure out which disk number the SD card is mounted as. Then:
cd path/to/image
diskutil unmountDisk /dev/disk2
sudo dd if=image.img of=/dev/rdisk2 bs=1m
Turn off output so that a connected display will go into sleep:
tvservice -o
Turn on output:
tvservice -p