We've all dealt with data loss, whether it was from a hard drive failure, data corruption, or accidentally deleting a file. If you've ever experienced a major loss of data, you've probably wondered about data recovery. Like, how does data recovery work? How much data can be recovered? How much does data recovery cost?

Well, we've pondered these questions, too. So, read on to find out how data recovery works.

Data Loss and Data Recovery

Data loss can take many forms: accidental deletion, hard drive failure, software bugs, data corruption, hacking, and so on. Even a simple power failure can cause you to lose data. And, of course, there are more extreme cases, like when a hard drive is recovered from a plane crash; amazingly, data recovery specialists can retrieve data from storage media that's been almost completely destroyed.

lego man screaming face

If a piece of data used to be on your hard drive, solid-state drive, USB stick, RAID, or other storage media, you might be able to hire someone (or purchase data recovery software) to restore your data. Simply put, data recovery is the salvaging and repair of lost data.

Of course, data recovery isn't always possible. Sometimes the data storage device is corrupt or damaged, making data recovery impossible. However, data-recovery technology has become extremely advanced. For example, Kroll Ontrack, an Australian data recovery company, recovered 99% of the data from a hard drive on the Challenger spacecraft when it disintegrated upon re-entry.

How Does Data Recovery Work?

The methods used to recover lost data depend on how the data was lost in the first place. Let's take a look at some of the most common forms here.

File Deletion

On a regular hard drive, any file you delete actually stays on your drive until it's overwritten with another file. This means that if you act fast, you have a pretty good chance of recovering the file. In the case of file deletion, you can use file recovery software like TestDisk. This free and open-source data recovery tool uses a complex algorithm to analyze information left on the hard drive to determine where the file was physically stored. If it guesses correctly, you'll get the file back. If not, you're out of luck.

However, doing just about anything on your computer can result in the file being overwritten and likely lost forever. Even browsing the internet can result in cookies or cache files being stored in that location, overwriting the information you're hoping to retrieve. Even installing file recovery software to attempt to recover your data can do the same thing. If the file hasn't been overwritten, the chances of getting it back vary depending on the format of your file system.

For example, the Windows NTFS system retains file description information after the file has been deleted, making it relatively easy for file recovery software to find the file. Other systems, however, like UTF and FAT, destroy more information about the file when it's deleted, making it more difficult for file-recovery algorithms to guess the file's location on the disk.

You'll note that the above relates to hard drives, the older, spinning platter devices found in millions of devices. However, many people now use solid-state drives (SSDs) instead of hard drives. SSDs handle deleted data and data recovery differently from a hard drive, and you can read more about SSD data recovery further down the article.

Related: Can Data Be Recovered From a Failed SSD? What You Need to Know

File Corruption

You know how disheartening it can be to see the words "corrupt hard drive" error. However, data recovery is still possible, even if you see those trauma-inducing words. If you attach the hard drive to another computer, you might find that only the operating system has been corrupted and that the rest of your data is fine. In this case, it's just a matter of copying everything to another hard drive.

Another problem that could get you to this point is a corrupted partition table, which might be possible to repair using the correct software. If you can successfully repair the partition table, getting all of your files back should be easy. If not, you still might be able to recover enough information from the table to get some of your files back, though it depends greatly on the level of corruption.

Even if the files you're trying to recover have been corrupted, there's a chance that you'll be able to get usable portions of them back using data recovery software; as long as the software can find the file, it will try to recover it. While you might not be able to use what you get, there's always a chance that you'll get a portion of the file back, which could potentially save you a lot of time in trying to recreate it.

File System Format or Damage

Similar to deleting a file, formatting a file system destroys information about the previous files and structure of the disk, but the amount of data erased depends on the system format.

For example, formatting with FAT destroys a large amount of data, rewriting that section of the disk with zeroes, significantly reducing the likelihood that you'll be able to recover your data. Some file systems, like NTFS, have a higher likelihood of recovery if they're overwritten with the same file system, while others actually have a smaller chance if they're overwritten with the same system—writing XFS over FAT makes it more likely for the FAT files to be recovered.

In the case of file system damage, the number of files that can be recovered depends on the extent of the damage and the allocation information available to the recovery software. If enough information is present for the recovery software to repair the file system and accurately locate previous files, you should be able to recover quite a bit.

Physical Drive Damage

Recovering files that have been deleted or formatted is one thing—getting files off of a damaged drive is another. While it doesn't take impressive technical skills to install and run recovery software, dealing with a heavily damaged drive is best left to the professionals, as it usually requires that the drive be taken apart.

Related: How to Repair a Dead Hard Disk Drive to Recover Data

Taking a drive apart without damaging it is difficult. Data recovery professionals only open damaged drives up in clean rooms, highly controlled environments free from almost all environmental pollutants. Even a single speck of dust that lands on a hard drive plate can cause the read/write head to crash and multiply the drive's problems. Static electricity can also damage the drive, so these rooms, the equipment used in them, and the clothing that technicians wear are all specially designed to minimize static.

When a hard drive fails because of physical damage, it can be related to several factors, such as a broken controller board or a crashed head. Occasionally these issues can be fixed by replacing the broken part, but in general, if there's physical damage to the hard drive, you're going to need some serious work done by the professionals.

If you get your drive to a data recovery specialist, they'll take a number of steps, from rebuilding parts of the hard drive to creating a disk image and doing their best to repair the corrupted parts using sophisticated software. The cost of the rebuilding, proprietary imaging technologies, and maintenance of the clean rooms are what can drive the cost of professional data recovery upwards of several thousand dollars (though some providers are now able to offer more affordable rates).

Solid State Drive Data Recovery

Recovering data from a solid-state drive is more difficult than recovering data from a traditional hard drive. However, a number of the same techniques can be used to recover data that's been deleted or formatted.

However, recovering data from a physically damaged solid-state drive is very expensive. For example, when my SSD crashed, the estimate for data recovery was about $3,500. A white paper [PDF] estimate puts this as the average for SSD recovery if the recovery specialist had not received tools and specifications from the manufacturer; that cost drops to about $700 if the manufacturer provides support.

Don't forget, data recovery specialists can charge anything up to three or four hundred dollars per hour for their highly-specialized services. So although data recovery prices have fallen, it's still a very expensive process, especially for solid-state drives.

Your Best Bet: Backup Your Data

Data recovery software and specialists can do a great job of getting your data back, but it's risky, time-consuming, and expensive. The best measure you can take to prevent long-term data loss is the one we've been advocating for a long time: make lots of backups! Use a cloud backup provider, keep a backup hard drive in your home, and make sure you don't get caught out by a power surge or accidental formatting.

The most important thing to remember when it comes to data recovery is to remove all power to the drive experiencing data loss as soon as possible. Whether HDD or SSD, the sooner you stop any activity on the drive, the more likely you will recover your lost data.