1

zerofree reduces raspberry pi sd card images by writing zeros to free space. The zerofree process can be run from an Ubuntu PC directly on the SD card:

apt-get install zerofree
umount /dev/sdc1       #(change sdc1 to your raspi boot partition location)
umount /dev/sdc2       #(change sdc2 to your raspi ext4 partition)
zerofree -v /dev/sdc2   #(replace sdc with your usb cards location, check the command "df") 

What measurements and validation can be performed on the SD card to quantify the before and after effects of the zerofree process?

muru
  • 72,889
gatorback
  • 1,384
  • 23
  • 48

1 Answers1

0

Read both partitions, and write each to a disk IMG file. Then compress each image.

This is the most accurate measure, since the compressed size is determined not by the amount of allocated space, but rather what all the space contains.

That is to say allocated and unallocated space will both compress exactly the same -- unless one of those volumes is zeroed out.