Sunday, August 30, 2026

Using zerofree to reduce Ubuntu 26.04 (resolute) / Debian 14 (forky) OVA size

This is an update of an older post, because the instructions there stopped working.

Ubuntu 26.04 is the first LTS after Canonical switched from initramfs-tools to dracut in 25.10.  The break=init parameter doesn’t work anymore on 26.04; the system simply performs a normal boot in that case.  I believe that Debian plans to do the same in their next release, 14 (forky).

Dracut builds an initrd that responds to a different parameter, with a different set of break points.  Full information about rd.break is located in the dracut.cmdline man page, but for our purposes, we’ll use rd.break=pre-mount to get a shell before the root filesystem is mounted.  If we build zerofree into the initrd temporarily, then everything we need will be available in that environment.

In full, this process looks like this:

  1. From the prepared system, run: sudo dracut --force --install zerofree
  2. Reboot in graphical mode, or shut down and do a graphical-mode restart, as applicable.
  3. Interrupt the boot loader to add rd.break=pre-mount to the kernel command line.  (This general process is more fully described in the older post.)
  4. Boot.
  5. Press Enter (or enter root password, as required) to get to the initramfs shell.
  6. Run zerofree -v [DEVICE] at the initramfs prompt (replace [DEVICE] with the actual device; this operation shouldn’t damage anything, but for reliability, double or triple-check the device name!)
  7. Run poweroff when it’s done.

The machine is now prepared for export.

No comments: