Garbled filenames on samba clients

Folks,

When looking at files being shared via Samba on my home network I see meaningless filenames like “1YB7MH~E” and incorrect filesizes.
I see these strange filenames on all systems I have connected via Samba, also if I look at the files via samba on the computer containing the files.
When I look at the files directly on the computer serving up the files all is fine.

Samba version 3.6.7-48.20.1-2992-SUSE-SL12.2-x86_64.
Network: Card: Realtek RTL8111/8168B PCI Express Gigabit Ethernet controller driver: r8169
IF: eth0 state: up speed: 1000 Mbps duplex: full

Any ideas?

Maybe the file encoding you specified (either directly or by default) on the clients is not the same as that on the server. Basicaly either of them can be wrong (or even both) but as you say that 1YB7MH~E is “meaningless” (whoever teached you that filenames must have a meaning?), I guess it is on the clients.

And as you only showed us one of th “meaningless” ones, but not the corresponding “meaningfull” file name, I can not even guess whatever the file encoding mishap can be.

Do you see the same thing on more than one PC or is it only the one? How many Samba and Windows clients are there on your network? What version of openSUSE do you use? With openSUSE 12.3, I have Samba 3.6.12-59.5.1. I ask that you take a look at my blog on Samba here:

S.A.C.T. - Samba Automated Configuration Tool - Version 1.06 - Blogs - openSUSE Forums

You could tell us about your PC(s), how long you have been using openSUSE and if this has ever occured before.

Thank You,

Gents,

There are three computers on the network, one running Suse 11.2 and two running Suse 12.2.
One of the Suse 12.2 systems is the server.
Currently there is no native Windows system.
The garbled filenames are consistent on all systems.
To me that points to a problem on the server Samba software.
I have not seen this problem before.

Here is the output from the smb and nmb status check


nmb.service - LSB: Samba NetBIOS naming service over IP
          Loaded: loaded (/etc/init.d/nmb)
          Active: active (running) since Mon, 27 May 2013 17:46:55 +0200; 1h 47min ago
         Process: 4294 ExecStop=/etc/init.d/nmb stop (code=exited, status=0/SUCCESS)
         Process: 1421 ExecReload=/etc/init.d/nmb reload (code=exited, status=3/NOTIMPLEMENTED)
         Process: 4304 ExecStart=/etc/init.d/nmb start (code=exited, status=0/SUCCESS)
          CGroup: name=systemd:/system/nmb.service
                  └ 4313 /usr/sbin/nmbd -D -s /etc/samba/smb.conf


Terminal Command: /bin/systemctl status smb.service

smb.service - LSB: Samba SMB/CIFS file and print server
          Loaded: loaded (/etc/init.d/smb)
          Active: active (running) since Mon, 27 May 2013 17:47:01 +0200; 1h 46min ago
         Process: 4320 ExecStop=/etc/init.d/smb stop (code=exited, status=0/SUCCESS)
         Process: 1443 ExecReload=/etc/init.d/smb reload (code=exited, status=0/SUCCESS)
         Process: 4330 ExecStart=/etc/init.d/smb start (code=exited, status=0/SUCCESS)
          CGroup: name=systemd:/system/smb.service
                  ├ 4340 /usr/sbin/smbd -D -s /etc/samba/smb.conf
                  └ 4341 /usr/sbin/smbd -D -s /etc/samba/smb.conf

And here is the output from the inxi utility:

System:    Kernel: 3.4.42-2.28-desktop x86_64 (64 bit) 
           Desktop KDE 4.9.5 Distro: openSUSE 12.2 (x86_64) VERSION = 12.2 CODENAME = Mantis
Machine:   Mobo: MSI model: 890FXA-GD65 (MS-7640) version: 3.0 Bios: American Megatrends version: V18.0 date: 12/31/2010
CPU:       Hexa core AMD Phenom II X6 1090T (-MCP-) cache: 3072 KB flags: (lm nx sse sse2 sse3 sse4a svm) 
           Clock Speeds: 1: 3200.00 MHz 2: 800.00 MHz 3: 3200.00 MHz 4: 3200.00 MHz 5: 3200.00 MHz 6: 800.00 MHz
