write_zeroes.sh 190 Bytes
Newer Older
1
#!/bin/bash
2
3
4
5
6
7
8
9
10

set -e
set -x

# 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