How to clone a drive using dd command on terminal

Make full hard disk copy

sudo dd if=/dev/hdx of=/dev/hdy
sudo dd if=/dev/hdx of=/path/to/image.img
sudo dd if=/dev/hdx | gzip > /path/to/image.gz

Restore Backup of hard disk copy

sud dd if=/path/to/image of=/dev/hdx

To see the progress of dd without killing

sudo kill -USR1 $(pgrep ^dd)

 

MBR backup

sudo dd if=/dev/hdx of=/path/to/image count=1 bs=512

MBR restore

sudo dd if=/path/to/image of=/dev/hdx

Leave a Reply

Your email address will not be published. Required fields are marked *

Scroll to top