防止macOS中Spotlight在移动硬盘或者U盘中创建索引
禁止用做时间机器备份
1 |
|
.fseventsd
文件夹:文件系统日志记录
可在.fseventsd
文件夹下面建立no_log
文件来取消这个功能
.ds_store
文件
- 防止在 USB 存储设备中创建
.ds_store
文件
1 |
|
- 防止在网络驱动器中创建
.ds_store
文件
1 |
|
以._
开头的文件
- 删除已存在的文件
1 |
|
.DocumentRevisions-V100
Spotlight 索引文件
在移动硬盘或者U盘根目录创建.metadata_never_index
文件
1 |
|
给这个文件添加保护
1 |
|
这些文件或者文件夹的作用:http://blog.hostilefork.com/trashes-fseventsd-and-spotlight-v100/
其他解决方案
参考:https://forums.macrumors.com/threads/solved-prevent-hidden-files-creation-on-usb-drives.2022099/
You can try this out. It may still include .fsevents, .DocumentRevisions, .TemporaryItems and .Trashes. I kind of think it may be unavoidable to create certain file system structures when introducing a volume. The Spotlight stuff and the .ds_stores you can take care of though. Try these out and see if they help. Probably best in the order their given but I really can’t verify if it matters or not.
Prevent MDS from attempting to Index
1 |
|
Disable Indexing AND Searching of Volumes
1 |
|
Delete existing Spotlight Index
1 |
|
Disable creating ‘.ds_store’ on USB volumes
1 |
|
Disable creating ‘.ds_store’ on network volumes
1 |
|
Sorry if this makes your machine explode, implode, hack NORAD, “Friends” you with Justin Bieber or any other unexpected results.
关闭所有内置磁盘的 Spotlight 索引
sudo mdutil -a -i off
关闭外部硬盘的 Spotlight 索引
sudo defaults write /Library/Preferences/com.apple.SpotlightServer.plist ExternalVolumesIgnore -bool True
防止在网络驱动器上创建.DS_Store 文件
defaults write com.apple.desktopservices DSDontWriteNetworkStores -bool TRUE