Safecopy is a command-line data recovery tool that copies from failing or damaged storage devices by skipping problematic areas and using incremental passes to minimize further damage, making it suitable for live Linux sessions where you need to image a dying drive safely.
Alternatively, you may utilize the rTS Debian live media created in this guide which already comes with Safecopy pre-installed.
Information
safecopy is one of the preinstalled packages for our r/Techsupport Rescue Media. If you are using this live image, you can skip the installation section.
How to install Safecopy
Refer below for installation instructions if you are not using our live image or want to install it on your own system.
Safecopy reads from a source (failing disk/partition) to a destination (image file or another disk) by jumping over bad areas with adjustable skip sizes and retries, then backtracking precisely to find readable edges.
It supports multiple passes: start fast to grab good data, then incremental runs on bad areas only.
Important: Identifying the source and destination drives
Always double-check which drive is source and which is destination before running safecopy, because mixing them up can destroy your only copy of the data.
Maximum retries/low-level access on remaining bad blocks
Naturally the higher the stage, the more time it will take, but it can recover more data from bad areas. You can also customize the parameters for each stage further if needed.
Sometimes you want a clone on another physical drive rather than an image file. The command is similar, but the destination is a disk instead of an image. Do note this method is riskier because if you accidentally choose the wrong destination disk, you could overwrite important data.
Terminal window
sudosafecopy--stage1/dev/sdX/dev/sdY
Where /dev/sdX is the failing source disk and /dev/sdY is the healthy destination disk (must be same size or larger). The format is similar to the image cloning method, but you specify a disk instead of an image file as the destination.
The same commands for retries and marking bad blocks can be used in disk-to-disk cloning as well, just replace the destination image with the destination disk.
Once you have an image or clone, you generally stop touching the failing disk and work only on the image or clone. You can mount the image, run filesystem checks, or use recovery tools like testdisk or photorec on the image or clone to try to recover files.
Always keep the original failing disk untouched after cloning to preserve it as a last resort if needed.