From 49753d125b3afea1485f9671ed0ba91843f81402 Mon Sep 17 00:00:00 2001 From: Neal Gompa Date: Thu, 15 Jul 2021 10:10:35 -0400 Subject: [PATCH] Set up the zeros file as nodatacow to disable CoW and compression This makes it so that we can effectively zero out the filesystem. Fixes: ad8e04aacbcd6681df4667d19262df9e801708a9 Signed-off-by: Neal Gompa --- fedora-cloud-base.ks | 3 +++ 1 file changed, 3 insertions(+) diff --git a/fedora-cloud-base.ks b/fedora-cloud-base.ks index 74c3d94..a647718 100644 --- a/fedora-cloud-base.ks +++ b/fedora-cloud-base.ks @@ -122,6 +122,9 @@ basearch=$(uname -i) rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-$releasever-$basearch echo "Zeroing out empty space." +# Create zeros file with nodatacow and no compression +touch /var/tmp/zeros +chattr +C /var/tmp/zeros # This forces the filesystem to reclaim space from deleted files dd bs=1M if=/dev/zero of=/var/tmp/zeros || : echo "(Don't worry -- that out-of-space error was expected.)"