dd to back up a HDD to file. Too big!
I am using dd to back up my 80gb harddisk, and I want the resulting image to be <700MB. I know that sounds unreasonable however my partition sizes are:
/dev/hda1 118MB Used:2.2MB /boot
/dev/hda2 3.8GB Used:335MB /
/dev/hda3 71GB Used:672K /mediafiles
I realise that dd copies warts and all (including unusued blocks) so I used the following to zero out all usued blocks:
dd if=/dev/zero of=/deleteme bs=8M
Then I mounted to the server and dd'ed my drive to it and passing it through heavy bzip2 compression as:
dd if=/dev/hda bs=1k conv=sync,noerror | bzip2 -9 | dd of=/mnt/mountedserver/backup.bz2 bs=1k
As far as I can tell, the drive should be nicely zeroed and should compress very well to equal or be less than the total size of the data on the drive, approx 339MB.
Can anyone lend a hand where my logic might be going wrong? I am getting files > 2.1GB. Way too big.