Reputation: 316
I would like to know how would to permanently and securely delete files on CentOS. The problem I'm having right now is that, the filesystem is ext3, and when I thought of using srm-
it said something like
"It should work on ext2, FAT-based file systems, and the BSDnative file system. Ext3 users should be especially careful as it can be set to journal data as well, which is an obvious route to reconstructing information."
If I can't use shred
or srm
, and secure-delete is also not an option, I'm clueless about how to securely and permanently delete the data. The files I'm deleting are NOT encrypted.
Upvotes: 15
Views: 17369
Reputation: 982
just use shred:
shred -v -n 1 -z -u /path/to/your/file
this will shred the given file by overwriting it first with random data and then with 0x00 (zeros), afterwards it will remove the file ;) happy shreding!
notice that ext3/ext4 (and all journaling FS) could buffer the shred with random data and zeros and will only wirte the zeros to disk, this would be the case when you have a little file. for a little file use this:
shred -v -n 1 /path/to/your/file #overwriting with random data
sync #forcing a sync of the buffers to the disk
shred -v -n 0 -z -u /path/to/your/file #overwriting with zeroes and remove the file
for ext3 1MB or greater should be enough to write to the disk (but im not sure on that, its a long time since i used ext3!), for ext4 theres a huge buffer (up to half a gig or more/less).
Upvotes: 14
Reputation: 4713
The srm
readme says only that Ext3 users should be especially careful, not that srm
definitely won't work on Ext3.
In particular, Ext3 does not enable data journaling by default, so in theory, srm
should work basically to the extent that it was designed to work. You may want to take a look at this link for a good overview of the basic issues.
Upvotes: 1