This question already has an answer here:
dd my disk and compress the image with
lzo the image is still big. The partition is 10GB used, 90GB available. But the image still around 20GB. I believe that is because I have copied many and deleted many files on that disk and the filesystem doesn't zero the unused blocks from those deletions.
How can I zero the unused blocks in order to minimize the disk image? So that dirty bytes don't add up on my image. I'm using ext4.