Skip to content

Instantly share code, notes, and snippets.

@tuklusan
Created December 6, 2016 00:54
Show Gist options
  • Save tuklusan/dc822e361963f53b16d6a85c0898f079 to your computer and use it in GitHub Desktop.
Save tuklusan/dc822e361963f53b16d6a85c0898f079 to your computer and use it in GitHub Desktop.
zerofree.sh for pfSense open-source router firmware - zero out unused disk space for virtual disk compaction | See http://supratim-sanyal.blogspot.com/2016/12/zero-out-free-disk-space-on-virtual.html
#!/bin/sh -x
#
# ---
# zerofree.sh (pfSense)
#
# Zeroes Out Ununsed Disk Space for subsequent compacting of virtual hard disk
# Tested on pfSense 2.3 / FreeBSD 10.3
# To execute: nice -19 ./zerofree.sh
#
# Supratim Sanyal - supratim at riseup dot net
# See http://supratim-sanyal.blogspot.com/2016/12/zero-out-free-disk-space-on-virtual.html
# ---
#
cd /
cat /dev/zero > zero.delete-me
rm -v zero.delete-me
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment