Trying to clone a hdd using the dd command and I need some assistance
I am trying to clone my internal hdd to a usb hdd using dd and I cannot figure out how to do it. I have looked at the man pages, but they seem somewhat cryptic to me. Any help would be highly appreciated.
Here are the details of my hdds:
The hdd to be cloned: [/dev/sda]
500.1 GB 500107862016 bytes
total 976773168 sectors
The hdd I'm cloning to: [/dev/sdb]
80.0 GB 80026361856
total 156301488 sectors
I understand that I cannot copy the entire 500 GB to the 80 GB drive, but the data contained on the 500 GB drive is well under the 80 GB available on the drive to be cloned to. I have zeroed out the free space on the 500 GB drive so that it will not copy the free space. This should allow only the data to be copied to the 80 GB drive.
The command used to zero out the free space is this:
Now I simply need to know the exact syntax for use of the dd command as related to these hdds and any additional information you may have. I also need to know if I will need to resize my partitions on the destination drive once the cloning is complete. All information will be appreciated, thanks in advance.
dd if=/dev/zero of=0bits bs=20M; rm 0bits