忽然之间慢的要死

表现:

  1. 鼠标不灵
  2. 鼠标滚动很容易出现右键
  3. mds_store占用cpu超过100%
  4. 声音/电量/蓝牙/网络的图标展示的面板不在原位置, 反而在菜单处

log

  1. 重启,
    • 重启mac没用
    • 重启spot light
      ```sh

      参考: https://mefmobile.org/fix-mds_stores-high-cpu-usage-on-mac/#Fix_3_Restart_Spotlight

      关闭spot light

      sudo launchctl unload -w /System/Library/LaunchDaemons/com.apple.metadata.mds.plist

check下是否正常了

打开spot light

sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.metadata.mds.plist

之前没看到, 所以没做这个

2. 尝试解决mds_store问题
- https://apple.stackexchange.com/questions/144474/mds-and-mds-stores-constantly-consuming-cpu

```sh
# 关掉索引
sudo mdutil -a -i off
# 再开索引
sudo mdutil -a -i on
# 也没啥用
  1. 安装新版本, 解决了部分问题(问题4)
  2. 按照stackexchange的指引, 强制重建索引
    ```sh
    sudo rm -rf /.Spotlight-V100/*
    ls /.Spotlight-V100

    实际上, 我的文件貌似不在这里, 也不在~

    尝试看看索引情况

    ~ sudo fs_usage -w -f filesys mds_stores

    快疯了, 现实没完没了, 但是, 也找到了索引位置

    11:59:20.430667 PgIn[AT3] D=0x00c391a0 B=0x2000 /dev/disk1s1 /System/Volumes/Data/.Spotlight-V100/Store-V2/B7825230-32F2-4F93-8BAF-CEF86CC841EE/5.indexTermIds 0.000322 W mds_stores.22953

ls /System/Volumes/Data/.Spotlight-V100

不给展示, sudo都不行

sudo touch /.metadata_never_index_unless_rootfs
ls /.metadata_never_index_unless_rootfs

并没有新建成功

4. 最终使用排除机制
- system preference -> spot light -> pravicy
- 添加两个根目录: system 和 library
- 不知道会咋样, 再观察吧
- 最终排除了根目录下面一堆文件, 貌似可以了
- 一开始排除了整个硬盘, 把整个硬盘加回来, 似乎正常了. 不过据说要弄一天, 明天再看.

5. 把apple官方挂出来
- https://discussions.apple.com/thread/253598560
 - 解决方案是mac老三样
  - smc 三指操作
  - nvram/pram 四指操作
  - 重装系统
  - 神经病吧, apple 官方你好意思吗? 
- 另一个链接, 用户说mds_store超过100%, 官方装死, 毫无反应

6. 终于有这个命令可以定位问题
- - https://apple.stackexchange.com/questions/162227/how-to-isolate-processes-that-evoke-insane-mds-stores-disk-read-activity
```sh
mdutil -a -s

  1. 导致我都怀疑是不是有木马啥的了, 赶紧用趋势科技的杀毒查了一遍, 果然啥都没有

最终是一个悲剧结局: 不能呼出terminal/keychain等等

  1. 取消所有不搜索目录, 苹果又开始indexing了, 明天再看吧, 中午时好了, 哎, 不知道是啥情况了