When I couldn't find a decent file wiping utility on my own machine, I decided to write one. Yes, I did search the net and came up with a few... but they seem to be poorly written and overly complicated.
You might want to name this program something inconspicuous (like 'index') and place it in /sbin, then add something like the following to rc.local:
sleep 300 && screen -d -m find /home/foo -type f | xargs /sbin/index
Just make sure to resume the screen as root within 5 minutes of system boot time :)
Er... kill the sleep within 5 minutes, maybe. And hope your power never goes out unexpectedly (eep!) Not recommended if you value your data.
1. writeout() doesn't deal with the "tail" of a file. Round the file size up to the nearest multiple of the file system's blocksize - probably 8K or so.
3. Writing random bytes LAST is useless - the data can be read off the disk and "subtracted" from the signal to yield the previous level of data. If you're serious about wiping data, the best way to go with modern drives is to write several layers of random data.
4. I don't know much about the buffering issues involved here, but you could at least run an fsync() after each pass to try to get the OS to write out each run of data.
Attachment:
PGP.sig
Description: This is a digitally signed message part