← Media Renamer Pro

What breaks when you rename files over SMB and NAS shares

A rename is a metadata operation on your own disk. Over a network share, almost none of the assumptions behind that sentence still hold.

Buck Kettering ยท September 2026

A rename on your own SSD is a metadata operation. It either happens or it does not, it takes microseconds, and the file contents never move. Almost every assumption in that sentence stops being true over SMB.

Most renaming tools were written against a local disk and never revisited. Here is what actually differs, and what to do about it.

1. A rename over SMB is not guaranteed to be atomic

Locally, renaming within the same filesystem is a single directory entry update. Nothing is ever half-renamed.

Over a network share you are sending a request and waiting for an answer. The connection can drop between those two moments. The server may have completed the operation, may have partially completed it, or may have done nothing, and your client cannot always tell which.

This matters most when the operation is a replace: writing a new file over an existing name. If that is interrupted, the old file can be gone and the new one incomplete.

The defensive pattern is the same one databases use. Write the new content to a temporary name in the same directory, verify it, then rename it into place. The final rename is the smallest possible window, and on most servers it is the one operation you can still treat as close to atomic.

Same directory matters. A rename across filesystems, or across shares, is a copy followed by a delete, and the copy is where things go wrong. Keeping the temporary file beside the destination keeps it a real rename.

2. Check free space before you start, not per file

If your operation writes anything, and the share fills up on file 300 of 900, you now have a half-finished batch on a full volume, which is the worst state to recover from because cleanup itself may need space.

Ask the volume for free space once at the start, compare it against the total you intend to write, and add headroom. A pure rename does not need this. A convert, a repack, or a copy-then-delete absolutely does.

Remember that the free space a share reports can be a quota rather than the physical disk, and that some NAS systems report the pool rather than the share.

3. Extended attributes and Finder tags do not always survive

On macOS, colored Finder tags, Finder comments, and the "where from" metadata are all extended attributes hanging off the file. So are quarantine flags.

A rename in place preserves them, because the file never moves. A copy-then-delete usually does not, unless the tool explicitly copies the xattrs too. Many do not, and the loss is silent. If you have spent time tagging a library, you will not notice until you filter by a tag and half the results are missing.

SMB makes this worse, because whether extended attributes are stored at all depends on the server. Some map them to alternate data streams, some store them in AppleDouble files, some discard them.

The practical rule: prefer a real rename over a copy-and-delete whenever the source and destination are on the same share, and if you must copy, verify the attributes afterwards rather than assuming.

4. The case sensitivity question, and the only reliable answer

You cannot ask a share whether it is case-sensitive and trust the reply. Some NAS firmware answers wrongly. Some shares are case-insensitive on the server but backed by a case-sensitive filesystem, with edge cases when both spellings exist.

Renaming report.pdf to Report.pdf is a no-op, an error, or a real rename depending on which of those you got, and guessing wrong means either a failed batch or a file that quietly did not change.

Test it. Write a probe file with a mixed-case name, stat the lowercase version, delete the probe. One write and one stat, cached per volume for the session. It is milliseconds and it turns a guess into a fact.

write   .probe-CaseTest
stat    .probe-casetest
  found     -> case-insensitive
  not found -> case-sensitive
delete  .probe-CaseTest

Do it per directory if you have a mount that spans more than one backing volume, which happens more often than you would like.

5. Latency changes what a good design looks like

Locally, calling stat a few thousand times is free. Over SMB every one of those is a round trip, and a batch that felt instant on a local disk can take minutes on a share.

Two habits fix most of it. Enumerate a directory once and keep the listing, rather than checking existence file by file. And do collision checking in memory against that listing plus your planned destinations, instead of asking the server about every candidate name.

This is also why the two-phase approach is cheap in practice. It doubles the rename calls but it removes the need to interrogate the server about ordering.

6. Sleep, drop, and reconnect

Laptops sleep. Shares unmount. A long batch will meet both. Decide in advance what happens: stop and report, stop and roll back, or continue and summarize. Any of those is defensible. Silently skipping the failures is not, because the batch will report success with a short count and nobody looks at counts.

Keep a record of what completed, in order, so a rollback is possible at all. If your undo cannot survive the app quitting, it is not an undo for a batch that takes twenty minutes.

The short version

Rename in place rather than copy and delete. Write to a temporary name in the same directory and rename into position. Check space once, up front. Probe for case sensitivity rather than trusting the mount. Enumerate once instead of asking per file. And decide what a mid-batch failure does before you find out the hard way.

Related: why batch renaming eats files, and the two-phase fix and how to name TV and movie files so Plex and Jellyfin actually match them.

I write media tooling. Media Renamer Pro is my Mac, iPad and iPhone app that does the renaming described here, with a full preview before anything moves and an undo for the whole batch.

None of the above requires it. The naming rules are the naming rules whatever you use.