Linux Data Recovery: How to Salvage Lost or Corrupted Files

Linux Data Recovery: How to Salvage Lost or Corrupted Files

Data loss is a nightmare for any computer user, and Linux users are no exception. Despite the robust architecture of Linux operating systems, disasters can strike in the form of accidental deletions, corrupted partitions, or failing storage devices. Whether you're a system administrator, developer, or everyday Linux user, understanding how to recover data can be the difference between a minor inconvenience and a major setback.

This guide will walk you through the practical strategies and essential tools for recovering lost or corrupted files on Linux.

Understanding Data Loss on Linux

Common Causes of Data Loss

Data loss can occur for various reasons:

  • Accidental Deletion: Files removed with rm or cleared trash.

  • Filesystem Corruption: Caused by improper shutdowns, power failures, or software bugs.

  • Partition Issues: Misconfigured or overwritten partition tables.

  • Hardware Failures: Hard drive degradation, bad sectors, or failing SSDs.

How Deletion Works on Linux

Linux filesystems like ext4 don’t immediately erase data when a file is deleted. Instead, the filesystem marks the file's space as free. Until that space is overwritten, the data may be recoverable. This behavior is the cornerstone of most recovery techniques.

First Steps After Data Loss

The most critical step is to minimize system activity on the affected drive. Any write operation can potentially overwrite recoverable data.

Disconnect and Mount Read-Only

If the loss happened on a secondary drive, physically disconnect it and mount it read-only on another machine:

sudo mount -o ro /dev/sdX1 /mnt/recovery

Create a Disk Image

Use tools like dd or ddrescue to create a complete image of the drive for analysis:

sudo dd if=/dev/sdX of=/mnt/external/backup.img bs=4M status=progress

Or with ddrescue, which handles read errors more gracefully:

sudo ddrescue /dev/sdX /mnt/external/recovery.img /mnt/external/logfile

Work from the image to preserve the original drive.

Boot from a Live Environment

To avoid using the target system, boot into a Live Linux distribution like:

  • SystemRescueCD – tailored for system repair.

  • Ubuntu Live CD – user-friendly and widely available.

Continue ReadingLinux Data Recovery: How to Salvage Lost or Corrupted Files

Firefox 138 Released with Long-Awaited Profile Manager

At long last, Mozilla Firefox has native profile management features – and they don’t suck! The feature, which begins rolling out in today’s Firefox 138 update, is the latest “big ticket” feature the browser has belatedly sought to add, following recent long-requested supported for vertical tabs and tab grouping capabilities. Last month’s Firefox 137 release added the aforementioned tab grouping features, give its address bar a chip-laden overhaul, and flipped the switch on HEVC video playback on Linux. Firefox 138 has a number of notable changes to match those of its predecessor, so for a closer look at what they are, […]

You're reading Firefox 138 Released with Long-Awaited Profile Manager, a blog post from OMG! Ubuntu. Do not reproduce elsewhere without permission.

Continue ReadingFirefox 138 Released with Long-Awaited Profile Manager