Skip to content

Instantly share code, notes, and snippets.

@jpylypiw
Created October 31, 2018 11:00
Show Gist options
  • Save jpylypiw/27fb2c872b6e5ec01b1fa8ac1395f4e1 to your computer and use it in GitHub Desktop.
Save jpylypiw/27fb2c872b6e5ec01b1fa8ac1395f4e1 to your computer and use it in GitHub Desktop.
Keep size of virtual Filesystem small

Old Way:

dd if=/dev/zero of=zero.small.file bs=1024 count=102400
dd if=/dev/zero of=zero.file bs=1024
rm zero.small.file
sync ; sleep 60 ; sync
rm zero.file

in a windows vm you can use sdelete:
sdelete.exe -z c::

New Way:

crontab -e
0 12 * * *   /sbin/fstrim -a -v -m 16m
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment