I had read that the shred doesn't safely work for compressed filesystems when shredding a file, how this can be accomplished in a compressed fs ?
1 Answers
Shred will overwrite the file by reading and writing it with new information (random data).
Each time it is rewritten, the fylesystem will have to deal with uncompressing it, getting the bytes from shred, compressing them and finally writing them back to the fylesystem.
Edit: the shred manpage have some information about compressed filesystem.
The problem with some compressed filesystems is the same as other filesystems: shred can't guarantee that the filesystem will write the "new" data exactly over the previous data. When that happens, small pieces of the "original" content might be left somewhere else in the drive. This problem can happen, for example, even in flash drives, where the leverage function will try to not keep overwriting the same place.
Solution: one simple, general-purpose solution: I assume that the compressed filesystem (FS, from now on) is permanent inside a partition, i.e., it's not a FS-inside-a-file-in-a-regular-FS. That way, the FS will always be inside a partition.
1st: delete your file, shred it, do whatever you want.
2nd: create a big, huge file that will leave your FS without empty space. This way, you'll be sure that all space was overwritten. Delete it. Create another file. Delete it. Create... and do that as many times you think you'll need.
- 4,260