I tried stopping OS X from writing Spotlight and Trash files to a memory card. The method by Metaxis to the question here "How to stop OS X from writing Spotlight and Trash files to memory cards and USB sticks?" works fine and I have used it many times, but this time I wasn't paying attention and have addressed the wrong folder. The question how to stop in the original post

This is what I did including the responses and replacing my first name with first name and full name with myfullname:

MBP-van-firstname:~ myfullname$ mdutil -i off /Volumes/SD128MB
2016-03-02 22:57:40.638 mdutil[1232:208844] mdutil disabling Spotlight: /Volumes/SD128MB -> kMDConfigSearchLevelFSSearchOnly
Indexing disabled.
MBP-van-firstname:~ myfullname$ rm -rf .{,_.}{fseventsd,Spotlight-V*,Trashes}
MBP-van-firstname:~ myfullname$ mkdir .fseventsd
MBP-van-firstname:~ myfullname$ touch .fseventsd/no_log .metadata_never_index .Trashes
MBP-van-firstname:~ myfullname$ cd -
-bash: cd: OLDPWD not set

So, where the action were supposed to happen in the targeted folder, they were in the wrong folder. How can I undo this?


What Metaxis described looks like it can be reverted with the following:

mdutil -i on /Volumes/yourUSBstick
cd /Volumes/yourUSBstick
rm -rf .fseventsd/no_log .metadata_never_index .Trashes
cd -

The first line with mdutil is the most important if you want your volume to index again, as it sets the indexing status for the volume back to on, according to the manual:

-i on | off
     Sets the indexing status for the provided volumes to on or off.  Note that indexing may be delayed due to
     low disk space or other conditions. 


in your case (but this is specific to OP), you forgot to cd (change directory) into the volume before deleting the index files and adding a few files. You just need to delete the files you created locally (in your home folder):

rm -r .fseventsd/no_log .metadata_never_index .Trashes

No need to use mdutil to re-enable indexing on your drive as you did the first command right and only did a mistake after the second command.

| improve this answer | |

Looks like all you did was create some files. You can just delete them.

rm -r .fseventsd
rm .metdata_never_inded
rm .Trashes
| improve this answer | |
  • Thanks, I removed the files as LaX (and iWill) described. – Ur25V Apr 20 '16 at 20:46

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .