Feb 17
2022
Clone whole disk with linux
Clone entire disk to file
dd if=/dev/sda conv=sync,noerror,notrunc bs=16M status=progress | gzip /path/to_image
Restore disk from file
gunzip -c /path/to_image | dd of=/dev/sdc bs=16M status=progress
Copy MBR (identical discs)
dd if=/dev/sda of=/dev/sdb bs=512 count=1
Copy MBR (different disc’s sizes)
dd if=/dev/sda of=/tmp/mbr.img bs=512 count=1
dd if=/tmp/mbr.img of=/dev/sdb bs=446 count=1
The above commands will preserve the partitioning schema.