¿Qué es el comando TRIM y cómo utilizarlo de forma segura?

el comando trim en los SSD

En Comando TRIM is an SSD management feature that allows the operating system to tell a solid-state drive which data blocks are no longer in use. This helps the SSD manage free space efficiently and maintain consistent write performance over time.

In Windows 11 and Windows 10, TRIM is normally managed automatically, but you can check its status, enable or disable it, and manually optimize an SSD when necessary.

In this guide, we’ll explain how the TRIM command works, how to check and use TRIM on Windows, Linux, and macOS, and what TRIM means for Recuperación de datos SSD if files are accidentally deleted.

Índice

¿Qué es exactamente el Mando de recorte?

En Comando TRIM is a storage instruction that allows an operating system to tell an SSD which logical blocks are no longer being used by the file system.

When you delete a file, the operating system can send a TRIM notification for the blocks that previously stored that data. The SSD controller can then treat those blocks as unused and reclaim them during its internal cleanup and garbage-collection processes.

TRIM does not simply “delete files faster.” Its main purpose is to help the SSD manage unused space efficiently so future write operations do not have to spend as much time reorganizing or preparing previously used blocks.

In practice, TRIM can help:

  • maintain consistent SSD write performance;
  • reduce unnecessary internal data movement;
  • improve free-space management;
  • support the SSD’s long-term efficiency.

Modern operating systems generally manage TRIM automatically when both the storage device and the storage stack support it.

Why SSDs Need TRIM

Las unidades SSD almacenan los datos en celdas de memoria flash. Estas celdas no pueden sobrescribir datos antiguos directamente.

Por tanto, antes de escribir nuevos datos, la unidad SSD debe borrar primero los bloques existentes.

En comando recortar ayuda a resolver esto:

  • reducir los retrasos de escritura
  • mejorar la velocidad a largo plazo
  • menor desgaste de las células de memoria

Debido a estos beneficios, la mayoría de los expertos recomiendan mantener el comando trim SSD función activada.

How to Check TRIM Status in Windows 11/10

Muchos usuarios quieren confirmar si el comando está activo.

Afortunadamente, Windows proporciona un sencillo método integrado.

Paso 1: Abra el símbolo del sistema como administrador

  • Buscar “cmd”
  • Haga clic con el botón derecho del ratón en
  • Elija “Ejecutar como administrador”

Paso 2: Ejecute el comando TRIM Status

Tipo:

fsutil behavior query DisableDeleteNotify

Step 3: Understand the TRIM Status

After running the command, Windows may display results such as:

NTFS DisableDeleteNotify = 0

or:

NTFS DisableDeleteNotify = 1

Here is what they mean:

  • DisableDeleteNotify = 0: TRIM/delete notifications are enabled for the file system.
  • DisableDeleteNotify = 1: TRIM/delete notifications are disabled.

A value of 0 means Windows is configured to send TRIM notifications when supported. However, this setting alone does not guarantee that every connected SSD or storage controller supports TRIM.

Cómo activar TRIM en Windows

Si TRIM está desactivado, puede activarlo ejecutando:

fsutil behavior set DisableDeleteNotify 0

Después de eso, Windows empezará a utilizar el recorte automáticamente.

How to Disable TRIM in Windows

In most cases, you should leave TRIM enabled. However, if you need to temporarily disable TRIM for testing or troubleshooting, open Command Prompt as administrator and run:

fsutil behavior set DisableDeleteNotify 1

To enable it again, run:

fsutil behavior set DisableDeleteNotify 0

You can verify the current setting at any time with:

fsutil behavior query DisableDeleteNotify

For normal SSD use, keeping TRIM enabled is generally recommended.

How to Manually Run the TRIM Command in Windows 11/10

Windows normally optimizes supported SSDs automatically, so most users do not need to run TRIM manually. However, you can trigger SSD optimization yourself when troubleshooting performance or checking drive maintenance.

Method 1: Use Optimize Drives

  1. Open Windows Search and type Desfragmentar y optimizar unidades.
  2. Open the Optimize Drives utility.
  3. Select your SSD.
  4. Haga clic en Optimice.

