Skip to content

Instantly share code, notes, and snippets.

@bperel
Created August 4, 2014 15:37
Show Gist options
  • Save bperel/8ddc786c5b9bb3aacaec to your computer and use it in GitHub Desktop.
Save bperel/8ddc786c5b9bb3aacaec to your computer and use it in GitHub Desktop.
Clear VMWare disk cache
#!/bin/bash
### BEGIN INIT INFO
# Provides: Handle caching page issues with vmware hgfs share
# Required-Start: $local_fs $network
# Required-Stop: $local_fs $network
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Handle caching page issues with vmware hgfs share
# Description: Handle caching page issues with vmware hgfs share
### END INIT INFO
# This is brutal but it prevent page cache and handle the read/write hgfs issue width vmware tools
while (true); do
echo 1 > /proc/sys/vm/drop_caches
sleep 1
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment