dd harddisk to iso img

backup to image

dd if=/dev/sdb2 of=partition.image bs=4096 conv=noerror

Restores a hard disk drive (or an SD card, for example) from a previously created image.

dd if=partition.image of=/dev/sdb2 bs=4096 conv=noerror