Skip to contentSkip to conversation

guestfs: eliminate rescue initramfs images from base images

PATCH In review Jeff Layton 2 participants 2 messages Sep 24, 2025 – Sep 26, 2025

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 guestfs: eliminate rescue initramfs images from base images

dracut-config-rescue generates the "rescue" images in the /boot partition (at least on Fedora hosts). This is a waste of space since these are ultimately throwaway VMs.

Uninstall dracut-config-rescue from the base images, and delete any already-generated images , thus saving space for more "make linux" invocations.

---
 playbooks/roles/base_image/templates/virt-builder.j2 | 6 ++++++
 1 file changed, 6 insertions(+)

While we're at it, lets delete any already-generated images too.

playbooks/roles/base_image/templates/virt-builder.j2 +6 -0
index 6805679a8959..277c94141b35 100644
@@ -13,6 +13,12 @@ copy-in {{ guestfs_distro_source_and_dest_file }}:{{ target_dir }}
 {% endif %}
 
 install sudo,qemu-guest-agent,python3,bash
+
+# get rid of any rescue initramfs images, and prevent new ones from being generated
+uninstall dracut-config-rescue
+delete /boot/*rescue*
+delete /boot/loader/entries/*rescue*
+
 run-command useradd {{ kdevops_uid }} -s /bin/bash -m kdevops
 append-line /etc/sudoers.d/kdevops:kdevops   ALL=(ALL)       NOPASSWD: ALL
 edit /etc/default/grub:s/^GRUB_CMDLINE_LINUX_DEFAULT=.*/GRUB_CMDLINE_LINUX_DEFAULT="console=ttyS0"/
Signature · 1 line
2.51.0
#1 lore raw
Quoted 9 lines · Jeff Layton

dracut-config-rescue generates the "rescue" images in the /boot partition (at least on Fedora hosts). This is a waste of space since these are ultimately throwaway VMs.

Uninstall dracut-config-rescue from the base images, and delete any already-generated images , thus saving space for more "make linux" invocations.

Applied and pushed!

Luis