11

Whenever I plug someone's FAT32 flash drive into my computer, MacOS loves to add all sorts of hidden files.

A couple of these include:
.Spotlight-V100/
.Trashes/
.fseventsd/
.DS_Store

When they get the drive back, they see all this cruft. How can I prevent this from happening?

Thanks!

0

5 Answers 5

8

These files and directories are created by various applications:

.DS_Store - Created by Finder when you open a directory. It stores information about the folder (view options, icon positions, etc).

.fseventsd - created by the fseventsd daemon. It contains data about file system events such as modifications, deletion, creation, etc.

.Spotlight-V100 - stores indexing information for spotlight in the form of metadata.

.Trashes - A folder containing files that have been sent to trash but not yet deleted from the volume.

In order to prevent them all from being created, you have to modify the behaviour of each application individually. That would include adding an exception to Spotlight, Disabling Finder's caching feature (if possible), changing the fseventsd daemon and so on. I'm not sure if it's even possible to add exclusions or disable all of these features. If you don't need to write to the disk, I'd just mount it as read only to make things easier.

3
  • Is there anything you don't know?! I need read/write access to the drive but I'm guessing MacOS doesn't have ability to add simple exceptions. Sounds like I might need an app for this-- if it's out there... ps. thanks (yet again) for the help.
    – macek
    Feb 5, 2010 at 16:48
  • Maybe it would be easier to mount as read only then copy the entire drive to your disk for modifications? I'm not sure exactly what you're doing but it might be a suitable solution. Regardless, you're more than welcome :)
    – user1931
    Feb 5, 2010 at 16:51
  • This answer provides details as to how it might be possible to fix the problem, but I'm not going to mark this as accepted because it does not actually provide a solution. Still an up-vote, though! Thanks for the info, John :)
    – macek
    Feb 9, 2010 at 19:23
4

Leopard & Snow Leopard make these files hidden. Mac OS X can be told not to put these files on network drives using:

defaults write com.apple.desktopservices DSDontWriteNetworkStores true
4
  • Are USB drives considered "network drives"?
    – macek
    Feb 5, 2010 at 16:51
  • I think this only prevents .DS_Store creation, but this is the right way to add an exception for that.
    – user1931
    Feb 5, 2010 at 16:52
  • I tried doing this and it only prevents .DS_Store
    – macek
    Feb 5, 2010 at 18:22
  • This doesn't seem to apply to normal USB drives at least on Lion.
    – Lri
    Feb 13, 2012 at 10:15
2

I don't know if saying "here's an app" is an OK solution to a problem, but I did some digging and found this:
http://www.zeroonetwenty.com/blueharvest/

Might be worth taking a look at but might not be worth $16.95...

EDIT:

I'm using BlueHarvest trial and seems to work very well. Because it provides the most complete solution for the original question, I'm marking this as the accepted answer.

2

There are two approaches.

One works on one machine for all flash drives, and stops the various services from writing to the drive. It's fairly complex, so I'll let thexlab explain it themselves at http://www.thexlab.com/faqs/stopspotlightindex.html

The other fixes one flash drive so you can poke into Macs and not have them index it. You have to put a few files on the flash drive BEFORE you plug it into a Mac, that tell the OS not to write various things. More info at http://hostilefork.com/2009/12/02/trashes-fseventsd-and-spotlight-v100/

between the two of them, they seem to have it covered. No, it's not perfect - if you carry a stick around and stick it into Macs, it HAS to have at least those few useless files on it. Oh, well.

1

Well, there's also this and it's free, u might want to throw a folder called autorun.inf too for security in windows

http://hostilefork.com/2009/12/02/trashes-fseventsd-and-spotlight-v100/

You must log in to answer this question.

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