Wednesday, May 16, 2012

.Trashes, .fseventsd, and .Spotlight-V100

Merely plugging a removable drive into a mac (when it has write access) makes OS/X think it can take the liberty to write a lot of hidden garbage onto that disk. If you want to stop this from happening, you have to put some special files on that disk before you plug it in.

To stop OS/X from doing Spotlight indexing, you need a file called .metadata_never_index in the root directory of the removable drive.

To stop OS/X from making a .Trashes directory, you need to make your own file that *isn’t* a directory and call it .Trashes

To keep it from doing logging of filesystem events on the drive, you need to make a directory called .fseventsd and inside that folder put a single file named no_log

The contents of these files don’t matter, so you can make them empty files using touch. Even better, you could make it a text file with a link to this post, so that you (or someone else) wandering across the files will know what they’re for.

Apple’s choice to do this is incredibly self-serving and shameful. At bare minimum, hidden files and features like these should be off by default for any non-mac-only filesystem formats. They should only be enabled when the user has been made aware of them.