dd for creating an image of my filesystem . I use Debian 8(Jessie) on ARM 32 bit system.
Command I run is :
dd if=/dev/mmcblk0 bs=1M | gzip -c > /mnt/usb/<image_name.gz>
For some reason while my File System took 1.3 GB a file I got is 1.9 GB search on net for answer and the answer that I get agree with it was that dd take all blocks if they didn't filled. How I get to this conclusion I make some experiment : I run these commands :
$ cat /dev/zero > /root/zero.file $ sync $ rm /root/zero.file
After these commands I check my system again (
df -h) and saw that now my filesystem took actually 1.9 GB. What is actually dd create for me.
How can I get a file size of my image with 'dd' as close as possible to original size of source code.