How can deleted computer files be retrieved at a later date?















Share on Tumblr

Clay Shields, a professor of computer science at Georgetown University, explains.

The details of how this occurs depend on the operating system (OS) the computer is running, but the basics tend to be similar. A computer disk stores information in a series of chunks known as sectors, each typically 512 bytes long. Each sector has a number that serves as its address on the disk. A file on the disk is split across a number of sectors. These sectors may be located together but might be scattered across the disk if there is not enough contiguous space in one spot. The OS has an index mechanism to keep track of which sectors belong to which file--the particular mechanism varies by OS, but they all do it. Additionally, because sectors are addressed by numbers and people care more about names than numbers, the OS also stores a directory that maps the file name to the index entry about which sectors contain the file's information.

As an analogy, consider the disk to be a filing cabinet that contains a long series of consecutively numbered folders, each of which can contain only a few pages of information. A particular document might be split among many folders if it is too big to fit in just one. The first drawer of the cabinet holds a big directory that has a list of all the documents in the cabinet. The folder number associated with a particular document holds an index to all the other folders that contain the parts of the document.

When a file is deleted, the information stored in the individual sectors is not erased, because the erasure process consists of overwriting the sector and is relatively slow. It is significantly faster to overwrite the sector by rewriting it with new data only when it is needed for some other file. So when a user "deletes" a file, the directory entry for the file is either removed or marked as deleted by changing the first letter of the file name to a special character (which again differs depending on the OS). The index entry and the sectors are then made available as space for new files but are left untouched until needed.

A deleted file can thus be recovered if the index information and sectors have not yet been reused. The chances of this are better if little computer activity has occurred since the file was deleted, so it is best to attempt to recover the file as soon as possible. In operating systems that simply change the directory entries, recovery programs have a pretty easy time. They scan the directory for filenames that have the special character that signifies "deletion" and present a menu of files to recover. When the accidentally deleted file is chosen, the directory entry is corrected and the file reappears. In other operating systems, the recovery programs have a more complicated task. The name that was in the directory may be lost, making it harder for the user to find the specific file she wants, and the program generally must look through all the index information and attempt to recover files from their individual sectors. Also, because sectors may have been reused from the middle of the file, only parts of the file may be recoverable.

Answer originally published December 15, 2003.



Comments

Add Comment
Leave this field empty

Add a Comment

You must sign in or register as a ScientificAmerican.com member to submit a comment.
Click one of the buttons below to register using an existing Social Account.

More from Scientific American

See what we're tweeting about

Scientific American Editors

More »

Free Newsletters


Get the best from Scientific American in your inbox

Solve Innovation Challenges

Powered By: Innocentive

  SA Digital
  SA Digital

Science Jobs of the Week

Email this Article

How can deleted computer files be retrieved at a later date?

X
Scientific American Magazine

Subscribe Today

Save 66% off the cover price and get a free gift!

Learn More >>

X

Please Log In

Forgot: Password

X

Account Linking

Welcome, . Do you have an existing ScientificAmerican.com account?

Yes, please link my existing account with for quick, secure access.



Forgot Password?

No, I would like to create a new account with my profile information.

Create Account
X

Report Abuse

Are you sure?

X

Institutional Access

It has been identified that the institution you are trying to access this article from has institutional site license access to Scientific American on nature.com. To access this article in its entirety through site license access, click below.

Site license access
X

Error

X

Share this Article

X