really deleting

Kim Holburn kim.holburn at
Sun Mar 2 19:33:53 EST 2003

At 5:52 PM +1100 2003/03/02, Andrew Donehue wrote:
>Hi All!
>          I am after a program that will go through an ext2 based filesystem and look for any deleted files, and actually zero out the contents of that deleted file on the hdd..... The reason for this is.....
>I spent about 10hrs setting up a server the way I like it, I seem to be setting up 4+ of these a month, so instead of wasting 10hrs each time, I disk dumped the hdd (everything - the hardware is always the same) - ran it through gzip, and sent it to a file.... The server install is only about 400MB in size, but I stuffed up in the initial one, and had to delete some files..... problem is that dd only looks at bits, it doesn't care that the file was deleted.... it still compresses the contents of the file... (that is left over after a normal delete... only a marker to the file is deleted...) - and my image is about 4GB in size!
>I should be able to fit the image onto a  CD (as the OS install is around 400MB....) - the remaining is the compressed files that I deleted.... (unrequired junk)
>I have seen programs around that do deletes and replace with random data, but I was after one that went over the old space and zero'ed out any spare space.... Any suggestions?

I'm not sure that what you want is the simplest way of doing it but I seem to remember a simple script way of doing what you want.  With a script you create a file of zeros as big as free space then delete it.  Maybe using /dev/zero and dd and a redirect.

Kim Holburn 
Network Consultant - Telecommunications Engineering
Research School of Information Sciences and Engineering
Australian National University - Ph: +61 2 61258620 M: +61 0417820641
Email: kim.holburn at  - PGP Public Key on request

Life is complex - It has real and imaginary parts.
     Andrea Leistra (rec.arts.sf.written.Robert-jordan)

More information about the linux mailing list