Essex carer took her own life as calls for help with husband went 'unanswered'
'Nightmare neighbour' who turned front garden into rat-infested 'tip' ordered to clear it up by council
Reddit Issuing 'Formal Legal Demands' Against Researchers Who Conducted Secret AI Experiment on Users
Read more of this story at Slashdot.
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 LossData 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.
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 LossThe most critical step is to minimize system activity on the affected drive. Any write operation can potentially overwrite recoverable data.
Disconnect and Mount Read-OnlyIf 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 ImageUse 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 EnvironmentTo 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.