LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 08-17-2005, 06:11 PM   #1
servnov
Member
 
Registered: Sep 2004
Distribution: Slackware 10.2
Posts: 276

Rep: Reputation: 30
Deleting files from harddrive permanently


I have read that stuff like normal deletes (rm) and formatting does NOT erase your data. How is more space freed up then? And how can I actually delete the stuff?
 
Old 08-17-2005, 06:28 PM   #2
PenguinPwrdBox
Member
 
Registered: Oct 2003
Posts: 568

Rep: Reputation: 31
The deletion is semi permenant. Look at it like this.

Disks are divided into inodes, with each inode having it's own table, that contains the physical disk address of where the file's data is stored.

When a file is deleted, it's entry is removed from the inode table. The data remains on disk, but that space in the inode is offered up to other files, because the slot is free.

It's kinda like you being a parking lot attendant. You have a list of all the cars, in all the spots in the lot. When someone leaves - you mark that spot as available. It will remain that way until you reassign it.

The only quick, easy, and cheap method that I know of, is to determine how much free space you have on your drive, and fill it with junk, and then delete it. For instance, if you have 500M free, you could do something like this:

Code:
dd if=/dev/urandom count=500 bs=1M of=/root/filename
What this will do, is create a 500M file, the contents of which are garbage. You can then delete it, but because your sensitive data was overwritten, all that is left on the disk, is the junk from the dd command.
 
Old 08-17-2005, 06:38 PM   #3
servnov
Member
 
Registered: Sep 2004
Distribution: Slackware 10.2
Posts: 276

Original Poster
Rep: Reputation: 30
Ah, so when you delete a file it sits there with a 'free space label' on it, and then can be overwritten by a new file thus effectively deleting it.

So is this what zeroing a drive is all about? Filling everything with junk zeros just to overwrite the data to del it?
 
Old 08-17-2005, 06:45 PM   #4
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
shred is part of the coreutils, and does exactly that: it
wipes, stamps out and burns your files beyond recognition :}



Cheers,
Tink
 
Old 08-17-2005, 07:58 PM   #5
int0x80
Member
 
Registered: Sep 2002
Posts: 310

Rep: Reputation: Disabled
Read the most recent discussion about this subject in the Security forum here at LQ.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Deleting files in C monil Programming 4 03-13-2005 10:33 AM
Deleting files! a_priebe47 Slackware 6 10-17-2004 09:58 PM
How to permanently set permissions on all files created in a directory? BrianK Linux - General 8 06-24-2004 04:06 PM
Deleting files ShakyJake Linux - Newbie 12 05-08-2003 03:07 PM
Deleting files Tingle Linux - Newbie 4 01-16-2003 04:19 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 04:59 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration