Find the answer to your Linux question:
Results 1 to 8 of 8
Ok, I need a good method to delete a file so it can not be recovered at all without wiping the entire partition or disk. Anyone have any ideas?...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Linux Engineer
    Join Date
    Jan 2003
    Location
    Lebanon, pa
    Posts
    994

    Deleting?


    Ok, I need a good method to delete a file so it can not be recovered at all without wiping the entire partition or disk. Anyone have any ideas?

  2. #2
    Linux Engineer
    Join Date
    Jan 2003
    Location
    Lebanon, pa
    Posts
    994
    How well does shred work?

    EDIT
    Just checked and shred won't work on any journaled filesystem.

  3. #3
    Linux Guru
    Join Date
    Oct 2001
    Location
    Täby, Sweden
    Posts
    7,578
    Can't you do like this?
    Code:
    dd if=/dev/zero of=$filename bs=1024 count=$(((`ls -l $filename | awk '{print $5;}'` / 1024) + 1))
    That should zero all blocks in the file, right? I guess you could tweak 1024 to the actual blocksize of the underlying device for greater performance, but... big deal...

  4. $spacer_open
    $spacer_close
  5. #4
    Linux Enthusiast
    Join Date
    Jun 2002
    Location
    San Antonio
    Posts
    621
    ah yes, you could zero them out, but there is still a residual magnetic signature. There have been cases of files that were "shredded" like that over 5 times that were still recoverable. The only real way to do it is melt the platter
    I respectfully decline the invitation to join your delusion.

  6. #5
    Linux Guru
    Join Date
    Oct 2001
    Location
    Täby, Sweden
    Posts
    7,578
    You're right of course. Like this then?
    Code:
    for i in `seq 1 10`; do
        dd if=/dev/random of=$filename bs=1024 count=$(((`ls -l $filename | awk '{print $5;}'` / 1024) + 1))
    don
    That should make it far less traceable, right? (Of course, /dev/random isn't the fastest solution, so /dev/urandom might be preferrable)

  7. #6
    Linux Engineer
    Join Date
    Jan 2003
    Location
    Lebanon, pa
    Posts
    994
    Well I ended up using shred to just overwrite the files to make them unreadable. It worked good, when I cat the outputs it just displays a bunch of stuff which messes up my term as well.

  8. #7
    Linux User
    Join Date
    Feb 2003
    Location
    Norway, Asker
    Posts
    267
    silly me. i was thinking that wipe did the files unrecoverable?

  9. #8
    Linux Enthusiast
    Join Date
    Jun 2002
    Location
    San Antonio
    Posts
    621
    good idea Dolda, I never thought of using pseudorandomness to cover up files like that. There was a thread on LKML (maybe it was somewhere else?) where no one thought of that.
    I respectfully decline the invitation to join your delusion.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •