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”,