Graphics:  Card: NVIDIA GF104 [GeForce GTX 460] 
           X.Org: 1.12.3 drivers: nvidia (unloaded: fbdev,nv,vesa,nouveau) Resolution: 1920x1080@60.0hz 
           GLX Renderer: GeForce GTX 460/PCIe/SSE2 GLX Version: 4.2.0 NVIDIA 304.43
Audio:     Card-1: NVIDIA GF104 High Definition Audio Controller driver: snd_hda_intel Sound: ALSA ver: 1.0.25
           Card-2: Advanced Micro Devices [AMD] nee ATI SBx00 Azalia (Intel HDA) driver: snd_hda_intel
Network:   Card: Realtek RTL8111/8168B PCI Express Gigabit Ethernet controller driver: r8169 
 

I have been using Suse since version 10.x

I hope this give some additional clues.

Kind regards,

Han

One question:
When there are no Windows systems, who is the SAMBA server then? (And my personal ???, why SAMBA in a Linux only shop?)

One remark:
You use HTML tags around your computer text, which helps allready enormous, but for non-HTML text, the CODE tags are better. It is the # button in the toolbar (I bet you never guessed this yourself, like everybody else, that is why we have to explain :wink: ).

Oh yes, you may have missed it, but I strongly suggested to show at least one combination of pair of “meaningfull” and “meannngless” names. It may help to find out what encoding is assumed incorrectly.

So we need to see your /etc/samba/smb.conf file from the server and your /etc/fstab file from the server. Why not show us what the text looks like using a screen capture from a client looking to the sever like this:

http://paste.opensuse.org/view/download/7815562

Thank You,

On 05/27/2013 08:06 PM, u20380 wrote:
> one running Suse 11.2

openSUSE 11.2 sailed past its end of life on 12 May 2011 (cite:
http://en.opensuse.org/Lifetime)…

suggest you move to a currently supported version (right now those
are 12.2, 12.3 and in Evergreen 11.2 and 11.4
http://en.opensuse.org/openSUSE:Evergreen)

easiest would be to move to 11.2 Evergreen, but that is only good
until this coming November.


dd

On 5/27/2013 1:06 PM, u20380 wrote:
>
> Gents,
>
> There are three computers on the network, one running Suse 11.2 and two
> running Suse 12.2.
> One of the Suse 12.2 systems is the server.
> Currently there is no native Windows system.
> The garbled filenames are consistent on all systems.
> To me that points to a problem on the server Samba software.
> I have not seen this problem before.
>
> Here is the output from the smb and nmb status check
>
>
> nmb.service - LSB: Samba NetBIOS naming service over IP
> Loaded: loaded (/etc/init.d/nmb)
> Active: active (running) since Mon, 27 May 2013 17:46:55
> +0200; 1h 47min ago
> Process: 4294 ExecStop=/etc/init.d/nmb stop (code=exited,
> status=0/SUCCESS)
> Process: 1421 ExecReload=/etc/init.d/nmb reload (code=exited,
> status=3/NOTIMPLEMENTED)
> Process: 4304 ExecStart=/etc/init.d/nmb start (code=exited,
> status=0/SUCCESS)
> CGroup: name=systemd:/system/nmb.service
> └ 4313 /usr/sbin/nmbd -D -s /etc/samba/smb.conf
>
>
> Terminal Command: /bin/systemctl status smb.service
>
> smb.service - LSB: Samba SMB/CIFS file and print server
> Loaded: loaded (/etc/init.d/smb)
> Active: active (running) since Mon, 27 May 2013 17:47:01
> +0200; 1h 46min ago
> Process: 4320 ExecStop=/etc/init.d/smb stop (code=exited,
> status=0/SUCCESS)
> Process: 1443 ExecReload=/etc/init.d/smb reload (code=exited,
> status=0/SUCCESS)
> Process: 4330 ExecStart=/etc/init.d/smb start (code=exited,
> status=0/SUCCESS)
> CGroup: name=systemd:/system/smb.service
> ├ 4340 /usr/sbin/smbd -D -s /etc/samba/smb.conf
> └ 4341 /usr/sbin/smbd -D -s
> /etc/samba/smb.conf
>
> And here is the output from the inxi utility:
>
>
> System: Kernel: 3.4.42-2.28-desktop x86_64 (64 bit)
> Desktop KDE 4.9.5 Distro: openSUSE 12.2 (x86_64) VERSION =
> 12.2 CODENAME = Mantis
> Machine: Mobo: MSI model: 890FXA-GD65 (MS-7640) version: 3.0 Bios:
> American Megatrends version: V18.0 date: 12/31/2010
> CPU: Hexa core AMD Phenom II X6 1090T (-MCP-) cache: 3072 KB
> flags: (lm nx sse sse2 sse3 sse4a svm)
> Clock Speeds: 1: 3200.00 MHz 2: 800.00 MHz 3: 3200.00 MHz 4:
> 3200.00 MHz 5: 3200.00 MHz 6: 800.00 MHz
> Graphics: Card: NVIDIA GF104 [GeForce GTX 460]
> X.Org: 1.12.3 drivers: nvidia (unloaded:
> fbdev,nv,vesa,nouveau) Resolution: 1920x1080@60.0hz
> GLX Renderer: GeForce GTX 460/PCIe/SSE2 GLX Version: 4.2.0
> NVIDIA 304.43
> Audio: Card-1: NVIDIA GF104 High Definition Audio Controller
> driver: snd_hda_intel Sound: ALSA ver: 1.0.25
> Card-2: Advanced Micro Devices [AMD] nee ATI SBx00 Azalia
> (Intel HDA) driver: snd_hda_intel
> Network: Card: Realtek RTL8111/8168B PCI Express Gigabit Ethernet
> controller driver: r8169
>
>
> I have been using Suse since version 10.x
>
> I hope this give some additional clues.
>
> Kind regards,
>
> Han
>
>
Han;

Have you set any of the charset parameters in your smb.conf? You might compare the results between a working and non-working
machines of:


testparm -vs | grep charset

I’ve always left them at the default values of:


dos charset = CP850
unix charset = UTF-8
display charset = LOCALE


P.V.
“We’re all in this together, I’m pulling for you” Red Green

On 2013-05-27 18:06, u20380 wrote:
>
> Folks,
>
> When looking at files being shared via Samba on my home network I see
> meaningless filenames like “1YB7MH~E” and incorrect filesizes.

Meaningless? :slight_smile:

1YB7MH~E
12345678

Have you noticed that the name has exactly 8 chars?

Files stored in a FAT filesystem have actually two names: a long one,
and a short one. The short one has only 8 chars plus an extension with 3
chars. Old MsDOS system only support the short names. The long name is
an extension to the filesystem, named “LFN”.

When you name a file with a long name, a short name is automatically
chosen, and it can never be repeated in the same directory. So they are
generated somewhat randomly, thus the “meaningless” names you see.

For some unknown (to me) reason, you are only seeing the short name, or
the long one is not assigned.


Cheers / Saludos,

Carlos E. R.
(from 12.1 x86_64 “Asparagus” at Telcontar)

Aha, sounds logical to me. I now leave it to the SAMBA gurus to explain why the server “exports” (or should I say “share”" here) the MS-DOS name instead of the long name. In any case, I am still not sure we know now what (sort of) system the SAMBA server is.

All,

Thanks for the valuable feedback.

I have looked at the filenames that are “garbled” via Samba.
They are even garbled when I look at them on the server via Samba.

The filenames were generated via K3b when ripping CDs.
The files sit on an NTFS disk.
They all contain a “:” (colon).
As a test I have removed the colon from a filename and it now shows up properly via Samba.

Not sure whether this is a Samba bug or a feature of the MS world.

(BTW - the reason for using Samba in what looks like a Linux shop is that we also have Apple systems and the occasional Windows based visitor)

Han

http://paste.opensuse.org/48337045http://paste.opensuse.org/48337045

I do not know very much about the Apple system, but is it realy unable to handle NFS?
And for that “occasional Windows based vistor”, I wouldn’t care less. I would create a user on one (or more) of the Linux systems to teach him/her a lesson. But that is of course a very personal meaning. :wink:

BTW, Linux has no problems with : in a file name:

henk@boven:~/test/colon> touch a:b
henk@boven:~/test/colon> l
totaal 8
drwxr-xr-x 2 henk wij 4096 28 mei 12:08 ./
drwxr-xr-x 5 henk wij 4096 28 mei 12:08 ../
-rw-r--r-- 1 henk wij    0 28 mei 12:08 a:b
henk@boven:~/test/colon> rm a:b
henk@boven:~/test/colon> l
totaal 8
drwxr-xr-x 2 henk wij 4096 28 mei 12:08 ./
drwxr-xr-x 5 henk wij 4096 28 mei 12:08 ../
henk@boven:~/test/colon>

My advise, more in earnest then the one above, is to rethink your file sharing policy. You now are bound to all the restrictions that MS operating systems forge on you. This one on file names is only a small one (well, it took you in full flight, didn’t it? you did not even think about checking what MS allows you in file names). But security issues abound. No Linux security on those files in a pure Linux environment. I guess your users will go bonkers a lot of times: restrictions on file names, persmission setting and owner changing not functioning and no doubt other things I can not think of because og lack of MD knowledge.

You can use the ntfs-3g mount option in openSUSE /etc/fstab file called "windows_names" per the following link on the driver: NTFS-3G Questions | Tuxera

Thank You,

The “:” is an illegal character in filenames (for Windows). I’m not sure how it got into an NTFS disk. When I last tried copying a file with that char, “cp” gave an error message and refused to copy.

There is something built into samba, called “file name mangling”, to deal with such file names.

On 2013-05-28 13:06, nrickert wrote:
>
> u20380;2560747 Wrote:
>> The files sit on an NTFS disk.
>> They all contain a “:” (colon).
>
> The “:” is an illegal character in filenames (for Windows). I’m not
> sure how it got into an NTFS disk. When I last tried copying a file
> with that char, “cp” gave an error message and refused to copy.
>
> There is something built into samba, called “file name mangling”, to
> deal with such file names.

My guess then would be that, as the long name was invalid, the system
defaulted to the short one instead.


Cheers / Saludos,

Carlos E. R.
(from 12.1 x86_64 “Asparagus” at Telcontar)

On 2013-05-28 12:26, hcvv wrote:
>
> u20380;2560747 Wrote:
>>
>> (BTW - the reason for using Samba in what looks like a Linux shop is
>> that we also have Apple systems and the occasional Windows based
>> visitor)

> My advise, more in earnest then the one above, is to rethink your file
> sharing policy. You now are bound to all the restrictions that MS
> operating systems forge on you. This one on file names is only a small
> one (well, it took you in full flight, didn’t it? you did not even think
> about checking what MS allows you in file names). But security issues
> abound. No Linux security on those files in a pure Linux environment. I
> guess your users will go bonkers a lot of times: restrictions on file
> names, persmission setting and owner changing not functioning and no
> doubt other things I can not think of because og lack of MD knowledge.

I agree.

I think that the OP should use Linux filesystems, with NFS sharing, but
also with Samba configured so that those visitors can use it and access
the files.

NTFS under Linux is slow - that’s another issue to consider. It runs
under a single thread, ie, one cpu, it does not paralelize, and it is
CPU intensive. It runs as a user task (fuse), not as a kernel task.


Cheers / Saludos,

Carlos E. R.
(from 12.1 x86_64 “Asparagus” at Telcontar)