MainspringGuides › Shared USB Drives
macOS Guide

Keep .DS_Store files off shared USB drives

Updated August 2026 · 4 min read

There's a USB drive that lives on everyone's desk in turn — the one you pass around to move a project between machines. Every time it comes back it's a little messier: hidden .DS_Store files scattered through folders, showing up for whoever opens it on Windows. One setting on each Mac stops the drive from collecting them, and the shared drive stays as clean as the day you formatted it.

Why the drive keeps filling up

A .DS_Store file (Desktop Services Store) is Finder's per-folder memory: it records icon arrangement, window size, sort order, and view style. macOS writes one into any folder it displays — including folders on a removable drive — so that the next time you open it, the view looks the way you left it. The catch on a shared drive is that every Mac that opens a folder writes its own. Pass the drive between three people and it accumulates the file in three sessions' worth of folders. To Mac users it's invisible; to anyone on Windows or Linux, it's clutter in plain sight.

Stop your Mac contributing to it

There's no toggle in System Settings for this — it's a single defaults command in Terminal:

# Don't write .DS_Store to USB / removable drives
defaults write com.apple.desktopservices DSDontWriteUSBStores -bool true

# Undo
defaults write com.apple.desktopservices DSDontWriteUSBStores -bool false

The setting takes full effect after you log out and back in (or restart), since Finder reads it at the start of your session. It behaves identically on macOS 13 Ventura, 14 Sonoma, and 15 Sequoia.

Every Mac on the drive needs it

This is the part that trips people up with a shared drive. The command only stops your Mac from writing the files — it does nothing for your teammates' Macs. If three people share the drive, all three need to run it (once each) for the drive to truly stay clean. Send them the one-liner above, or the Settings-free tool below, and confirm each has logged out and back in. Until everyone's on board, the drive will keep collecting .DS_Store from whoever hasn't set it yet.

Wipe the ones already on it

The setting is preventive, not retroactive, so scrub the existing files once with the drive mounted:

# Remove every .DS_Store already on the shared drive
find /Volumes/SHARED_DRIVE -name .DS_Store -type f -delete

Swap SHARED_DRIVE for the drive's actual name under /Volumes. Run it after everyone has the setting on, and the drive stays tidy from then on.

Easy to roll out to a team

Mainspring makes this a labelled, one-click toggle — the simplest thing to ask a teammate to flip instead of pasting Terminal commands. It's one of 90+ hidden macOS settings turned into reversible switches.

Try Mainspring free →

Signed & notarized by Apple · 1-day free trial · $29 once

Sharing over the network too?

If the same files also live on a shared server everyone connects to, that's a different key. See how to stop .DS_Store on network drives on Mac for the DSDontWriteNetworkStores setting.