Τετάρτη 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