Zerofree your filesystem

Sat 28 September 2013 by admin

Lets assume that you have file image:

dd if=/dev/zero of=file.1 bs=4k count=128

on top of it you create filesystem ext3/ext4

mkfs.ext4 /root/file.1

mount it, create remove some files etc. and you gonna make it more space efficient, that's why

zerofree /root/file.1

on umount filesystem in result you get unallocated space zeroed. Zeros of course are easily to compress or deduplicate and you save some space. In the same way you can treat virtual disk image. More about that on