Skip to content

Instantly share code, notes, and snippets.

@bofhbug
Forked from x1a0/zerofree.sh
Created January 18, 2017 16:40
Show Gist options
  • Save bofhbug/40915da427790eca33eadbb949a17a3e to your computer and use it in GitHub Desktop.
Save bofhbug/40915da427790eca33eadbb949a17a3e to your computer and use it in GitHub Desktop.
Zero out space on a virtual machine
init 1
for i in `mount | grep sda | grep ext | cut -b 9` ; do mount -o remount,ro /dev/sda$i && zerofree -v /dev/sda$i && mount -o remount,rw /dev/sda$i ; done ;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment