Zero out free disk space

Zero out free disk space

This function comes in handy when you want to make a compressed sector-by-sector backup of your Linux filesystem and you don’t want to include/waste space with the unused sector (which still have information on them)

Running
nice cat /dev/zero > zero.fill;sync;sleep 1;sync;rm -f zero.fill
before the actual backup will make sure all unused sectors contain zero (so they will not waste any space in the archives).

Leave a Reply