Hi, I've written a quick patch to the ext2fs which ensures that inodes, data blocks, and directory entries are overwritten with null bytes when they are deleted. The patch adds a couple of inline functions to overwrite the appropriate data with zeroes. Its quite simple and self-explanitory. Both attached patches are to a vanilla 2.4.24 kernel. inodes: ext2_delete_inode() now uses the inline function delete_inode() to mark the on-disk inode as 'deleted'. If the privacy option is not enabled, then the i_dtime is set as per usual operation, otherwise the meta-data are all set to 0. After the inode has been truncated, the i_data is set to 0 by delete_blocks() and the inode is written to disk again. Splitting the delete_inode() and delete_blocks() functions is not ideal, I would prefer that one function remove the meta-data and the inode be written out just once. The problem is that ext2_truncate() needs the i_data information from the struct inode, and we want to remove this information from the inode on the disk. To ensure that the i_data is 0 by the time it hits the disk, I write the inode to disk twice, which is not optimal. directory entries: ext2_delete_entry() now uses the inline function mark_delete_dir() to indicate that the directory entry is no longer valid. If the privacy patch is not enabled, then the dir->inode is set to 0 as per normal operation, otherwise the entry is memset 0. Very straightforward. blocks: ext2_free_blocks() now uses the inline function destroy_block() before it updates the group meta-data. The destroy_block() function overwrites the block with zeroes. I'm not sure that it is implemented correctly, I don't know anything about buffer_heads. The block is only overwritten with a single pass of zeroes. It is, of course, possible to have a full 37 pass overwriter with full bit toggling maps and all that, but I think it might make more sense to add a new option for that, something like: CONFIG_EXT2_FS_PRIVACY_EXTREME_PARANOIA. For preventing simple forensic analysis (that is, what the police, employers and even most government agencies do) a single pass with zeroes is sufficient. Users can use userland tools like wipe or srm for more thorough overwriting. There is also a patch to ext3fs, which adds the same functionality (in the same way) as the ext2fs privacy patch. However, the main problem with privacy on the ext3fs is the journal. I am not familiar enough with how the journal transactions are handled to implement what seems to me the obvious solution: when a transaction is complete (i.e. doesn't need to be replayed by fsck) overwrite it with null bytes. If done correctly, it is possible to leave sufficient information for fsck to find the right transaction to begin replaying, without leaving any data which would be of use to a forensic analyst. Given the existing global political climate, privacy control over a file system seems like a no-brainer to me. Full privacy options would include things like mounting disks with noatime, and possibly normalizing the mtime and ctime of all inodes (setting everthing to an arbitrary date, e.g. 0). Certainly this will break tools like make which require atime, but it would provide even less information to a forensic analyst examining the file system. peace, --gq ps. apologies for posting to the kernel mailing list, but I'm not sure who is the maintainer for ext2/3.