We are committed to providing fast, efficient, and affordable software solutions that set new standards in the software development industry.
  • File Recovery Specifics for SSD and Other Devices Supporting the TRIM/UNMAP command

(TRIM is a SATA command, UNMAP is its SCSI/SAS analog)

For years speed and capacity have been the most challenging parameters for storage devices. At the same time such devices should remain compact and not power-hungry, which is especially important for laptops and portable storage devices. Such devices should also be affordable to home and small business consumers. Electronic industry has come out with a rational solution: it offers solid-state drives (SSD) as ultra fast storage devices and 2.5" SMR hard drives as high-capacity yet compact and low-power-consuming storage devices. Respectively, SSDs are used primarily as system devices, scratch, and temporary storage devices due to their speed, while 2.5" SMR hard drives are used as high-capacity storages. And when both these types are used together, the overall hybrid system becomes very fast and capacious. Our article "How to Move the Already Installed Windows from an Old HDD to a New SSD Device and Create a Hybrid Data Storage System" explains how to create such a system.

Beside a lot of advantages, such devices have some drawbacks, especially when it comes to accidentally deleted or lost files recovery. In this article we will explain why it's so and what to expect when you recover files from a device with the TRIM/UNMAP command.

We'll start our explanations with some basic principles of their operations.

SSD devices
Most modern computers, even very inexpensive ones, have an SSD as their system storage device (and quite often the only one). Such devices are faster, run silently, consume less power, and more resistant to physical shock when compared to conventional hard disk drives.

There are two types of SSD devices which differ in their form factors: with the old 2.5" one (the same as for conventional HDDs) and a new one M.2, which looks similar to a memory plank.
Two form-factors of SSD storage devices: 2.5" (left) and M.2 (right)
Fig.1. Two form-factors of SSD storage devices: 2.5" (left) and M.2 (right)
Click image to enlarge

Unfortunately, such devices have also some serious drawbacks, with file recovery being one of them.

SSD Basics
When a file is deleted from a mechanical drive, the OS simply marks the disk area occupied by the file as free, but its data is left on the disk untouched until some new file overwrites it. When a data recovery program accesses the untouched area it gets the old data. That is how file recovery works.

An SSD however, must either use its new cells, or first purge the old data in the occupied cells to store the fresh data. Purging old data in SSDs is quite a slow process. That is why file deletion in an SSD works in the following way: when a user, program, or OS itself deletes a file, the OS issues the TRIM command that informs the SSD that the data is no longer needed. The SSD puts the cells the file occupied to a special pool to be purged later. When any program or OS requests data from those cells, the SSD simply returns garbage or zeros.

Moreover, the device constantly shuffles the data across its cells to level their wear, and only the device itself knows where the file data is stored at any given time. The OS has no control over this process, and furthermore, it has no means to know the actual physical location of the data.

This is why data recovery from SSD devices when the TRIM command is used is extremely difficult, and in most cases impossible.

SSDs are solid state storage devices, like other flash memory types (SD cards, memory sticks, and alike), but not all solid state storage devices are SSDs. R-Studio shows whether the flash device supports the TRIM command in the Features field on the S.M.A.R.T. tab.
TRIM support in SSD devices
Fig.2.TRIM support in SSD devices
Click image to enlarge

Hard drives with the SMR technology
The SMR (Shingled Magnetic Recording) technology is used to overcome the main obstacle for increasing capacity in compact hard drive: limitations for storage density. Unlike conventional hard drives which write data in non-overlapping magnetic tracks parallel to each other, SMR drives write data in partially overlapping tracks allowing for higher track density. Such recording resembles roof shingles, hence the name.

This technology indeed increases hard drive capacity, but when data is to be overwritten or deleted, this operation will affect a part of other overlapping tracks with the corresponding data, too. To save the data on the overlapping tracks, it should be written elsewhere, which makes this operation very slow. To accelerate this process, the same principles as in SSD devices and the same command TRIM are used. The effect to data recovery is the same: when any program or OS requests data from deleted files, the hard drive returns zeros or garbage, making data recovery extremely difficult or impossible.

Usually SMR disks bear a special mark on its case.
Hard drive with the SMR technology
Fig.3.Hard drive with the SMR technology
Click image to enlarge

R-Studio shows whether the hard drive supports the TRIM command in the Features field on the S.M.A.R.T. tab.
TRIM support in hard drives with the SMR technology
Fig.4.TRIM support in hard drives with the SMR technology
Click image to enlarge

Storage devices, OSs, and file systems that support the TRIM command
TRIM works when all three components support it: a storage device, operating system, and file system on the TRIM-supported device. Almost all modern SSD devices and 2.5" hard drives large than 1 TB support the TRIM command. As for complex volumes consisting of SSDs and SMR hard drives, it depends. Linux LVM2 and Windows software RAIDs support TRIM, whereas software RAIDs in macOS and most hardware RAID controllers don't.

