Disk Cloning

From Game Research Wiki
Revision as of 18:17, 12 September 2019 by Orin (talk | contribs)
Jump to navigation Jump to search
dd if=/dev/sdb of=/dev/sda bs=8096 count=100 conv=sync,noerror status=progress


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.