Skip to content

Commit 5f4d62d

Browse files
authored
Improve unused disk block zeroing (#725)
* Move optional steps for testing VMs out of README.md file This may help avoid new users being confused that they must follow those instructions. Signed-off-by: Andy Fingerhut <andy_fingerhut@alum.wustl.edu> * Add 2025-Jan-30 versions of source code for install.sh Signed-off-by: Andy Fingerhut <andy_fingerhut@alum.wustl.edu> * Improve the method used to zero out unused disk space in a VM Signed-off-by: Andy Fingerhut <andy_fingerhut@alum.wustl.edu> --------- Signed-off-by: Andy Fingerhut <andy_fingerhut@alum.wustl.edu>
1 parent 5f0ba3e commit 5f4d62d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

vm-ubuntu-24.04/clean.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,9 @@ sudo apt clean
3232
# image files.
3333

3434
echo "Writing zeros to unused disk blocks (be patient) ..."
35-
FNAME=`mktemp --tmpdir big-empty-zero-file-XXXXXXXX`
36-
dd if=/dev/zero of=${FNAME} bs=4096k
37-
/bin/rm -f ${FNAME}
35+
FNAME="/bigemptyfile"
36+
sudo dd if=/dev/zero | sudo dd of=${FNAME} bs=4096k
37+
sudo /bin/rm -f ${FNAME}
3838

3939
echo "Disk usage before running this script:"
4040
echo "$DF1_BEFORE"

0 commit comments

Comments
 (0)