MAC OS X 10.9. Summary of the method of starting SSD trim with the command line under X

Time:2022-4-13

Many of the online searches are the old methods of the past and do not support the 10.9 system. I upgraded 10.9.2 two days ago. Today, I suddenly found that the trim status has been reset to No. It was not reset from 10.9 to 10.9.1 last time. Just now I searched “trim command line” on Baidu. The first one came out was an article by everyone. I tried it and it was useless. Later, I found the following methods after traveling many places, and the personal test can be used:

1、 10.9 10.9.1 10.9.2 10.9.3 method of starting SSD trim

Open the terminal and enter the following command:

1. For security, this step is the backup driver (enter the password as prompted)

Copy code

The code is as follows:

sudo cp -r /System/Library/Extensions/IOAHCIFamily.kext/Contents/PlugIns/IOAHCIBlockStorage.kext/ /System/Library/Extensions/IOAHCIFamily.kext/Contents/PlugIns/IOAHCIBlockStorage.BACKUP

2. Start trim

Copy code

The code is as follows:

sudo perl -pi -e ‘s|(\x52\x6F\x74\x61\x74\x69\x6F\x6E\x61\x6C\x00{1,20})[^\x00]{9}(\x00{1,20}\x54)|$1\x00\x00\x00\x00\x00\x00\x00\x00\x00$2|sg’ /System/Library/Extensions/IOAHCIFamily.kext/Contents/PlugIns/IOAHCIBlockStorage.kext/Contents/MacOS/IOAHCIBlockStorage

3. Clean up cache

Copy code

The code is as follows:

sudo kextcache -system-prelinked-kernel
sudo kextcache -system-caches

5. Restart the system.

After restart, go to little apple in the upper left corner = > about this computer = > more information = > system report = > SATA / SATA express. Select your SSD on the right and check the value of “trim support” below.

Look, your trim has been opened!

2、 10.9.4 and 10.9.5 methods of starting SSD trim

1. Backup

Copy code

The code is as follows:

sudo cp \
/System/Library/Extensions/IOAHCIFamily.kext/Contents/PlugIns/IOAHCIBlockStorage.kext/Contents/MacOS/IOAHCIBlockStorage \
/System/Library/Extensions/IOAHCIFamily.kext/Contents/PlugIns/IOAHCIBlockStorage.kext/Contents/MacOS/IOAHCIBlockStorage.original

2. Modify the document

Copy code

The code is as follows:

sudo perl -p0777i -e <a href=”mailto:’[email protected]((?:Rotational|WakeKey\x0a)\x00{1,20})APPLE”>’[email protected]((?:Rotational|WakeKey\x0a)\x00{1,20})APPLE</a> SSD(\x00{1,20}[QMT])@$1\x00\x00\x00\x00\x00\x00\x00\x00\[email protected]’ \
/System/Library/Extensions/IOAHCIFamily.kext/Contents/PlugIns/IOAHCIBlockStorage.kext/Contents/MacOS/IOAHCIBlockStorage

3. Create system kernel expansion folder

Copy code

The code is as follows:

sudo touch /System/Library/Extensions/

4. Restart