禁用 Mac OS X 的系统完整性保护(SIP)

mds和mds_stores 占用资源过高,想禁用但提示已启用 SIP 无法禁用,需要进入Mac 的恢复模式先禁用 SIP;

禁用 mds 报错

$ sudo launchctl unload -w /System/Library/LaunchDaemons/com.apple.metadata.mds.plist
Password:
/System/Library/LaunchDaemons/com.apple.metadata.mds.plist: Operation not permitted while System Integrity Protection is engaged
1
2
3

查看当前 SIP 的状态,已启用。

$ csrutil status
System Integrity Protection status: enabled.
1
2

重启电脑,按住 Command + R,进入恢复模式

顶部菜单栏找到实用工具 -> 终端,输入

$ csrutil disable
Successfully disabled System Integrity Protection. Please restart the machine for the changes to take effect.
1
2

重启电脑后,可以正常禁用 mds 了。

$ sudo launchctl unload -w /System/Library/LaunchDaemons/com.apple.metadata.mds.plist
Password:
/System/Library/LaunchDaemons/com.apple.metadata.mds.plist: Operation now in progress
1
2
3

reference