Mar 312012
Three operating systems, three file systems, three methods to zero out disk space. Fortunately, they are all pretty simple. Doing this is a good idea right before creating a drive image for backup, as it makes compression more efficient.
OSX – HFS+ (Mac OSX Journaled)
- Open Disk Utility
- Click on the OSX partition
- Click Erase from the tabbar menu
- Click Erase free space… button
- Choose the Fastest option – this will fill the partition with zeros one time.
Windows 7 – FAT32, NTFS, exFAT
- Download SDelete from Microsoft Technet
- Copy sdelete.exe to C:\Windows\System32 (or any folder in your system PATH).
- Run SDelete from the command-line using:
sdelete -p 1 -z c:\
(where ‘c’ is the target drive letter)
Ubuntu – ext3, ext4
- Install the secure-delete package:
sudo apt-get install secure-delete
- Use fdisk to find the correct drive partition:
fdisk -l
The drive in question will be something like /dev/sda or /dev/sdb. Each partition is numbered, like /dev/sdb1 and /dev/sdb2
- Mount the drive partition (if it is not already):
sudo mount /dev/sdb1 /mnt/hdd1
- Run
sfill -Ilz /mnt/hdd1
where ‘hdd1′ is the location of the mounted partition in the filesystem.


With Linux (Ubuntu or RedHat), the “sfill -Ilz” command doesn’t works fine with ext3, ext2.. and others file system formats. It’s likely that the space is increased rather than reduced.
I have test this on 2 VMs with ext formats and different linux OS.
Regards,
Drk.