Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've read about filename limits in Linux but this is specifically about Samba.

I hit a problem where by both Windows and Linux clients to my (Debian Squeeze) Samba server were unable to access certain PDFs burried in a deep file path.

The filepath of the containing dir is 250 characters, which makes me suspect that there's a 255 character limit. (It's possible that it's less because of multibyte UTF8 characters.)

This would be massively less than a Linux filename/filepath limit.

Anyone know whether there is a way around this limit?

share|improve this question
up vote 2 down vote accepted

There has been a limit in Windows of 255 (or 260?) characters, as discussed in the SO question .

There apparently is a way in Windows to get around it, and there might be a way with SAMBA to emulate this, but this may break certain applications.

For ease of management, unless you have a compelling reason not to do this, I'd see if you can try creating shares deeper into the file hierarchy so the path isn't so long, use subst or an equivalent to a symlink to shorten the file path, or reorganize the share structure so it's not so deeply embedded. This would make the most compatible with a variety of applications; less likely to run into program errors down the road.

There is a patch/change to the source that can be applied to SAMBA that a recompile would fix, if you Google around for it. But again, that can be an administrative issue later because updates may break your custom fix.

Another alternative is to mount the share as an NFS share. I don't think the same ~250 character limit applies to NFS, but it won't be quite as "Windows" a solution if you do it this way.

Personally I'd restructure the share to have fewer characters; least headaches and random issues down the road to remember why something might be acting up or stop working.

share|improve this answer
Interesting that the linux CIFS mount client also dies at 255 limit. – artfulrobot May 30 '12 at 13:22

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.