Formatted a Hard Disk or External HDD by Mistake? Here’s What You Can Do
Tags: beginners, testing, tutorial, test
Published: 2022-03-29 20:22:07

Read this article to find out what to do if you formatted a disk by mistake or accidentally and erased all of its data. Can the lost data be still recovered? How can you prevent such misfortune? What are the possible ways to bring the data back?

## Introduction
Sometimes due to a user’s mistake of for a number of other reasons the information on a hard disk or external drive becomes inaccessible. Quite often it happens because of formatting the device accidentally, when you select a wrong disk and erase all the data it contained.

After you ran a quick format operation on a hard disk or another storage device, it may seem the files are lost for good. Fortunately, things are not so bad. The data only becomes invisible and inaccessible for users. Yet if you apply specialized tools, it can be recovered. Below, we will see what happens when you format a hard disk, how data loss can be prevented, and what you can do to bring the lost files back.

## Quick Format for a Storage Device
Every device used for reading / writing data was formatted at least once. Formatting is basically the process of marking the data storage area and building a file system structure to enable access to such data. Without a file system, any operating system installed on a computer will not be able to interact with the hard disks, USB drives, memory cards and perform operations to save data. In other words, using a storage device without a file system is impossible.

There are many file system types. Windows uses NTFS, MacOS works with HFS +, Linux employs a series of various file systems (e.g., Ext3, ZFS etc). A USB flash drive and older versions of extremal hard disks will have FAT16 or FAT32. At first sight, all file systems share a common principle. However, they operate differently and have their own peculiarities, which makes some of them able (or unable) to interact with others.

For example, if you have a computer with a Windows operating system and connect a storage device with a file system that Windows cannot recognize, the operating system will suggest to format the device to able to access it. If you agree, you will lose all the data the device contains.

In other cases, when hard disks have certain issues with their physical elements or firmware, or there is no connection with the disk when the operating system tries to access it, the disk space is recognized as unallocated area, Windows will advise you to start formatting to eliminate the problem.

The process of formatting the hard disk will quickly free the disk space so you end up with an empty storage device. Yet the information it used to store is not removed. In fact, formatting only makes some changes to the file structure of the disk so the area where the files are kept is marked as available for new data to be written.

The first physical sectors of a hard disk (or another memory device) contain the file allocation table. When the disk is formatted, the data in these sectors is overwritten. Meanwhile, the majority of user data is still intact and it will be available for recovery until it is overwritten with new information.

Yet if you start writing new data to an accidentally formatted hard disk, the operating system will place it onto the old data (because the file system says the disk space is empty), and the older data can get overwritten easily, which significantly reduces the chances for its successful recovery.

So if you ever happen to format a disk by mistake, stop using it at once not prevent losing the old data due to overwriting.

## How to Prevent Formatting a Disk by Mistake or in a Wrong Way
From time to time, disk formatting can help to solve quite a number of problems such as boot issues, low performance, disk recognized as RAW, little free space left and so on. Therefore, formatting is a powerful tool to tackle disk issues and get the storage device ready for writing new data. However, if formatting was performed in a wrong way, with an incompatible file system or on a faulty disk, people can face all kids of unpleasant consequences, one of them being complete loss of data. In order to prevent this misfortune both now and in the future, note the following effective methods to protect your data from accidental formatting.

### Back up your disk regularly
Talking of preventing personal data loss, the most effective way is backup. You will always be able to restore the lost data (though it could be not the latest version, if you modified or edited the information after the last backup). Regardless of what caused a data loss (for example, such commonplace things as accidental or incorrect disk formatting), you can use a previously created or regularly updated backup to have your files back. In the latest version of Windows operating system, you can find several options for creating a backup and restoring data from there, and this is what the next part of the particle is about.

### Double-check the disk before formatting
Accidental and incorrect formatting actually result from being not attentive enough. So the easiest way to prevent data loss is to be very cautious when formatting a disk – and the warning messages shown by Windows will help you stay alert. For example, when you are going to format a hard disk or a specific partition, you should double-check your choice and make sure the correct disk is selected, and the data was copied to another device – or that it is of little value and can be erased.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kzml0y8s0lzinurhcy1a.png)

### Enable overwrite protection
Sometimes, especially when you deal with USB drives or various memory cards, there is a write-protect option to prevent accidental formatting. For example, most memory cards have an integrated switch to protect them from unauthorized overwriting. If a card is write-protected, you cannot save any files there, and, accordingly, formatting is out of the question too.

### Choose a proper file system
Besides the incorrect formatting of the wrong disk, another widespread cause of data loss is formatting into an incompatible file system. Therefore, before formatting a disk you need to decide on the operating system you would like to use with the storage device, and then select a corresponding file system for it. For example, if you want to use a hard disk in MacOS, you should format it into Hierarchical File System (HFS). If the disk is meant for Windows, to have your storage device recognized properly it should be formatted into NTFS or FAT.

### Don’t interrupt the formatting process
The last but not least, make sure that the device is not exposed to any external influences. Don’t let anything interrupt the formatting process. For example, if you are trying to format an internal hard disk in your laptop, make sure itis connected to a power outlet and the computer will not shut down because of low battery alarm. If the disk in question is an external one, wait until the formatting process is over and do not disconnect it from the computer. If you do, the storage device may be damaged, and the data inside it can be lost.

You can learn more about recovering files from USB drives by watching a video tutorial «How to Recover Deleted Files from a USB Drive after Formatting the Drive or a Virus Attack».

YouTube: {% youtube O3hSEyU2DFg %}

Peculiarities of Formatting Solid-State Drives (SSD)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/bu1dzpuootsb9yhhj2io.png)

The principle behind SSDs (solid-state drives) is different from that for conventional hard disks (HDDs) and is based on using NAND flash memory to store data. There are two main peculiarities. The first is that new data can be written to empty memory cells only. When a cell contains some data, it should be emptied before any new information can be entered. The second is that solid-state drives are much quicker to write data into empty cells than to clean cells in order to prepare them for writing operations.

That is why if an SSD is new or empty, write/read operations are very quick. When more data is written and removed, the write speed can decrease considerably in comparison with the brand new disk. Of course, such situation is unacceptable, so a special command TRIM was developed to initiate emptying the memory cells right after the command to delete files was given. This command is performed automatically, and right after deleting the files, cells are cleaned from data and ready for writing new data long before you actually add some information to your SSD. As a result, the disk performance is retained and the initial write speed is still as good as it was.

The command TRIM which is typical for any SSD, is applied by the operating system when deleting a file, formatting a disk, modifying the structure and number of partitions, or when applying other ways of freeing the disk space. It shows the disk controller the specific memory cells that have to be cleaned.

The process of physically cleaning the cells takes almost no time (according to the disk characteristics) and almost excludes a chance for subsequent recovery of data lost or removed as a result of formatting – except for a few conditions. Sometimes, the command TRIM is not applied which leaves some room for hope that data could be restored – for example, when a storage device was connected via USB (which is not supported by TRIM), when the storage device or its file system is damaged. Yet in most cases data recovery after formatting an SSD is impossible so the users will have to admit it is lost forever.