I just bought a ssd to change with current hdd. So, I decided to copy whole 750 gb partiton (of course used part of it which is approximetly 76 GBs) using dd utility. However, I entered this command: sudo dd if=/dev/sda5 of=/dev/sdb1(since partition I mentioned was defined as sda5...) I was expecting it to copy these 76 GBs fully, but it finished copying that part; Moreover, is's still maintains copying other 674 GBs null:) I cannot be considered as an expert using linux or dd command because I'm a a newbie, bet I wasn't expecting this result. When I enter sudo pkill -USR1 -n -x dd command, It says: 505029097+0 records in505029096+0 records out258574897152 bytes (259 GB) copied, 39871,3 s, 6,5 MB/sSo, if somebody can explain this situation to me, I would be really satisfied. Thanks already...
dd Utillity Copied More Than Expected
linux;hard disk;dd;ssd;external hdd
If you don't specify the bs and count options, dd will copy the whole partition /dev/sda5. This is because dd is a very low level tool and it has no means of distinguishing between files and empty space. So, to copy only the full part of the partition, dd isn't the tool you need because even you specify the size, there is no reason the actual data should be at the start of the available space.If you want to copy the used data only, you should resize the partition /dev/sda5. start by resizing the 750 partition to a another partition of slightly above 76GB which is almost full. To resize the partition, you can use the gparted or fdisk command. After resizing, you can use dd in the standard way on the new partition.You can also compress the partition /dev/sda5 by running it through gzip. after that you can copy the copressed image using dd as follow dd if=/dev/sda5 | gzip > sda5.gzthen dd if=sda5.gz | gunzip > /dev/sdb1 