[Samba] Question marks, asterisks, colons in filenames

Jonathan Buzzard jonathan at buzzard.me.uk
Wed Feb 20 02:37:17 MST 2013

On Tue, 2013-02-19 at 20:50 +0100, Ray wrote:
> Hi,
> at home I only use Linux, so no problem there. Even all my Squeezebox 
> radios haven't got any problem with "special" characters, which is not 
> really a surprise, because under the hood they also run Linux.
> But I also run a site-to-site VPN and at the other sites there are some 
> lost souls with Windows boxes.
> I've put lots of work into naming all my files as close as possible to 
> the original naming (CDs according to CD cover, Movies according to 
> IMDB/Wikipedia, and so on). There's absolutely no way that I dump all 
> this work and surrender the excellent file naming capabilities of 
> ext[34] filesystem's (only "/" not working and for that one there's a 
> Unicode replacement) to Windows'/NTFS's poor file naming capabilitis for 
> a couple of Windows users.

The issue is that you have been abusing your file system to store
metadata in the file names. A practice that is always going to end in
trouble. For example what do you do when a filename for your chosen
metadata format exceeds the maximum length for your particular file

> Samba sits in the middle between the Linux side and the Windows side, 
> so to me it would be an obivous functional part of Samba to eliminate 
> individual characters from file names that are not permitted in Windows. 
> To my understanding this is exactly what "mangled map" did - before it 
> was kicked away from Samba's code. Don't get me wrong here: It's 
> absolutely ok to kick away obsolete code - but functionally there should 
> be some sort of replacement. To my understanding there's nothing new in 
> Samba that replaces "magled map": Now users are back to 8.3 name 
> hashing. Great. Welcome to DOS - in 2013!

The sensible option has always been if you are going to share the same
file space out under multiple protocols that you stick to using
characters in your file names that are common to all systems you intend
to use. The "mangled map" stuff just created more problems than it

>  From the responses I got to my initial question I understand that I 
> have to fix the problem on the Linux side: I will write a script that 
> copies my directory structure to a different location and eliminates all 
> "forbidden characters" from the folder names according to a scheme 
> similar to "mangled map". This will fix the folders. Then the script 
> will traverse all my directories for files and create hard links for 
> each file in the new directory structure. Here, also the "forbidden 
> character elimination scheme" will be applied, so in the end I have a 
> "Windows-clean' version of my file system (which I can then share out to 
> those Windozers) but am still able to keep the properly named files I 
> have.

The proper solution is to store all the metadata in the files
themselves, and then use a much simpler naming convention for the files.
As I pointed out previously any modern GUI file explorer will display
that metadata. Also media players do a much better job of displaying
this metadata if it is in the proper location rather than in the


Jonathan A. Buzzard                 Email: jonathan (at) buzzard.me.uk
Fife, United Kingdom.

More information about the samba mailing list