Τετάρτη 9 Σεπτεμβρίου 2015

Is your data recoverable after deletion?

We've all lost important files by accidents. Deleting data accidentally is one of the most common mistakes one does when using a computer, and may sometimes lead to huge trouble. What if you delete accidentally a project the night before its' presentation? What if you remove from your system files that you need while trying to get rid of the ones that are just HDD-space wasters? Or if you realise you needed a file after emptying the recycle bin?

As for all problems, the best solution is prevention -in this case, uploading a backup of your important data on an online server and watching out you won't have them deleted. Yet sometimes the prevention itself may not be enough or even feasible; your online-server account may get banned, or you may not be able to upload your files due to their size or your internet connection. After all, accidents happen frequently and to everyone; no one guarantees that your files won't be deleted. But are they forever lost after deletion? Is there a method to have them recovered?

The general answer to this question is yes, there is the feasibility to recover your accidentally deleted data. But this is not true under all circumstances; it is likely that your files will be lost forever. So, the question is, when are your files recoverable and how can you get them back. Before replying, it's worth elaborating how are they saved on your HDDs (or USBs, or smart-phones) and what happens after deletion.

How is data saved on a storage device?

How is data stored on a storage device depends entirely on what kind of device it is. A magnetic device, a hard disk drive (HDD) for instance, stores data differently than a flash memory one (e.g. USBs), but some general principles apply to both. These principles concern the form of the data that is being stored; no matter the device, all data is stored as series of bits -that means, series of zeros and ones. Each series represent a different number, symbol or character, depending on the encoding and the file format. When one copies an .mp4 video file to an HDD, one copies a long series of zeros and ones that when treated as part of an .mp4 file, are read as data concerning pixel colors.

When it comes to a hard disk, each bit of information is being stored magnetically on the drive's platters -the part of the drive containing the data. Generally speaking, each platter's surface is divided to tracks and sectors, for it is more practical to find data searching particular parts of the hard disk instead of scanning the whole of it. A sector typically holds about 512 bytes (each byte being equal to eight bits).

Tracks and sectors of an HD drive's platter.
(found on: www.trademan.net)

The precise procedure taking place when data is saved on an HDD is rather complex to explain. Simply put, a magnet called the head of the read-write arm of the hard disk, magnetizes parts of the platters so that their magnetization patterns will resemble to the series of zeros and ones of the file being saved. Saving the decimal number "6" on an HDD is, technically, saving the binary number
"0110" on a sector (the space of which is used exclusively for that piece of data) in a way that the magnetization pattern of it will be changed at two points. Reading the number is reading how many times does the pattern change and to which points of the platter.

The plain old floppy disks worked in a similar way. After being formatted, they were divided to tracks and sectors, upon which the data was saved. Not all storage devices are magnetic though. Common storage technologies include flash drives, and their technology is somewhat different than the HDDs'.

When it comes to a flash memory device, such as a USB, the zeros and ones consisting the files are saved in electrical form within MOSFET transistors. A typical MOSFET consists of a source (similar to the emitter of a bipolar transistor), a gate (similar to the base) and a drain (similar to the collector). A flash memory MOSFET uses two gates, the control and the floating one.


A MOSFET transistor
(found on www.cotsjournalonline.com)

The drain and the source contain free electrons that do not travel through the transistor as long as no voltage is applied to the control gate. When applied, they float through the floating one from the source to the drain, and if we suddenly turn the voltage off, the electrons in the floating gate stay in it indefinitely. That's how a "0" is saved in a MOSFET. We can turn it to a "1" by removing the charge from the floating gate, when applying a reverse voltage.

All data in a flash memory device (e.g. USBs) ισ saved in MOSFET transistors.

What happens when your data is deleted? 

In most operating systems (Windows, linux etc), the deleted files are sent to a recycle bin before being deleted forever. That's because their developers are aware of the accidental deletions. Yet that measure is sometimes not enough, since you may realise the needfulness of an archive you deleted, after you emptied the recycle bin. In such case, the file is considered to be irrecoverable. It's not.

Each file on a storage device uses some space; but how does an operating system treat the device and the file? Whenever a filed is saved on an HDD or flash drive, there is a part of the storage device on which the name and precise location of each file is being stored. The location of the file is not the path of it in the operating system; it's the sector track of the HD, or a transistor group of the flash drive, on which the data is saved.

Whenever one deletes the file, it's not the file itself that is deleted. That means, it's not the series of zeros and ones turning to a series of mere zeros as it was; the bits consisting the file remain as they were. What's deleted is the path leading to the file. The sector tracks containing are now treated by the operating system as blank, yet the actual file is still there.

The windows' recycle bin. 
Is your data gone after emptying it? Not really!

The reason that happens is simple: if the operating system had to rewrite the transistors or HDD sector tracks, it would take a way longer time to delete a file than it takes now. It would be as if you replaced it by another one. It is, therefore, more practical to delete just the path of the sector tracks containing the data instead of demagnetizing whole parts of the HDD. But that means that your file hasn't really been deleted; it's there until some other data is written upon the same part of the device.

So, is your data recoverable after deletion? The answer is yes -as long as nothing has been written upon the part of the device on which the data was. But it is possible that the next file you'll download will be written upon the one you just deleted. How can you recover the deleted data and how can you ensure that it won't be rewritten before the recovery?


How can one recover deleted data?

One can use data recovery software to bring the deleted files back. The software used for the recovery of deleted data utilizes the avoidance of the OS to demagnetize or discharge the parts of the storage devices upon which the data was written, to bring the deleted data back. A data recovery program scans the whole storage device seeking for changes in the magnetization pattern or the transistors' charges, in parts that are considered by the OS to be available for saving data.

Some of the most widely used data recovery software include Recuva, which is portable and easy to use. If one buys the software, one is able to deep-scan a device and recover long-lost data and files. One can also locate files containing particular text. It can be run from a usb as well. Other software is FreeUndelete and Undelete360. One can find plenty of such programs on the internet.

If you accidentally empty your recycle bin while it contains important files, what you have to do is avoiding downloading any kind of file to your HD (there is a slight possibility that it'll be written upon your recently deleted ones) and recover your files after downloading and installing the recovery software on a USB stick or an external (or secondary internal) hard disk drive.

But, as in all kinds of problems, the best solution is prevention: always manage to have your important files uploaded on an online-server or/and copied to a USB or external HD. That's a better way to assure that you won't lose them.

I hope it was helpful :)

Δεν υπάρχουν σχόλια:

Δημοσίευση σχολίου