vsphere-k8s/packer/scripts/zero-disk.sh

5 lines
186 B
Bash
Raw Permalink Normal View History

2022-12-02 21:32:50 +00:00
#!/bin/bash -eu
echo '>> Zeroing free space to reduce disk size'
sudo sh -c 'dd if=/dev/zero of=/EMPTY bs=1M || true; sync; sleep 1; sync'
sudo sh -c 'rm -f /EMPTY; sync; sleep 1; sync'