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: ad8e04aacb

Signed-off-by: Neal Gompa <ngompa@fedoraproject.org>
This commit is contained in:
Neal Gompa 2021-07-15 10:10:35 -04:00
parent b4015b7dba
commit 49753d125b
1 changed files with 3 additions and 0 deletions

View File

@ -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.)"