Clone drive using DD
Clone a drive using dd in Linux
In Terminal identify source and target drives:
sudo fdisk -l
Note the devices (e.g., /dev/sda, /dev/sdb).
Run DD to clone the drive:
sudo dd if=/dev/source of=/dev/target bs=1M status=progress conv=noerror,sync
Replace /dev/source and /dev/target with the correct device names, e.g./dev/sda, /dev/sdb
Wait for completion and sync data to force all pending writes in memory to be flushed to disk
sudo sync
Note optional arguments to clone a defective drive for recovery:
- conv=noerror: continues copying after read errors instead of stopping
- sync: Pads missing data with null bytes to maintain alignment
- dd stands for “data definition”, an allusion to the DD (Data Definition) statement in IBM’s Job Control Language (JCL), from which it was inspired. While commonly interpreted as “data duplicator” or “disk destroyer” due to its use in copying and potential for data loss, the original name reflects its historical roots in Unix’s early design