Ext2/Ext3/Ext4 file system (FS) is the main file system for the Linux environment, including many Linux-based network attached storage (NAS) devices. For many Linux distros, this is the default file system. Ext2/3/4FS disks cannot be recognized by Windows or macOS machines without special third-party software. This means that if the disk is used exclusive on a Linux machine, it's very likely that the disk is formatted as Ext2/3/4FS.
In this article, we'll walk you through a typical Ext4FS data recovery scenario: we'll show you how to use R-Studio to get your files back after an Ext4FS disk was reformatted. The same technique may be used for reformatted NAS RAIDs, provided that you can assemble them in R-Studio. See R-Studio help for details: Volume Sets and RAIDs.
Before We Begin
If you are following along our procedure with your own data recovery scenario, it's important to make sure that your situation is similar enough to our test case. Make sure to check the following before proceeding:
The drive you are attempting to recover is a disk with a reformatted Ext2/3/4FS partition.
This article only applies to Ext2/3/4FS formatted devices. If you need to recover data from other disks, see our other articles:
Your disk is in good physical condition
We presume that your disk is in good physical shape. If not, it's best to seek out the services of a professional data recovery specialist. Beyond checking that the cables are firmly connected, any "do it yourself" data recovery efforts may actually worsen your chances of recovering the data if your disk has a serious physical malfunction. Signs that a disk has a physical failure include:
All these cases are best handled by qualified data recovery professionals. They have special equipment, software, and, most importantly, the required skills to work with such drives. Neither R-Studio nor other data recovery software will help you in such cases. Moreover, any further tampering with such a drive will very likely inflict more damage to your data. Quite often, such damage will render the data completely irrecoverable, even by a data recovery professional.
And one last reminder...
Do not write anything on the disk from which you're going to recover data! The new data may overwrite your old files, and you may lose them for good.
Test Disk Setup: Initial Folder Structure and Files on the Drive
To show you the recovery process, we prepared a test disk with a typical set of user files that may be on an Ext4FS disk distributed over a certain folder structure.
Documents:
Multimedia:
The root folder of the test disk is shown in Fig. 1.
Fig.1: Root folder of the test disk
Click image to enlarge
After setting up the files, we performed a disk reformat using the Disk tool in Linux. Upon doing this, the disk will initially appear completely blank.
Data recovery process
Preliminary preparation:
1. Connect the disk to the computer running R-Studio.
Note: Disk scans and data recovery operations can take a long time to process, particularly if the capacity of the disk is very large. For this reason, it's important to use the fastest interface available. The fastest interfaces are SATA/eSATA and USB 3.0. Many external drives will have one or more of these interfaces. USB 2.0, while most common, is the slowest interface and may not be sufficient for larger disks.
2. Start R-Studio and locate the reformatted disk and the disk where the recovered files will be stored.
Fig.2: R-Studio main panel with the reformatted disk
Click image to enlarge
Before proceeding, check the S.M.A.R.T. attributes for the reformatted disk:
If the S.M.A.R.T. attributes of the disk are OK, we can start data recovery.
3. Select the reformatted disk and click the Scan button. The Scan dialog box will appear.
Fig.3: Disk scan dialog box
Click image to enlarge
Since we know the file system from which we are trying to recover, we can improve R-Studio's results and performance by specifying the file system of the reformatted disk. Click the Change... button next to File Systems and leave only the Ext2/Ext3/Ext4 file system selected. Also, it's a good idea to save scan info for the disk in case you have to stop data recovery and resume it later. The next time you open the disk in R-Studio, you won't have to re-scan the disk; you can simply reload the scan information from the previous session.
4. Check that the Extra Search for Known File Types option is selected and click the Known File Types... button.
Fig.4: Known File Types dialog box
Click image to enlarge
Specify only those file types that you believe resided on the deleted disk. The best way to do that is to click the Clear button and then select the necessary types in the list. Then click the OK button and return to the Scan dialog box.
5. Click the Scan button. R-Studio will start scanning the disk. The progress of the disk scan will be shown.
Fig.5: Disk scan in progress
Click image to enlarge
6. Inspect the scan results and find the recognized partition that corresponds to the deleted disk.
Fig.6: Scan results
Click image to enlarge
In our case, this is the Recognized1 partition.
If other partitions previously existed on the disks, R-Studio may find them. You will have to determine which of the recognized partitions is the one you are looking for. In most cases, the partition you are attempting to recover will be the same size as the existing logical disk. See R-Studio online help for more details: Data Recovery Using R-Studio.
7. Double-click the Recognized1 partition. R-Studio will enumerate the files on it and show the folder tree.
Fig.7: Files and folders found on the reformatted disk
Click image to enlarge
When Linux reformats an Ext4FS disk, it completely erases all traces of the previous file system and the constituent files can only be found by their file signatures. This method of data recovery is known as a "raw file recovery" or a "search for known file types." The folder structure, file name, timestamps, and other attributes cannot be recovered using this method.
R-Studio sorts files recovered from a raw file recovery according to their types and names and autogenerates a filename, such as 0265.docx. In some cases, R-Studio can attempt to recreate meaningful file names and timestamps from information and file attributes stored in the file's tags or metadata.
If you are searching for a particular file or set of files, you can use the advanced find and mark capabilities of R-Studio. See R-Studio help for more details: Searching for a File.
8. Use the built-in Previewer to estimate chances for successful data recovery. This is particularly useful with large picture files. Double-click a file to preview it.
Fig.8: File preview
Click image to enlarge
If several files appear correctly, you can purchase a license and register R-Studio. Now you may start saving recovered files.
9. Select the files and folders you want to recover and choose a location to save the recovered files.
Fig.9. Files marked for recovery and recovery options
Click image to enlarge
If necessary, specify other recovery parameters. See R-Studio on-line help for details: Basic File Recovery. Then, click the Recover Marked button.
10. R-Studio will start recovering files showing its progress.
Fig.10: Data recovery process
Click image to enlarge
11. When the recovery finishes, R-Studio will show a final report with the recovery results.
Fig.11: Data recovery results
Click image to enlarge
Data recovery results
To view the recovered files, browse to the folder you selected in step 9 of the data recovery process.
Fig.12: Data recovery results
Click image to enlarge
For our test scenario, we managed to recover all files from the reformatted disk. But the information about the original folder structure, file names, and other attributes was lost. R-Studio named some files using the information from the tags and attributes of those files.
Conclusions
If you have an Ext2/3/4FS disk that has been accidentally reformatted, try performing the steps above in the demo mode of R-Studio. If you can successfully find and preview the files you are looking for, go ahead and register the product to get your files back. Attempting a data recovery on an accidentally formatted disk using R-Studio is risk-free, provided that the disk is in good physical shape and that no new data is written to the disk. In many cases, you can recover 100% of your data, even if some of the file information is lost (such as file names and folder structures). R-Studio can even glean some of this file information from metadata and tags.