From 829c112dd10c40da0de60503164f826429c8de75 Mon Sep 17 00:00:00 2001 From: mikepell Date: Tue, 5 Jul 2022 15:34:06 +0000 Subject: [PATCH] adding zero drive back some hypervisors will need manual virt-sparsify or equivalent --- prepare-ubuntu-18.04-template.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/prepare-ubuntu-18.04-template.sh b/prepare-ubuntu-18.04-template.sh index b4febe3..cbcec11 100755 --- a/prepare-ubuntu-18.04-template.sh +++ b/prepare-ubuntu-18.04-template.sh @@ -98,6 +98,10 @@ sudo sed -ri '/\sswap\s/s/^#?/#/' /etc/fstab # cleans out all of the cloud-init cache / logs - this is mainly cleaning out networking info sudo cloud-init clean --logs +# zero out drive +dd if=/dev/zero of=EMPTY bs=1M status=progress +rm EMPTY +fstrim -av #cleanup shell history cat /dev/null > ~/.bash_history && history -c