Disk Cloning: Difference between revisions
No edit summary |
No edit summary |
||
Line 12: | Line 12: | ||
< | == Check the drive == | ||
== Prepare the drive == | |||
== Clone the drive == | |||
<syntaxhightlight> | |||
dd if=/dev/sdb of=/dev/sda bs=8096 count=100 conv=sync,noerror status=progress | dd if=/dev/sdb of=/dev/sda bs=8096 count=100 conv=sync,noerror status=progress | ||
</syntaxhighlight> | </syntaxhighlight> | ||
== Make final adjustments == | |||
Revision as of 17:23, 15 January 2020
This is a tutorial on how to clone a hard drive.
Tools needed: Linux operating system or Bootable USB linux drive (such as SystemResuceCD)
1. Check the drive
2. Prepare the drive
3. Clone the drive.
4. Make final adjustments.
Check the drive
Prepare the drive
Clone the drive
<syntaxhightlight> dd if=/dev/sdb of=/dev/sda bs=8096 count=100 conv=sync,noerror status=progress </syntaxhighlight>
Make final adjustments
To clone a drive, I use dd that is usually with any linux distro.
if = input device
of = output device
bs = blocksize
count = number of sectors to be copied
conv = additional options sync = keeps LBA synced if unable to read (will fill with zeros on target drive for sector it was unable to read) noerror = will not stop on error
status = progress, shows how much data as been copied so far.
Tips----
When cloning a disk to a smaller device, such as from a HDD to SDD. You will need to fix up the GPT. First make sure partitions you want to move are smaller than target drive by shrinking the partitions. Then clone the drive enough so it keeps all data but might leave other partitions outside of disk boundaries. This is usually fine. If you want to keep all partitions, you will have to move the ones at the end closer to start of disk. This will also require those partitions to be moved to the end of the disk after the clone so you can expand the main partition.
Use gdisk /dev/sdX (X = drive letter in linux) Then P (for print) to print all partitions d follow partition number to delete any partitions that you don't want to keep that may be outside of the partition boundaries. v to verify partitions after all work as been done w to write changes to disk. This will fix the GPT primary table and backup table (at end of disk). This will work with Windows installs as well and should boot right into original OS unless bad sectors were hit.