How do I restore an image of a hard disk created by the dd program?

The HDD image was created using the command

dd if=/dev/sda conv=sync,noerror bs=512K | gzip -c | dd bs=512K of=hdd.img.gz

I try to restore with the command

gzip -cd hdd.img.gz | dd bs=512 of=/dev/sda

At the very end of the execution, it outputs an error that the last record cannot fit on the device due to the fact that the size of the disk image is 1 record larger than the size of the device that is being restored. When using bs=512, it seems that this can be ignored, but the partitions on the hard disk do not appear, although the image is a copy of the entire device, by default the idea of including the MBR. I don't understand how to restore a backup?

Author: MIKS, 2018-04-17

1 answers

The solution turned out to be banal: Repeat the command again, and everything was restored without errors

 0
Author: MIKS, 2018-04-18 11:56:08