Trim command puzzle

Lankyman

macrumors 68000
Original poster
May 14, 2011
1,964
711
U.K.
I have a mid-2011 21.5 inch iMac into which I had fitted an SSD whilst keeping the original HDD in situ. That was 3 years ago. Fast forward to now and the HDD was showing signs of possible failure.

I decided to remove both the HDD and the SSD and fit a new larger capacity SSD (Intel 545s series) in the bay where the original HDD sat. I already had an unused OWC HDD thermal sensor so this further surgery was a pretty straightforward job. I did a clean install of High Sierra using the new APFS format.

The only fly in the ointment was enabling TRIM. Each time I entered the sudo trimforce enable command when I clicked the final Y to reboot I would get a message along the lines of 'I did not have permission to carry out this function' along with 01 error code.

What I have ended up having to do is go into recovery mode, open terminal and use the command 'csrutil disable' then reboot. Once I had done this the sudo Trimforce command worked and Trim is now enabled. I then had to go back into recovery mode, open terminal and use the command 'csrutil enable'.

I never had to do this with older versions of OS X. Is there a valid reason for having to jump through hoops or is it simply Apple trying to make things difficult for it's customers?
 

chrfr

macrumors G3
Jul 11, 2009
8,307
2,595
The "Trimforce" command does not normally require disabling SIP with the "csrutil disable" command. It sounds like something isn't quite right with your installation.
 

Lankyman

macrumors 68000
Original poster
May 14, 2011
1,964
711
U.K.
The "Trimforce" command does not normally require disabling SIP with the "csrutil disable" command. It sounds like something isn't quite right with your installation.
Doing an online search I noticed other users have experienced the same issue. The full message was as follows -
Are you sure you wish to proceed (y/N)? y

Your system will immediately reboot when this is complete.

Is this OK (y/N)? y

Enabling TRIM...

cp: /System/Library/Extensions/AppleDataSetManagement.kext/Contents/_CodeSignature/ CodeDirectory: Operation not permitted

cp: /System/Library/Extensions/AppleDataSetManagement.kext/Contents/_CodeSignature/ CodeRequirements: Operation not permitted

cp: /System/Library/Extensions/AppleDataSetManagement.kext/Contents/_CodeSignature/ CodeResources: Operation not permitted

cp: /System/Library/Extensions/AppleDataSetManagement.kext/Contents/_CodeSignature/ CodeSignature: Operation not permitted

cp: /System/Library/Extensions/AppleDataSetManagement.kext/Contents/Info.plist: Operation not permitted

cp: /System/Library/Extensions/AppleDataSetManagement.kext/Contents/version.plist: Operation not permitted

Operation failed (error 1).

Whatever this message means I have got around it by temporarily disabling SIP. I have run EtreCheck plus other diagnostics and no issues have been found at all. It is a puzzle.
 
Last edited:

Isamilis

macrumors 6502a
Apr 3, 2012
641
112
From the messages above, it shows the config process tried to copy (and maybe overwrite) system files. Therefore you need to disable SIP first to allow that process.

I haven't tried enabling TRIM, but that was happened on your case.

Hope this help.

Doing an online search I noticed other users have experienced the same issue. The full message was as follows -
Are you sure you wish to proceed (y/N)? y

Your system will immediately reboot when this is complete.

Is this OK (y/N)? y

Enabling TRIM...

cp: /System/Library/Extensions/AppleDataSetManagement.kext/Contents/_CodeSignature/ CodeDirectory: Operation not permitted

cp: /System/Library/Extensions/AppleDataSetManagement.kext/Contents/_CodeSignature/ CodeRequirements: Operation not permitted

cp: /System/Library/Extensions/AppleDataSetManagement.kext/Contents/_CodeSignature/ CodeResources: Operation not permitted

cp: /System/Library/Extensions/AppleDataSetManagement.kext/Contents/_CodeSignature/ CodeSignature: Operation not permitted

cp: /System/Library/Extensions/AppleDataSetManagement.kext/Contents/Info.plist: Operation not permitted

cp: /System/Library/Extensions/AppleDataSetManagement.kext/Contents/version.plist: Operation not permitted

Operation failed (error 1).

Whatever this message means I have got around it by temporarily disabling SIP. I have run EtreCheck plus other diagnostics and no issues have been found at all. It is a puzzle.
 

chrfr

macrumors G3
Jul 11, 2009
8,307
2,595
From the messages above, it shows the config process tried to copy (and maybe overwrite) system files. Therefore you need to disable SIP first to allow that process.

I haven't tried enabling TRIM, but that was happened on your case.

Hope this help.
The problem is that it's not normal to need to disable SIP to use the "Trimforce" command.