Skip to content

Commit 7b8dfbb

Browse files
authored
write_zeroes: flush buffers before writing zeroes
this avoids spurious failures with e.g. btrfs' metadata backing store when alternative filesystems are used (i.e. #62)
1 parent c6d4ffc commit 7b8dfbb

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

provision/write_zeroes.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
set -e
44
set -x
55

6+
# Make sure unwritten data has been flushed beforehand
7+
sync
68
# Write zeros to improve virtual disk compaction.
79
zerofile=$(/usr/bin/mktemp /zerofile.XXXXX)
810
dd if=/dev/zero of="$zerofile" bs=1M || true

0 commit comments

Comments
 (0)