3 ms·
"cat /dev/urandom > file" may fail before the disk is full. I have seen a system do that because it wants to have room on the disk for e.g. log files or in-file
by Someone 16y ago
"cat /dev/urandom > file" may fail before the disk is full. I have seen a system do that because it wants to have room on the disk for e.g. log files or in-file-system swap.
Also, this will not work with disk quota, and you will have to make sure that you write to the same disk as where the original files lived (think mount points)
Full-disk encryption will not work in all countries, as law enforcement could imprison you if you do not give them the keys (recently happened in the UK). It also would not enable you to point at your drive and say "take a look. That file isn't there"
I think the only way to do this would be with support from the file system. It would have to support two things: overwriting file data (including that in on-disk snapshots), and removing evidence that a file or directory existed with a given name.
Edit: I just realize that the disk must support this, too. It could have written your data, verified the write, seen it to be unreliable, and rewritten it somewhere else on the disk. I doubt disks would keep track of links to these unreliable copies. So, in short, I doubt there is any 100% reliable way to erase data from a disk. Copying what you want to a different drive and destroying the drive probably is your best option, but that may be a bit time-consuming and expensive if you want to safely erase a single file frequently.