I am looking to use DD to compress an entire disk (sda) to an image file on sdb.
A friend told me to mount sdb / partition 1, then as root, type the following command:
dd if=/dev/sda | bzip2 -9 >/media/sdb1/disk_image.img.bz2
This did not work. I just get an error message:
Invalid command line: Not enough files given. Aborting...
I was also told to restore (assuming sda has the image & sdb is the destination), I could do the following:
bzip2 -cd /media/sda1/disk_image.img.bz2 | dd of=/dev/sdb
Of course, since the first part didnt work, I couldnt test the second.
Any ideas how to use DD to byte for byte image the entire drive & compress it (its mostly empty space).