summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Rebischke <Chris.Rebischke@posteo.de>2017-08-02 20:47:29 +0200
committerGitHub <noreply@github.com>2017-08-02 20:47:29 +0200
commitc39cbfa32885b286e64f000f2ebbd768bf06f090 (patch)
tree61ccd56d5b16926222269e29a682074d93c7d199
parentf9206846329cc1f6b89f510698267e5dec1ef2ca (diff)
parentf445ebb0285dd30c01449691328e7c11194be0b7 (diff)
downloadarch-boxes32-c39cbfa32885b286e64f000f2ebbd768bf06f090.tar.xz
Merge pull request #17 from appleby/improve-disk-compaction
Write zeros to disk to improve disk compression
-rwxr-xr-x[-rw-r--r--]provision/cleanup.sh6
1 files changed, 6 insertions, 0 deletions
diff --git a/provision/cleanup.sh b/provision/cleanup.sh
index b8a2336..29da429 100644..100755
--- a/provision/cleanup.sh
+++ b/provision/cleanup.sh
@@ -4,3 +4,9 @@ set -e
set -x
yes | sudo pacman -Scc
+
+# Write zeros to improve virtual disk compaction.
+zerofile=$(/usr/bin/mktemp /zerofile.XXXXX)
+dd if=/dev/zero of="$zerofile" bs=1M || true
+rm -f "$zerofile"
+sync