Virtual disks of virtual machines are a little trickier. The fact that a virtual disk is stored on a TRIM-supported devices doesn't mean anything. For the host OS, this disk is a valid file and all disk operations of its virtual machine is read-write operations for that file. Inside the virtual machine with a virtual TRIM-supported disk, it all depends on the virtualization software. Some just simulate the TRIM command and return garbage without any actual changes on the SSD file, while some change file data.

Major OSs and file systems that support the TRIM command:

TRIM on/off by default File systems When TRIM is issued
Windows (7 and newer)
On NTFS and ReFS (Windows Storage Space only) Immediately upon deletion
macOS (Mac OS X Lion 10.6.8 and newer)
On on native Apple SSD devices
Off on non-native devices
APFS and HFS+ Immediately upon deletion
Linux (Kernel 2.6.28 and newer)
On on most distros, but depends on settings. Ext4, Btrfs, JFS, XFS, F2FS, NTFS Depends on distros and settings, usually weekly, but may be immediately upon deletion

How the TRIM command affects data recovery
Deleted files and formatted disks:
Windows and Mac: Almost always impossible. Even raw file recovery cannot help.
Linux: Possible if done before the TRIM command is issued.

Files lost in slightly damaged file systems (recognized by their native OS):
Every OS is gradually repairing such file systems using the TRIM command to delete garbage, invalid file records, and unnecessary files. Data recovery is possible if done fast and on systems with the TRIM command disabled.

Severely damaged file systems (not recognized by their native OS):
Data recovery is possible because the OS cannot repair them and doesn't delete any data.

How to minimize the negative effect of the TRIM command
Some steps can be made to minimize the negative effect of the TRIM command when the data recovery is possible.

  • Disable the TRIM command while recovering data. Don't forget to enable it once file recovery is complete.

Windows:
Press Win + X key key combination.
Windows PowerShell will appear:
Enter "fsutil behavior set DisableDeleteNotify 0/1"
(1 to disable, 0 to enable)

macOS:
In Terminal, enter "sudo trimforce disable"
Enter the administrative password, and answer "Y" to several questions.
The computer will automatically restart with TRIM disabled

To enable TRIM back, enter "sudo trimforce enable".

Linux:
Depends on distros and settings. Consult documentation for the particular installation.

Conclusion
Data recovery from TRIM-supporting devices operating on a major modern OS is mostly impossible for deleted files and formatted devices, and very difficult in other cases, at least when only software solutions are used. Anyone claiming otherwise is either incompetent or willfully deceiving their customers. The exception is a very small number of highly advanced data recovery companies with qualified personnel that in some cases can recover data deleted from an SSD device with the enabled TRIM command. Still, such procedure requires physical access to device's internal components and a lot of manual investigation.

This is why proper and regular data backup is especially important for computers with SSD storage devices. R-Drive Image, created by R-TT Inc., is a powerful and adored software for backing up SSDs and another storage devices. You can download its fully functional version and try it for 30 days with no restrictions.

Data Recovery Feedback
370 feedbacks
Rating: 4.8 / 5
I really love your R-Studio product, I am doing Data Recovery as a professional, I used RS since the early versions and I loved the product, as far as I can tell, R-Studio, especially the Tech Version (but including the standard) is one of the best and excellent tools for a pro to have in the arsenal of tools in a pro DR lab, especially combining with the specialized Data Recovery hardware providers like DeepSpar, and PC3000, the rest of `wannabees` out there are waste of time, strongly recommend
I lost more than 200K files from my NAS due to a mistake. I tried 3 different recovery solutions over the 4 TB raid disks, and all of them performed ok but to be honest none of them were able to Raw recover the files and rename them with meaningful names out of the Metadata like R-TT did, then I was able to sort again my files and pictures and kind of restore all of them.

R-TT may not be the easiest or most user-friendly solution, but the algorithm used for the renaming saved me THOUSAND of hours of opening ...
Just recovered my old ext4 partition with R-Studio after trying testdisk and R-Linux without success. That partition was overwritten by another ext4 partition and I was losing my hope until I tried R-Studio demo. It detected all my files and directories again!

Bought it and 100% recommend it for anyone with a similar issue.
Genuinely tried every free program available without luck of recovering a deleted file from months ago. Thinking my file was deleted forever and lose all hope I came across this website as a recommendation.

I was reluctant as it seemed pricey compared to other programs, but damn worth every penny. It managed to even find files I thought were wiped from existence.

Kudos to r-tools, thank you!
Why make incremental backups, when there is R-Studio?

I`m an IT professional who has worked from home for over a decade. Early on in my career, I configured an HP ProLiant Server (Raid 1+0) as a workstation that I would remote into from my laptop. As technology evolved, I began to use it only for email and as a config file repository.

A short while ago, one of the drives degraded, but the HP ProLiant Server (Raid 1+0) still functioned fine on the remaining drive. I was complacent and didn`t replace the ...