Windows recognizes supported solid-state drives and performs the appropriate SSD optimization rather than treating them like traditional hard drives.

Method 2: Run ReTrim with PowerShell

Abre PowerShell como administrador y ejecuta:

Optimize-Volume -DriveLetter C -ReTrim -Verbose

Sustituir C with the drive letter of the SSD you want to optimize.

En -ReTrim option sends TRIM/UNMAP hints for unused sectors to the underlying storage device.

Cómo utilizar el Recorte en Linux

Linux provides the fstrim utility for sending discard requests for unused blocks on supported filesystems and storage devices.

Check Discard/TRIM Support

Corre:

lsblk --discard

This displays discard-related information for each block device. Devices that report supported discard capabilities may support TRIM or a similar discard operation.

Manually Run TRIM

To trim the root filesystem, run:

sudo fstrim -v /

You can also trim all supported mounted filesystems with:

sudo fstrim -av

Use Scheduled TRIM

Many Linux distributions provide an fstrim.timer service for periodic TRIM. Where available, you can enable it with:

sudo systemctl enable --now fstrim.timer

For typical desktop and server systems, periodic TRIM is usually preferable to running fstrim unnecessarily often.

Cómo gestiona macOS el Mando de recorte

macOS activa el recorte automáticamente en las unidades SSD de Apple.

Para unidades SSD de otros fabricantes, puede activar TRIM mediante:

sudo trimforce enable

Apple recomienda utilizarlo sólo con unidades compatibles.

Why TRIM Makes Deleted SSD Data Harder to Recover

TRIM can significantly reduce the chance of recovering deleted files from an SSD.

When a file is deleted, the operating system may notify the SSD that the corresponding logical blocks are no longer needed. The SSD controller can then reclaim those blocks as part of its internal garbage-collection process.

Once the underlying NAND pages containing the deleted data have been erased or are no longer accessible through the SSD controller, conventional recovery software generally cannot reconstruct the original file data.

This is one of the key differences between recovering deleted files from an SSD and recovering them from a traditional HDD.

However, TRIM behavior is not identical in every situation. Recovery results can vary depending on the SSD, controller, operating system, file system, storage interface, and whether TRIM was actually issued and processed.

Qué hacer inmediatamente después de la pérdida de datos en una unidad SSD TRIM

If important files are deleted from an SSD, minimize activity on the affected drive immediately.

  • Stop copying or downloading files to the SSD.
  • Avoid installing software on the affected SSD.
  • Do not format, initialize, or run unnecessary repair operations on the drive.
  • If possible, install recovery software on another healthy drive.
  • Save any recovered files to a different storage device.

TRIM can reduce the recoverability of deleted SSD data, but there is no universal time limit such as 10 minutes or 30 minutes. Whether files remain recoverable depends on whether the relevant blocks have already been processed by the SSD.

Can Data Be Recovered from a TRIM-Enabled SSD?

Sometimes, but recovery from a TRIM-enabled SSD can be much more difficult than recovery from a traditional HDD.

If TRIM has already been processed and the SSD controller has reclaimed the affected blocks, the deleted data may no longer be accessible to recovery software. However, recovery may still be possible in other SSD data-loss scenarios, including damaged file systems, RAW partitions, inaccessible volumes, or cases where the relevant data blocks have not been cleared.

como recuperar datos para trim command drive

If the SSD is still detected by Windows, Magic Data Recovery can scan the drive for recoverable files. Install the software on a different healthy drive whenever possible, and never save recovered files back to the affected SSD.

For a detailed explanation of what can and cannot be recovered, see our Guía de recuperación de datos de SSD.

Compatible con Windows 7/8/10/11 y Windows Server

Conclusión

En Comando TRIM is an important part of modern SSD management. It allows the operating system to notify an SSD about unused blocks, helping the drive manage free space and maintain efficient write performance.

On Windows 11 and Windows 10, TRIM is normally handled automatically. You can check its status with fsutil behavior query DisableDeleteNotify, enable or disable delete notifications with fsutil, and manually retrim an SSD through Optimize Drives or PowerShell when necessary.

