How to trim allocated space

Abstract: Explains how to enable and verify the TRIM command on Windows and macOS to maintain SSD performance and lifespan.

Created: 2026-08-13 by
The TRIM command informs your solid-state drive (SSD) which blocks of data are no longer in use and can be wiped internally. This process maintains write speeds, reduces power consumption, and extends the lifespan of your storage device by preventing unnecessary writes to already erased sectors.

Understanding Allocated Space and TRIM

When you delete a file from an SSD, the operating system typically removes the reference to that file from the file system table but does not immediately erase the actual data on the physical NAND flash memory. The space remains "allocated" from the perspective of the drive's controller until it is explicitly told to clear those blocks. This is where the TRIM command becomes essential. TRIM allows the operating system to communicate with the SSD controller, identifying exactly which blocks contain deleted data. By sending this information, the drive can perform garbage collection proactively rather than waiting for a write operation to trigger it. Without TRIM, SSDs suffer from performance degradation over time because they must erase large blocks of data before writing new information, a process known as write amplification. While mechanical hard drives do not benefit from TRIM due to their magnetic storage nature, all modern SSDs rely on this protocol for optimal performance. It is crucial to understand that TRIM does not recover data; it prepares the drive for future writes. If you are concerned about data recovery after deletion, note that TRIM makes recovery significantly more difficult because the underlying data is actively scrubbed. For more on recovering data when files have been overwritten or deleted, see Recovering Data from Accidentally Overwritten Hard Drive: A Tech Support Guide.

Checking TRIM Status on Windows

Windows 10 and Windows 11 enable TRIM by default for most SSDs. However, verifying its status ensures your drive is functioning correctly. You can check this using the Command Prompt with administrative privileges. First, open the Start menu, type cmd, right-click on Command Prompt, and select "Run as administrator." In the terminal window, enter the following command to check the optimization policy:
fsutil behavior query DisableDeleteNotify
If the result returns DisableDeleteNotify = 0, TRIM is enabled. If it returns 1, TRIM is disabled, and you should enable it by running:
fsutil behavior set DisableDeleteNotify 0
Additionally, you can verify if scheduled maintenance is active by checking the defragmentation settings through the Control Panel under "Optimize Drives." Ensure your SSD is selected and that "Run on a schedule" is checked.

Verifying TRIM on macOS

macOS supports TRIM on both Apple-branded SSDs and many third-party drives. To verify if your Mac is issuing TRIM commands, open Terminal and run the following command:
diskutil cs info $(diskutil cs list | grep 'Logical Volume' | awk '{print $NF}') | grep 'Firmware Version'
A more direct method involves checking the system report. Go to "About This Mac," click on "System Report," and select "Storage." Look for the "TRIM Support" field. If it says "Yes," your drive is supported and likely receiving TRIM commands. If it says "No," you may need third-party utilities like Trim Enabler, though this is generally unnecessary for modern versions of macOS. For users dealing with encrypted volumes, ensure that encryption layers do not interfere with TRIM operations. If you are managing encrypted disks, refer to How to Recover an Unknown TrueCrypt Encrypted Disk/Partition with a Known Password? for insights into how encryption impacts storage management.

Manual TRIM Execution

Although automatic scheduling handles most needs, you may occasionally need to force a TRIM operation manually. On Windows, you can do this via the Defragment and Optimize Drives tool. Select your SSD and click "Optimize." Windows will automatically detect that the drive is an SSD and issue a TRIM command instead of a traditional defragmentation. On Linux, the fstrim utility is used. Open a terminal and run:
sudo fstrim -v /mount/point
Replace /mount/point with the actual path to your mounted partition, such as / for the root directory. The -v flag provides verbose output, showing how many bytes were discarded. Regular manual execution is rarely necessary unless the automatic service fails. If you suspect your TRIM commands are not syncing properly with the drive's internal processes, consider reading Making Trim Work Synchronously: A Tech Support Guide for advanced troubleshooting steps.

Impact on Performance and Longevity

Enabling TRIM directly impacts the sustained write performance of your SSD. Without it, random write speeds can drop dramatically after the drive fills up, as the controller struggles to find empty blocks. With TRIM, the drive maintains near-original speeds even at high utilization levels. Furthermore, TRIM contributes to longevity by reducing the total number of program/erase cycles. SSDs have a finite lifespan measured in terabytes written (TBW). By ensuring that only necessary blocks are erased and rewritten, TRIM minimizes wear on the NAND cells. This is particularly important for drives storing critical data where failure is not an option. It is also worth noting that TRIM does not affect read speeds. Its primary role is in write efficiency and space reclamation. If you are experiencing slow JPEG file loading or corruption issues, these are often unrelated to TRIM and may require different diagnostic approaches, as detailed in JPEG Corrupted File Fixing.

Frequently Asked Questions

Does TRIM delete my data permanently?

Yes, TRIM marks deleted blocks as invalid and eventually erases them physically. This makes data recovery extremely difficult compared to standard deletion on HDDs. Always back up important files before relying on TRIM for security.

Can I disable TRIM to protect my data?

Disabling TRIM does not guarantee data protection, as forensic tools can still recover fragments. However, it prevents the drive from actively wiping deleted sectors. This is not recommended for performance reasons and offers only a temporary barrier against casual data recovery.

Does TRIM work on external SSDs?

Most modern external SSDs connected via USB 3.0 or Thunderbolt support TRIM. However, some older or budget models may not pass the TRIM command through the enclosure bridge. Check your manufacturer’s specifications to confirm compatibility.

Is TRIM the same as secure erase?

No, TRIM is a background maintenance command for performance, while Secure Erase is a one-time command that wipes all user data instantly. TRIM happens continuously in small increments, whereas Secure Erase resets the entire drive to factory state.

Why is my SSD still slow after enabling TRIM?

If TRIM is enabled but performance remains poor, check for firmware updates from the manufacturer. Outdated firmware can cause inefficient garbage collection. Additionally, ensure the drive is not nearly full, as low free space exacerbates write amplification regardless of TRIM status.

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