Erased the disk with TRIM disabled and enabled it afterwards, will my previous data still be trimmed?

I owned a MacBook Pro with an original Apple-certified SSD. I erased my entire disk (using the erase option in disk utility) with TRIM disabled, then reinstalled the Mac OS and enabled it as soon as when I got into the system. Would my previous data still be trimmed?

Model: MacBook Pro 2017 13", running Mac Sierra. SSD name: APPLE AP0256J Media


Solution 1:

First, it is not the data per se that is TRIM'ed - it is the locations where the data is stored seen from the point of view of the operating system.

If your computer had been running a more recent version of macOS with APFS boot drive, it would automatically TRIM all unused locations at every boot. However, your computer is running a historic version of macOS that does not have this feature.

I would highly recommend upgrading your computer to a recent macOS version such as macOS Big Sur or macOS Monterey.

As far as I know, the macOS Sierra program for creating a new file system on disk ("mkfs") does not TRIM out the data blocks now considered empty.

As a quick fix, if you do not want to upgrade macOS, you could create a huge file on your disk taking up all disk space - and then remove that. It would trigger a TRIM of all the now empty locations on disk.

You can create such a huge file by running this command in the Terminal:

dd if=/dev/zero of=hugefile bs=1m

Then the command completes (i.e. the disk runs out of free disk space) - remove the hugefile file.