Ext4 Undelete: How to Recover Deleted Files on EXT4

Brithny updated on Oct 12, 2024 to Data Recovery | How-to Articles

The Extended File System's latest edition - the Ext4, has been in the news for some time now, especially for Linux. However, many users may end up deleting some files by mistake. Thus, learn how to recover deleted files from Ext4 Linux here. EaseUS data recovery software makes it easy to get back Linux data.

"Recently, I deleted some important files by mistake in the Linux system with an Ext4. How may I recover them?" This is one of the most commonly asked questions! This file system serves the roles of data storage, namespace, security model, application programming interface (API), and implementation in a computer system.

How do I recover deleted files on ext4?
byu/leonheartx1988 inlinuxquestions

Unintended removal of Ext4 Linux partitions and overall disk format, disk re-partitioning of the hard drive, a glitch in the partition disk, a cracked superblock, a malware infection, a software re-install, and a system restore of the computer network are among the most likely reasons (we will discuss these in detail later) of data loss from Ext4 Linux partitions.

Fortunately, Ext4 data recovery is feasible and may be completed on a Windows machine with a few simple steps. Throughout this article, you will learn about the ext4 file system and the most successful methods to recover deleted files from Ext4 Linux using reliable data recovery software. Let's get started!

Top Method. Ext4 Recover Deleted Files with Linux Recovery Software

If you are looking to recover deleted files, we recommend competent software that can help you do that. EaseUS Data Recovery Wizard is an excellent file recovery application. Additionally, it's an excellent option for individuals to recover data that has been lost or erased.

Here's the best part: EaseUS Linux data recovery software may be used on Linux systems such as MX Linux and Manjaro.

Linux users may easily restore any deleted files, folders, or directories using the program. Using this tool, users may restore deleted files from a Linux machine operating on a Windows PC. EaseUS Data Recovery Wizard may use any storage device to retrieve deleted data. This includes hard disk drive data and data from SSDs and SD cards. RAW file systems that your operating system does not recognize may also be restored.

Step 1. Install and Launch EaseUS Data Recovery Wizard on your Windows PC. Choose "NAS & Linux" on the left panel and click "Linux Recovery". This software will detect your IP and Port automatically. You need to input the user name and password. If the IP address or Port is not right, you can correct it manually. 

Step 2. After successfully connecting to your Linux device, select the deleted files you want to recover. You can click on the filter to display only the file types you want. If you remember the file name, you can also search in the search box, which is the fastest way to find the target file.

Step 3. You can preview the scanned files first. Then, select the target data and click the "Recover" button to restore lost files in Linux. 

Method 2. Recover Deleted Files on Ext4 with Extundelete

Ext4 data recovery is possible with open-source data recovery software, and you can apply extundelete. This command line utility can be used to recover files from popular Linux file systems, including Ext4. It is especially helpful for retrieving files that were unintentionally erased or lost as a result of system failures or other problems.

You may need to install this tool first with the following command lines:

  • Ubuntu and Debian: sudo apt install extundelete
  • RHEL and CentOS: sudo yum install extundelete
  • Arch Linux: sudo yay -S extundelete

 Then, check the following guide to recover lost files with extundelete:

Step 2.  Enter sudo extundelete --file name /dev/sdb1 to recover a specific file on Ext4 Linux. It's important to enter the correct file path to undelete files successfully.

Step 3. Enter sudo extundelete --restore-all /dev/sdb1 to restore all missing items.

Method 3. Restore Deleted Files on Ext4 with Ext4magic

Besides extundelete, you can also apply ext4magic to perform Ext4 undelete. ext4magic tool is designed to undeleting files from ext4 file systems. It can analyze the file system metadata. Check the following command lines to learn more about Ext4 file recovery:

Step 1. Enter the following command to install ext4magic:

  • Ubuntu and Debian: sudo apt install ext4magic
  • RHEL and CentOS: sudo yum install ext4magic
  • Arch Linux: sudo yay -S ext4magic

Step 2. Enter sudo ext4magic -l /dev/sda1 to list all the recoverable files on Linux.

Step 3. Enter sudo ext4magic -r 12345 /dev/sda1 to choose the number of the file you want to recover.

Step 4. If you want to recover all files, type in sudo ext4magic -R /dev/sda1.

If you find these two command-line file recovery utilities helpful, please share them with other Linux users by clicking the following buttons.

 

Learn More About Linux Ext4 File System