Keep in mind that TRIM can also make deleted-file recovery more difficult. If important data is lost from an SSD, stop using the affected drive and avoid writing new data to it. If the data is still recoverable, Magic Data Recovery puede scan the SSD and help restore accessible files to another storage device.

Preguntas frecuentes

¿Qué es el comando trim en un SSD?

Es una instrucción que ayuda a las unidades SSD a gestionar eficazmente los bloques eliminados. Indica a la unidad qué datos ya no son necesarios, lo que permite una limpieza más rápida y un mejor rendimiento. Sin embargo, también puede reducir el tiempo disponible para la recuperación de archivos tras un borrado accidental.

¿Cómo puedo comprobar si la función de recorte está activada en Windows?

Puede comprobar el estado del comando trim ejecutando fsutil behavior query DisableDeleteNotify en Command Prompt. Un resultado de 0 significa que TRIM está activado, mientras que 1 significa que está desactivado. Esto ayuda a confirmar si su SSD utiliza la limpieza automática de bloques.

¿Cómo puedo activar el recorte en mi SSD?

En Windows, puede activar la función SSD del comando trim ejecutando fsutil behavior set DisableDeleteNotify 0. En Linux, puede activar fstrim.timer. TRIM mejora la velocidad del SSD, pero también hace que la recuperación sea más urgente tras la pérdida de datos.

¿El comando recortar borra permanentemente los archivos eliminados?

El comando recortar no borra los archivos al instante, sino que marca los bloques para su limpieza. Una vez que se ejecuta la recolección de basura, los datos borrados pueden desaparecer permanentemente. Por este motivo, la recuperación debe iniciarse rápidamente, especialmente en unidades SSD compatibles con TRIM.

Can Magic Data Recovery recover files from a TRIM-enabled SSD?

It depends on whether the deleted data is still accessible. If TRIM and subsequent SSD cleanup have already made the original blocks unavailable, recovery software cannot restore those erased contents. However, Magic Data Recovery can still scan for recoverable files and is useful for other SSD data-loss scenarios such as RAW partitions, file-system corruption, inaccessible volumes, and some formatting cases.

¿Cuál es el equivalente en Linux del comando trim?

Linux utiliza el comando fstrim para realizar el recorte de SSD. Ejecutando sudo fstrim -v / se borran manualmente los bloques no utilizados. Esto mantiene el rendimiento del SSD estable, pero también significa que los datos borrados pueden ser más difíciles de recuperar con el tiempo.

¿Debo desactivar el comando trim para una mejor recuperación?

No se recomienda desactivar la función de SSD de comando de recorte porque el rendimiento de la SSD puede disminuir. En su lugar, mantenga TRIM activado y confíe en las copias de seguridad. Si se produce una pérdida de datos, utilice inmediatamente un software de recuperación como Magic Data Recovery.

Does Windows 11 automatically run TRIM?

Yes. Windows 11 normally manages SSD optimization automatically when the SSD and storage stack support TRIM. You can check the current TRIM notification setting with fsutil behavior query DisableDeleteNotify. You can also open Optimize Drives to review or manually run SSD optimization.

What command manually trims an SSD in Windows?

In PowerShell, you can manually send TRIM requests to an SSD volume with Optimize-Volume -DriveLetter C -ReTrim -Verbose. Replace C with the appropriate drive letter. Windows also lets you manually optimize an SSD through the Optimize Drives utility.

Jason es un especialista en recuperación de datos y asistencia técnica con más de 15 años de experiencia práctica. Ha trabajado intensamente con usuarios finales, resolviendo casos complejos de pérdida de datos y ofreciendo soluciones prácticas de recuperación para eliminaciones accidentales, unidades formateadas, sistemas de archivos dañados, particiones perdidas, fallos del sistema y otras situaciones de emergencia relacionadas con la recuperación. Su experiencia también abarca las copias de seguridad y la restauración, la reparación de archivos y la recuperación ante desastres, con especial énfasis en ofrecer una orientación segura, fiable y técnicamente precisa.