Shred: Doesn't work on Journaled FS?

后端 未结 3 1799
说谎
说谎 2020-12-10 05:27

Shred documentation says shred is \"not guaranteed to be effective\" (See bottom). So if I shred a document on my Ext3 filesystem or on a Raid, what happens? Do I shred pa

3条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-10 05:32

    The other answers have already done a good job of explaining why shred may not be able to do its job properly.

    This can be summarised as:

    shred only works on partitions, not individual files

    As explained in the other answers, if you shred a single file:

    • there is no guarantee the actual data is really overwritten, because the filesystem may send writes to the same file to different locations on disk
    • there is no guarantee the fs did not create copies of the data elsewhere
    • the fs might even decide to "optimize away" your writes, because you are writing the same file repeatedly (syncing is supposed to prevent this, but again: no guarantee)

    But even if you know that your filesystem does not do any of the nasty things above, you also have to consider that many applications will automatically create copies of file data:

    • crash recovery files which word processors, editors (such as vim) etc. will write periodically
    • thumbnail/preview files in file managers (sometimes even for non-imagefiles)
    • temporary files that many applications use

    So, short of checking every single binary you use to work with your data, it might have been copied right, left & center without you knowing. The only realistic way is to always shred complete partitions (or disks).

提交回复
热议问题