Skip to content

Instantly share code, notes, and snippets.

@dtomasi
Last active May 13, 2020 18:31
Show Gist options
  • Save dtomasi/d3f4619fa9ded9893e67 to your computer and use it in GitHub Desktop.
Save dtomasi/d3f4619fa9ded9893e67 to your computer and use it in GitHub Desktop.
Backup and Restore HDD Linux
## Create disk image
##
## 1. Boot from a liveCD or liveUSB.
## 2. Make sure no partitions are mounted from the source hard drive.
## 3. Mount the external HD
## 4. Backup the drive.
dd if=/dev/hda conv=sync,noerror bs=64K | gzip -c > /mnt/sda1/hda.img.gz
## Restore the Disk
gunzip -c /mnt/sda1/hda.img.gz | dd of=/dev/hda
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment