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 have a file server with ubuntu installed

It is accessed usually through smb either from pc (ubuntu) or laptop (windows 7)

Sometimes it happens that folder names on the file server are changing to some meaningless name, like TOZC0N~L or TOJNL7~U

The hard disks seem to be fine, and I can´t imagine that samba is messing up folder names.

There is no rule really for this problem and I can´t reproduce it, it just happens sometimes. Any ideas?

Here's fstab

UUID=581C906F1C9049C0 /media/mext_2 ntfs defaults 0 0
UUID=4A466C6654E92192  /media/mext_4 ntfs defaults 0 0
UUID=EAB26EE9B26EB9A9 /media/mext_3 ntfs defaults 0 0

#Here's samba conf for one parititon
comment = Public Folder
path = /media/mext_2
available = yes
public = yes
valid users = elmasry
read only = no
browsable = yes
writable = yes

Its the same for other hard disks

share|improve this question

migrated from Mar 20 '12 at 22:46

This question came from our site for professional and enthusiast programmers.

@MoatazElmasry You need to provide more info. What is the full path of these directories? When are they changing (after reboot, while running, etc)? – Patrick Mar 21 '12 at 0:51
Are the folder names actually changing, as in you see that name on the file server, or is that just what Windows shows you? – AdmiralNemo Mar 21 '12 at 1:04
can you post the original folder names and tell me whether the files have the correct names as the originals. Really it would be handy to see your /etc/fstab, your smb.conf, the output of stat TOZC0N~L and even the output of ls -lah TOZC0N~L – Tom H Mar 21 '12 at 2:01
I added fstab smb confs. The I can't post the rest since I altered the names back to the original – Moataz Elmasry Mar 21 '12 at 18:57

Update: It was suggested to try the following fix - add these lines to smb.conf;

dos charset = 1255
unix charset = UTF-8
display charset = UTF-8

paste the output of this command;

[root@server-64634 ~]# testparm -s -v | grep "charset"
Load smb config files from /etc/samba/smb.conf
rlimit_max: increasing rlimit_max (1024) to minimum Windows limit (16384)
Processing section "[homes]"
Processing section "[printers]"
Loaded services file OK.
dos charset = CP850
unix charset = UTF-8
display charset = LOCALE

It kind of looks likes you might be seeing some old school dos naming to 8.3 style name conversions, or even iso 9660

Is any truly old school app opening and closing the files, or alternatively might be mounting the filesystem using some odd mount options that generates these converted names.

paste your /etc/fstab and your samba configuration for the client and server, showing your mounting and export options.

share|improve this answer
This was my first thought, but the 8.3 naming scheme is 123456~1 ... 123456~9 - also, TOZC0N could be the start of a real folder name, but it would be a weirdly named folder. – Mark Henderson Mar 21 '12 at 1:06
@MarkHenderson well i think this question is going to need a bunch of pasted outputs to make any more progress. – Tom H Mar 21 '12 at 2:03
I have a strong feeling this question is going to be abandoned since it was migrated, so I wouldn't get your hopes up. But yes, I agree. – Mark Henderson Mar 21 '12 at 2:04
@MarkHenderson damn because it is quite interesting ;-) – Tom H Mar 21 '12 at 2:07
I added the fstab and smb confs up there. maybe the names are too long, (>256) but as said no rule, sometimes it happens, I alter the folder names back to original, this time they don't get renamed – Moataz Elmasry Mar 21 '12 at 19:00

Really just a shot in the dark but... Since you said a Windows box is accessing the samba share is there maybe a virus on the windows box that is messing with things?

Maybe run an antivirus on the windows box and then run clamav on the ubuntu file server and see if something comes up.

Again, just a shot in the dark.

share|improve this answer
thnx for the reply, thought about it as well, but windows machine has been scanned. no virus and no weird behaviour :( sadly – Moataz Elmasry Mar 21 '12 at 18:57

I have seen this occur in a couple of scenarios, but only from the point of view of the Windows computer viewing the files over CIFS:

  • The full path name of the file is ridiculously long, approaching or exceeding 256 characters
  • The file name contains some character that is not valid on FAT or NTFS, such as an asterisk, backslash, or colon

In both cases, the only solution I've found is to rename the file to something appropriate for Windows to handle

share|improve this answer
this could be the case actually, but would windows alter the names immediatly after opening a mounted drive or upon accessing the the folder? because I certainly didn't access some of these folders recently, as I said its a weird behaviour and I can't reproduce this problem – Moataz Elmasry Mar 21 '12 at 18:59
I've never seen Windows actually rename the files in these cases, just appear to have the wrong name. I do see it sporadically as well, sometimes displaying the name correctly, some times not (same file). – AdmiralNemo Mar 21 '12 at 22:40

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.