Re: deleting files with linux
From: Chris Lowth (please@no.spam)
Date: 04/22/03
- Next message: Chris Lowth: "Re: IPtables rules to block by symbolic host name, not IP ?"
- Previous message: Kasper Dupont: "Re: telnet outside"
- In reply to: Whoever: "Re: deleting files with linux"
- Next in thread: L Ekman: "Re: deleting files with linux"
- Reply: L Ekman: "Re: deleting files with linux"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
From: Chris Lowth <please@no.spam> Date: Tue, 22 Apr 2003 14:59:15 +0100
Whoever wrote:
> On Mon, 21 Apr 2003, G. Wolfe Woodbury wrote:
>
>> The "standard" Linux filesystem (ext2/ext3) remove files by removing the
>> pointer to the 'i-node' in the directory file. The i-node is then
>> released for re-use, and the disk blocks in use by the inode are added
>> back to the list of free blocks.
Not quite true .. "rm" decrements a "reference count" (the number of "links"
to the inode). The node and it's space are only freed when..
- the reference count drops to zero (ie: no more links)
and - the file is closed by any processes that have openned it.
and - the file system "syncs" it's buffers
>> ls -l <filename> #to get the length of the file
>> dd if=/dev/zero of=<filename> count=<length> #to write zero's
>> dd if=/dev/urandom of=<filename> count=<length> #to write random data
>> bytes rm <filename>
Nope - wont work (well - may not work) because dd truncates and re-allocates
the file space, which can wind up moving it (or bits of it).
Keep it simple - use the "shred" utility which is specifically designed to
do what the OP is after (ie: "in-place" zapping of the file).
Chris
-- My real address is: chris at lowth dot sea oh em -> OpenSource e-mail virus protection : http://protector.sourceforge.net -> iptables configuration wizards : http://www.lowth.com/LinWiz
- Next message: Chris Lowth: "Re: IPtables rules to block by symbolic host name, not IP ?"
- Previous message: Kasper Dupont: "Re: telnet outside"
- In reply to: Whoever: "Re: deleting files with linux"
- Next in thread: L Ekman: "Re: deleting files with linux"
- Reply: L Ekman: "Re: deleting files with linux"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Relevant Pages
|