How do you create and restore a backup image of an entire physical hard drive?

toolazytosearchitmyself

Well-Known Member
OP
Member
Joined
Nov 24, 2022
Messages
119
Trophies
0
Age
54
XP
424
Country
Australia
I want to reformat my PC and make a full backup of the hard drive beforehand in case something goes wrong. I know how to make backups of a single partition by installing Linux onto a bootable USB then using Disks. What I want to know is how to make a 1:1 backup of the entire physical drive, including all partitions on it.
 

KleinesSinchen

GBAtemp's Backup Reminder + Fearless Testing Sina
Member
GBAtemp Patron
Joined
Mar 28, 2018
Messages
4,433
Trophies
2
XP
14,884
Country
Germany
I want to reformat my PC and make a full backup of the hard drive beforehand in case something goes wrong. I know how to make backups of a single partition by installing Linux onto a bootable USB then using Disks. What I want to know is how to make a 1:1 backup of the entire physical drive, including all partitions on it.
That would require an awesome lot of space (and time) if it is a big HDD/SSD. But here you go:

dd if=/dev/sda of=/path/to/Backup_HDD/backup.img bs=32M status=progress

Where you have to make sure to choose the correct HDD (sda, sdb…) and a sensible path to your mounted backup device.
:!: Be careful with the dd command. It will overwrite things without any warning if you provide the wrong options/parameters :!:
 

toolazytosearchitmyself

Well-Known Member
OP
Member
Joined
Nov 24, 2022
Messages
119
Trophies
0
Age
54
XP
424
Country
Australia
The internal hard drive I want to copy is 512GB. The external hard drive I want to hold the image is 1TB. The external hard drive is in NTFS format.

Can I confirm whether the image copied correctly using these commands?
sha256sum /dev/sda
sha256sum /path/to/backup.img
 

KleinesSinchen

GBAtemp's Backup Reminder + Fearless Testing Sina
Member
GBAtemp Patron
Joined
Mar 28, 2018
Messages
4,433
Trophies
2
XP
14,884
Country
Germany
The internal hard drive I want to copy is 512GB. The external hard drive I want to hold the image is 1TB. The external hard drive is in NTFS format.

Can I confirm whether the image copied correctly using these commands?
sha256sum /dev/sda
sha256sum /path/to/backup.img
Should be possible to check that way, but the internal SSD/HDD must not have been mounted at all between backup and checksum.
Note that Linux access to NTFS partitions might get slow on huge files. Modern computers should handle it though.
 

Sypherone

Gaming Ninja
Member
GBAtemp Patron
Joined
Apr 28, 2019
Messages
1,655
Trophies
2
Age
44
XP
2,819
Country
Germany
The question is why do want to reformat the system. If you will set it up as clean system OK. But if you will keep the same data on it, you dont get a benefit if its ntfs. NTFS is a journaling filesystem with self repair and optimize features. E.g. if errors occur, the data will automatically restored and if a sector is corrupted it will automatically restore the data by replacing the sector with a spare sector. Thats why Windows run that stable, because of this benefit of ntfs. And it doesnt even need to run tools like chkdsk on it, as it does this checks by it self. For example Fat32/exfat doesnt provide such feature.
 
Last edited by Sypherone,
  • Like
Reactions: KleinesSinchen

KleinesSinchen

GBAtemp's Backup Reminder + Fearless Testing Sina
Member
GBAtemp Patron
Joined
Mar 28, 2018
Messages
4,433
Trophies
2
XP
14,884
Country
Germany
The question is why do want to reformat the system. If you will set it up as clean system OK. But if you will keep the same data on it, you dont get a benefit if its ntfs. NTFS is a journaling filesystem with self repair and optimize features. E.g. if errors occur, the data will automatically restored and if a sector is corrupted it will automatically restore the data by replacing the sector with a spare sector. Thats why Windows run that stable, because of this benefit of ntfs. And it doesnt even need to run tools like chkdsk on it, as it does this checks by it self. For example Fat32/exfat doesnt provide such feature.
I see it more as a foolproof safety net: Before upgrading Linux distribution on the main computer, I use dd to mirror the SSD.
I could rely on the snapshot function of btrfs to undo possible damage. Of course one could simply clone a Linux with copying certain folders into a .tar.gz file and restore it on a different machine, writing GRUB manually… It is a major headache to set this up.

The brutal dd method with a temporary full backup (no need to store this after the upgrade went fine) is guaranteed to restore the status from before with a single command.
 

Sypherone

Gaming Ninja
Member
GBAtemp Patron
Joined
Apr 28, 2019
Messages
1,655
Trophies
2
Age
44
XP
2,819
Country
Germany
On Linux especially if your running a raspberry Pi as homeserver with a lot customization, i recommend it.

But on Windows thats since Win10 is nearly bullet proofd. I tend more to seperate the user data on one partition from Windows and the Applications on the primary partition. In this case its also easyer to backup the drive/partition as Windows would be reinstalled the applications need it too. And the user data is safe anyway. Apart from this that Microsoft offers tools to extract the user profil and its data to move it to another installation.
 

Harry579Clark

Member
Newcomer
Joined
Dec 13, 2022
Messages
10
Trophies
0
Age
27
XP
23
Country
United States
Backing up and restoring the physical hard drive of your computer may seem daunting, but it can be accomplished by following a few simple steps. To create a backup image, you will need an external storage device such as an external hard drive, USB drive, or cloud storage. Next, you’ll need to select an imaging software program like Acronis True Image and use it to clone your entire hard drive onto the external source. Once that is complete, your data has successfully been backed up. For the restore process, plug in the external source containing the backup image into your computer and use the same imaging software that you used for creating the backup. Simply select “Restore” and follow any prompts on the screen to finish restoring the backup data onto your physical hard drive. Done!
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
    Psionic Roshambo @ Psionic Roshambo: https://www.youtube.com/watch?v=A0FyqCEfD0E