dd
Linux DD
The basic command structure is as follows:
dd if=<source> of=<target> bs=<byte size> skip= seek= conv=<conversion>
"bs" should "USUALLY" some power of 2, and usually not less than 512 bytes ie, 512, 1024, 2048, 4096, 8192, 16384) but can be any reasonable whole integer value.
Source is the data being read. Target is where the data gets written.
Warning!! If you reverse the source and target, you can wipe out a lot of data. This feature has inspired the nickname "dd" Data Destroyer. Warning!! Caution should be observed when using dd to duplicate encrypted partitions.Examples: duplicate one hard disk partition to another hard disk partition:
Sda2 and sdb2 are partitions. You want to duplicate sda2 to sdb2.
dd if=/dev/sda2 of=/dev/sdb2 bs=4096 conv=notrunc,noerror
If sdb2 doesn't exist, dd will start at the beginning of the disk, and create it.
Be careful with order of if and of. You can write a blank disk to a good disk if you get confused.
If you duplicate a smaller partition to a larger one, using dd, the larger one will now be formatted the same as the smaller one. And there will be no space left on the drive.