Clear free disk with zeroes

Done in xubuntu 20.04

  1. Open GRUB menu and select recovery mode
  2. Open root shell prompt1
  3. Remount / in readonly mode:

    mount -n -o remount,ro -t ext2 /dev/sda1 /
    
  4. Clean with zeroes

    zerofree -v /dev/sda1
    

This is to compress the data in the disk, as removing a file doesn’t get it’s contents erased. Now with free space being all zeroes you can compress to a nice small .ova.

Footnotes:

1

This is to work in single user mode so we can remount / safely