How to zero fill a virtual disk's free space on windows for better compression?
I would like a simple open source tool (or at least free) for that. It should probably write an as big as possible file full of 0and erase it afterwards. Only one pass (this is not for security reasons but for compression, we are backing up virtual machines).
Should run from inside windows and not from a disk.
On Linux I do it like this (as a user):
cd
mkdir wipe
sudo sfill -f -l -l -z ./wipe/
Edit 1: I decided to use sdelete from the accepted answer. I had a look at the sdelete's help:
C:\WINDOWS\system32>sdelete /?
SDelete - Secure Delete v1.51
Copyright (C) 1999-2005 Mark Russinovich
Sysinternals - www.sysinternals.com
usage: sdelete [-p passes] [-s] [-q] <file or directory>
sdelete [-p passes] [-z|-c] [drive letter]
-c Zero free space (good for virtual disk optimization)
-p passes Specifies number of overwrite passes (default is 1)
-q Don't print errors (Quiet)
-s Recurse subdirectories
-z Clean free space
This is an old version. I used the -c switch from the 2nd invocation and this was quite fast (syntax only valid for older versions before V1.6):
c:\>sdelete -c c: (OUTDATED!)
Edit 2: As scottbb pointed out in his answer below, there was a September 2011 change to the tool (version 1.6) The -c and -z options have changed meanings. The correct usage from 1.6 onwards is
c:\>sdelete -z c:
I have the impresion this does what I want. The sdelete tool is easy to use and easy to get.
sdeleteis the right tool for the job, but a September 2011 change to the tool (version 1.6) makes the above answers incorrect. The-cand-zoptions have changed meanings. The correct usage now issdelete -z c:\– scottbb Jan 5 '12 at 3:23