First, I think its important to understand the command you're using. dd
by its very nature is a bit-by-bit copy of the if
(input-file) which results in a perfect copy of the file when you give it an of
(output-file). This includes any zeros.
You also have to remember that the file table does not actually represent what is on the device, just what you can normally see. That's why when you try and recover files using recovery software you can often times recover files that are not yet overwritten. Files are deleted from the table allowing the space they consumed to be listed as "free" and other files to write over top of those "deleted" files. They aren't typical scrubbed in most filesystems in the interest of saving time on a delete.
Your of=
option takes a path to a file, so if you are trying to get the output in the directory you're currently working in pwd
then of=sdcard-copy.img
should suffice.
That being said, you have an alternative option for saving output:
You could compress the output with gzip to save it:
dd bs=1M if=/dev/mmcblk0 | gzip -c > sdcard-copy.img.gz
and decompress it on the restore phase:
gunzip -c sdcard-copy.img.gz | dd of=/dev/sdb bs=1M
or whatever your intended target device is (I would suspect sda
)
The downside to this is that it will take some time to compress/decompress vs just plain copying. For your case that may actually be pretty fast if the source is mostly zeros (which it sounds like it is).