Skip to content

Instantly share code, notes, and snippets.

@zeburek
Created November 18, 2019 06:26
Show Gist options
  • Save zeburek/55a9d13ca6803c0773bcd9330681a30d to your computer and use it in GitHub Desktop.
Save zeburek/55a9d13ca6803c0773bcd9330681a30d to your computer and use it in GitHub Desktop.

Backup Drive MBR & Partition Table:

In terminal type dd if=/dev/sda of=/media/location/backup.img bs=512 count=1.

Restore Drive MBR:

In terminal type dd if=/media/location/backup.img of=/dev/sda bs=446 count=1.

Backup Partition MBR & Partition Table:

In terminal type dd if=/dev/sda1 of=/media/location/backup.img bs=512 count=1.

Restore Partition MBR:

In terminal type dd if=/media/location/backup.img of=/dev/sda1 bs=446 count=1.

Backup An ESP:

In terminal type dd if=/dev/sda1 of=/media/location/backup.img.

[This process is exactly the same as cloning any other partition.]

Restore An ESP:

In terminal type dd if=/media/location/backup.img of=/dev/sda1.

Backup A Partition:

In terminal type dd if=/dev/sda1 of=/media/location/backup.img.

Restore A Partition:

In terminal type dd if=/media/location/backup.img of=/dev/sda1.

[RECOMMENDED ACTION] Backup A Drive:

In terminal type dd if=/dev/sda of=/media/location/backup.img.

[RECOMMENDED ACTION] Restore A Drive:

In terminal type dd if=/media/location/backup.img of=/dev/sda.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment