Rescue Failing SSD using Fedora and an External HDD without overwriting current contents

Abstract: Rescue data from a failing SSD on Fedora by creating a sector-by-sector image with ddrescue to preserve unreadable sectors without overwriting the source drive.

Created: 2026-08-19 by
To rescue data from a failing SSD on Fedora without overwriting its contents, connect the drive to an external HDD via a USB adapter or SATA port. Use lsblk to identify the device, then create a sector-by-sector image using ddrescue rather than copying files directly. This method preserves the raw structure and allows for retries if read errors occur, ensuring maximum data preservation before any recovery operations begin.

Preparation and Safety Precautions

Before attempting any data recovery, it is critical to understand that writing to a failing drive can accelerate its death. The primary rule of digital forensics is never write to the source media. Instead, you must create a bit-for-bit copy (an image) of the failing SSD onto a healthy storage medium, such as your external HDD. This image file becomes your working copy. If the original SSD fails completely during the imaging process, you still have the partial image saved on the external drive. Ensure your external HDD has sufficient free space. A 500GB SSD requires at least 500GB of free space on the destination drive, plus some overhead for metadata. Connect the failing SSD to your Fedora system. It is best to use a direct SATA connection if possible, as USB adapters can sometimes introduce latency or drop connections, which complicates error handling. If you must use USB, ensure the cable is high-quality and short.

Assumption: This guide assumes the failing SSD is detected by the kernel but may have unreadable sectors. If the drive is not detected in lsblk, hardware failure may be too severe for software recovery.

Identifying the Devices

Open a terminal and run the following command to list all block devices:
lsblk -o NAME,SIZE,TYPE,MOUNTPOINT
You will see output similar to this:
NAME        SIZE TYPE MOUNTPOINT
sda         1TB  disk 
├─sda1      512M part /boot/efi
└─sda2      999G part /
sdb         500G disk 
└─sdb1      500G part [failing]
nvme0n1   1TB  disk 
```

In this example, sdb is likely the failing SSD. Identify the target device carefully. Mistaking the external HDD for the source device will result in catastrophic data loss. Verify the size matches the failing SSD. Do not rely solely on names like sda or sdb, as these can change between reboots. Check the model name using lsblk -d -o NAME,MODEL to confirm identity.

Once identified, unmount any partitions mounted automatically by GNOME Disks or the file manager. You cannot image a mounted partition safely. Run:

sudo umount /dev/sdb1
If the drive has multiple partitions, unmount all of them. If the system refuses to unmount because a process is using it, find the process with fuser -vm /dev/sdb1 and terminate it, or reboot into a live environment if necessary.

Installing ddrescue

The standard dd command is risky for failing drives because it stops at the first error. ddrescue (GNU ddrescue) is designed specifically for this task. It skips bad sectors on the first pass and returns to retry them later, maximizing data extraction. Install it using DNF:
sudo dnf install ddrescue
Verify the installation by checking the version:
ddrescue --version
This tool provides robust logging capabilities, allowing you to pause and resume the imaging process if the system crashes or the drive disconnects temporarily.

Creating the Disk Image

Create a directory on your external HDD to store the image file. For example:
mkdir -p /run/media/user/ExternalHDD/recovery
Now, run ddrescue. The syntax is:
sudo ddrescue -f -n /dev/sdb /run/media/user/ExternalHDD/recovery/ssd_image.img /run/media/user/ExternalHDD/recovery/ssd_log.log
Breakdown of flags: - -f: Force overwrite of the output file if it exists. - -n: Skip the initial scraping phase. This makes the process faster by copying good sectors first and leaving bad ones for later. - /dev/sdb: The failing source device. - .../ssd_image.img: The destination image file. - .../ssd_log.log: The log file. This is crucial. It records which sectors were copied and which failed. Monitor the progress. ddrescue does not provide a percentage bar by default, but you can check the log file periodically:
cat /run/media/user/ExternalHDD/recovery/ssd_log.log
Look for the "Non-trimmed" section. These are sectors that could not be read. Once the initial pass completes, you can attempt to recover more data by running the command again without the -n flag:
sudo ddrescue -f /dev/sdb /run/media/user/ExternalHDD/recovery/ssd_image.img /run/media/user/ExternalHDD/recovery/ssd_log.log
This second pass attempts to read the previously skipped bad sectors. Repeat this step until the number of non-trimmed sectors stabilizes. Do not obsess over every single bad sector; focus on recovering the filesystem structures and important files.

Recovering Data from the Image

Once the image is created, you can work on the .img file instead of the physical drive. Mount the image loopback:
sudo mkdir /mnt/recovery_mount
sudo mount -o loop,ro /run/media/user/ExternalHDD/recovery/ssd_image.img /mnt/recovery_mount
Use the -o ro flag to ensure the image is mounted read-only. Browse the directory structure and copy valuable files to another safe location. If the filesystem is corrupted, use tools like testdisk or photorec on the image file to recover lost files based on signatures. For detailed guidance on accessing data from external drives with specific partition tables, refer to our article on How to Access Data on an External SSD Drive with MBR Only?. This resource explains how to handle legacy partition schemes that might complicate mounting. If you encounter issues where the drive is not recognized due to USB controller problems, check our troubleshooting guide for Fedora 40 Doesn't Recognize USB 3.0 Ports on Gigabyte Motherboard, as hardware compatibility can sometimes mimic drive failure.

Frequently Asked Questions

What if ddrescue reports many bad sectors?

It indicates significant physical damage to the SSD's NAND flash. Continue running ddrescue with multiple passes to maximize data retrieval, but expect some files to be unrecoverable. If the number of bad sectors increases rapidly, stop immediately to prevent further degradation.

Can I use rsync to copy the failing SSD?

No, rsync operates at the filesystem level and will fail when encountering unreadable blocks. It also writes to the drive indirectly through the OS cache. ddrescue works at the block level, bypassing the filesystem entirely, which is essential for damaged drives.

Do I need to zero-fill the external HDD before starting?

No, zero-filling is unnecessary and wastes time. ddrescue handles existing data on the destination drive gracefully by overwriting only the sectors it writes. Ensure there is enough free space, but pre-clearing the drive offers no benefit.

How do I know if the SSD is dead or just the controller?

If the drive appears in lsblk but shows 0 bytes or repeated I/O errors, the controller may be locked. Try changing the USB-SATA adapter or connecting via a different motherboard port. If the drive spins up (if mechanical) or lights up but is invisible in Linux, it may require specialized hardware tools beyond Fedora software solutions.

Is it safe to power off the computer during ddrescue?

Yes, because ddrescue uses a log file. When you restart the command, it reads the log and resumes exactly where it left off, skipping successfully copied sectors. Always include the log file argument in your command to enable this resume capability.

Latest News

How to Display Output of xterm Command in Terminal Screen using Cron

Resolve the inability to display xterm output in a terminal screen from cron by redirecting logs or using wall instead of insecure X11 workarounds.

Read More
Expose Local Server on VPS Preserving Real Client IPs (OS Level)

Resolve VPS logging showing only gateway IPs by configuring reverse proxies to forward real client addresses via X-Forwarded-For headers.

Read More
How to Clear Recent Files History in Linux without Deleting Actual Files?

Clear recent files history in Linux by deleting ~/.local/share/recently-used.xbel without removing the actual files.

Read More
Best HDD Copy Strategy: Manually Syncing and Rewriting Scratch

Resolve data drift between two 4TB hard drives by using rsync with the --delete flag to manually sync and rewrite scratch data for an exact mirror.

Read More
Understanding Bash Prompt Abbreviations: An Overview

Resolve repetitive typing errors by creating and persisting Bash aliases in the .bashrc file for improved command-line efficiency.

Read More
Free Tools and Methods to Log Real-Time Performance Details in Task Manager

Log real-time CPU and memory metrics to CSV files using Windows Performance Monitor Data Collector Sets to troubleshoot system slowness.

Read More
Contact Qatar Airways Customer Service: Phone Number, Help Center, and More

Resolve urgent Qatar Airways reservation issues like flight changes and baggage claims using the US phone number +1801-855-5905 or online self-service tools.

Read More
Windows 11: Alt Codes Displaying Wrong Characters - Solutions

Resolve Windows 11 Alt codes showing wrong characters by verifying the US keyboard layout and enabling Num Lock.

Read More
Run Programs with Elevated Privileges: A Comprehensive Guide

Eliminates the need to type sudo for frequent administrative tasks by configuring .bashrc aliases or functions.

Read More
Dynamically Changing Dates in Excel Formulas Using Cells

Eliminate manual date updates in Excel by using cell references to create dynamic formulas that automatically adjust calculations when input dates change.

Read More
Granting Edit Access to a Specific Excel Sheet in an Office 365 User Email ID-Based Login

Excel Online lacks native sheet-level permissions, so users must split workbooks or use worksheet protection to isolate edit access for specific tabs.

Read More
Creating Network Load on Local Wi-Fi from One PC

Generate sustained Wi-Fi bandwidth load from a single PC using a VM SFTP server to test router stability and throughput.

Read More
Changing the Default Editor for Batch Files in Windows 11's File Explorer

Resolve the issue of batch files opening in Notepad by changing the default editor to a preferred application like VS Code.

Read More
Gain WiFi Connection Minutes Before Losing it by Changing MAC Address

Bypass MAC address filtering to restore WiFi connectivity temporarily when a device is blocked by network administrators.

Read More
Photos Folders Turned Black: Troubleshooting Picture Applications on Windows

Resolve black screens in Windows Photos by resetting the app, updating graphics drivers, and repairing system files.

Read More
Troubleshooting High CPU Temperature Values: A Step-by-Step Guide

Resolve high CPU temperatures and thermal throttling by monitoring with Speedfan, cleaning dust from cooling components, and replacing degraded thermal paste.

Read More
Make cURL establish TLS connection with CA unknown

Resolve cURL TLS connection failures with unknown or self-signed certificates by using the --insecure flag to bypass CA validation.

Read More
Troubleshooting Incorrect Network Metrics Values in Grafana, Prometheus, InfluxDB, and Telegraf

Fix incorrect network metrics in Grafana, Prometheus, InfluxDB, and Telegraf by verifying interface selection, resolving unit mismatches, and handling counter resets.

Read More
Start Another Terminal Window (cmd.exe) Windows Repair/Troubleshoot

Provides step-by-step instructions to access the Windows Command Prompt via bootable media for advanced system repair and troubleshooting.

Read More
Thinkpad P1 Gen 6: Sudden Thunderbolt 3 Dock USB-C Charging Stopped Working

Resolve sudden Thunderbolt 3 dock USB-C charging and internet failure on ThinkPad P1 Gen 6 by updating firmware, resetting the dock, and adjusting power settings.

Read More
ASUS Windows 11 Laptop: Internet Connection Issue with Hotspot

Resolve ASUS Windows 11 laptop spinning wheel issue when connecting to mobile hotspot by resetting network stack, disabling IPv6, and adjusting power settings.

Read More
Developing iOS Project with Firebase: Logging in and Sending Push Notifications

Integrates Firebase to enable secure user authentication and push notifications in iOS applications.

Read More
Troubleshooting Bash Script with Suspected Issues of Spaces, Dashes, Filenames and Quoting

Resolve Bash script failures caused by word splitting, globbing, and special characters in filenames by applying proper quoting techniques.

Read More
Populating OneDrive Folder for Local Backup without Affecting Remote Files

Prevent OneDrive from deleting remote files during Windows reinstallation by unlinking the account or using symbolic links to isolate local data.

Read More
Force First Frame as Keyframe Without Re-encoding: A Quick Solution

Resolve inaccurate seeking and playback glitches by re-encoding video to ensure the first frame is a valid keyframe.

Read More
Find Information in Database Using WSL (Ubuntu) on Windows-10

Resolve database connection issues from WSL Ubuntu on Windows 10 by configuring client tools and network access to query remote or local servers.

Read More
Configuring a New Router with Different Networks: One Family, One Guest

Resolve IP conflicts and isolate guest traffic by configuring a second router with a distinct subnet via its WAN port.

Read More
Quickly Open Multiple Stock Websites with a Single Command

Solve the problem of manually opening multiple stock research websites by creating a single command to launch them simultaneously on Windows, macOS, or Linux.

Read More
Improved Adobe Acrobat Search Experience: Access Advanced Search with Ease

Access advanced search filters like case sensitivity and regex in Adobe Acrobat by clicking More Options in the Find bar.

Read More
Port Forwarding VM via OpenVPN: A Comprehensive Guide

Configure OpenVPN server and iptables to forward specific ports from VPN clients to a virtual machine's internal IP address.

Read More
Understanding Partitions in the 1980s: A Look Back at MS-DOS and Master Boot Record

Explains how the Master Boot Record and partition table enabled MS-DOS to manage multiple disk volumes on a single physical drive.

Read More
Windows 10 Enterprise: Keyboard Not Detected in Managed Organization with Admin Privileges

Resolve Windows 10 Enterprise keyboard detection failures caused by Group Policy restrictions, driver corruption, or USB enumeration errors.

Read More
Can't Find x86_64 Versions of Applications on MacOS arm64 (M1)

Resolve missing x86_64 app issues on M1 Macs by installing Rosetta 2 and reinstalling apps as universal binaries.

Read More
How to Hide Installation Source for an Android App

Manage Android app installation source visibility by using USB transfers or file managers to reduce browser traces and isolate data via work profiles.

Read More
Connecting Momentus 4200.2 ST9808210A Hard Drive via USB Cable

Resolve inability to access Seagate Momentus 4200.2 ST9808210A hard drive by connecting it via USB using a compatible SATA-to-USB adapter and configuring the disk in Windows.

Read More