Ext4 began as a series of extensions to Ext3. Ext3 was a development of Ext2, a descendant of Extfs, the initial Linux-specific file system. Rémy Card and colleagues developed Extfs to solve the constraints of the MINIX file system used by Linus Torvalds in the original Linux kernel. Andrew S. Tanenbaum's MINIX (1987) is a Unix-like operating system.

The guy wrote it for the sake of higher education so that UNIX could be taught without having to pay a significant price for the genuine thing. The MINIX file system has limits. Hence, Extfs was used to "expand" it.

🎯Addition to Linux Kernel (Ext4dev) in 2006

Ext4 was included in the Linux kernel (Ext4dev) in 2006 and the repositories in 2008. It's a journaling file system (as of Ext3) that keeps track of pending and implemented modifications.

It differs from your journal in that its most recent entries predict what will happen rather than what has happened. If you will, consider it a day planner/journal hybrid. Journaling (optional) allows you to rapidly correct file system faults without using software (e2fsck) to scan the whole data structure, looking for anomalies.

🎯A Root/Tree Filing System

Ext4 is a typical root/tree file system having a boot sector, partition table and employs inodes (index nodes) to represent files and objects, similar to the Unix File System.

It provides transparent encryption, employs checksums on metadata (journal and other), supports TRIM, and employs delayed allocation. Ext4 stores data until it can find the shortest and most efficient method to write it via delayed allocation. This improves speed and raises the potential that data will not be written in the event of a power outage. In this circumstance, journaling reduces the risk of data loss.

🎯When Should You Use Ext4

Because Ext4 is a fast, tried-and-true file system that also happens to be the default file system for Linux, it's an excellent choice for end-users like Tux.

It is possible that using Btrfs or OpenZFS will be a superior solution for NAS devices, servers, or any other case where fault tolerance and data integrity are more critical than performance.

Why Do You Lose Data on Linux Ext4 Partition

The most probable causes of data loss from Ext4 Linux partitions, which will be explored in further detail here, are as follows:

  • 💻Factory Reset: Many PC manufacturers offer a factory reset function that enables you to return your device to its factory settings. However, doing so can result in the loss of any data saved on your local hard drive.
  • ⌛Re-install System: To properly re-install the system, the administrator must ensure that all of the required checkboxes are ticked. After the system has been installed, selecting the erroneous option by clicking on it and selecting it again may result in the loss of a partition.
  • 🚫Corrupt/Broken Superblock: When the Superblock is broken or corrupted, the extended (EXT) disks are rendered inaccessible to the user.
  • ⚠️Error in the Partition Table: "Insufficient memory," "sudden power outages," and "unexpected system shutdown" are all examples of difficulties that might result in incorrect partition table entries (file system errors).
  • ❎Re-Partition Disk: If you re-partition your hard drive, you may accidentally format it or delete a partition. During re-partitioning, errors may arise that were not anticipated.
  • ❗Disk Format: Formatting entails erasing everything on the hard disk, including all of the partitions and data.
  • 🗑️Linux Partition Deletion: The possibility of a partition being mistakenly deleted while handling disk partitions using partition managers such as GNU Parted FDisk or GParted should be considered.

You can share these potential reasons on social media to help more Linux users avoid data loss.

 

The Bottom Line

You would need a quick and trustworthy third-party data recovery program would be required to recover deleted files from Ext4 Linux from your Windows system. While Linux has built-in compatibility for NTFS partitions, the Windows operating system cannot natively read Linux partitions. It must rely on third-party data recovery tools to do this.

The EaseUS Data Recovery Wizard is the most widely used and dependable data recovery solution presently available. The program is the fastest and most effective available for data recovery from Ext4, Ext3, and Ext2 Linux partitions on Windows.

 

Linux Ext4 Undelete FAQs

Here are some extra questions and answers about Ext4 undelete:

How to restore deleted files in Ext4?

If you don't have backups, you can restore deleted files in Ex4 with the following methods:

  1. 1. Apply EaseUS Data Recovery Wizard - User-friendly interface
  2. 2. Apply extundelete - Command line tool
  3. 3. Apply ext4magic - Command line tool

How do I recover permanently deleted files in Linux?

When the files are permanently deleted from a Linux computer, you cannot recover them with software. You should restore these deleted files from recent backups.

Can I undelete files in Ext4 without command line tools?

If you don't want to use command line tools to undelete files in the Ext4 Linux file system, try EaseUS Data Recovery Wizard.

  1. Step 1. Choose NAS & Linux on the left panel, and choose Linux recovery. It will detect your IP and Port automatically.
  2. Step 2. After successfully connecting to your Linux device, select the deleted files you want to recover.
  3. Step 3. Preview and select the target data and click the "Recover" button to restore lost files in Linux.