Created
December 6, 2016 00:54
-
-
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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