What's new

RT-AC86U + 384.5 + smb mangled file name help?

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

BobMCT

Regular Contributor
I've been a long time Merlin user (thank you) and use the smb for storage. I'm running Ubuntu 16.04 in a vbox on a LinuxMint 18.3 host. In my 16.04 I can access the usb drive in the router and when I ls the contents it returns proper long filenames. However, if I use an rm command the referenced file(s) cannot be found. If I use nautilus the filemanager in Mint it shows mangled filenames. the smb config on my 16.04 config looks as it always has with mangled off and the smb config on the merlin 384.5 version section seems fine as well.
Any ideas as to what I might look for to resolve this? Again, this is a relatively recent issue. Prior to very recently it was working perfectly for a few years.

Thanks in advance for any ideas/suggestions. o_O
 
What changed just before this happened? Updates to the router, Ubuntu or LinuxMint?

Can you describe more about the mangled filenames, perhaps with a screen shot. Is it random corruption like you might have when there have been errors writing to the disk? Is it something logical like shortening long filenames to DOS's 8.3 format? Or is it a locale mismatch between the router and the terminal where the later isn't using UTF8 (are you using a non-English locale)? Does it effect all files or only those created after a certain date, or that were created via another method (like FTP or NFS)?
 
How are you connecting to the SMB share? You mentioned viewing the files in Mint so I assume you mount the SMB from Mint then shared the mounted folder with the Ubuntu VM? What happens if you mount the SMB directly from the 16.04 VM?

Edit: spelling
 
Last edited:
Reply for both above:
I connect to a remote share using the fstab with a mount statement from 16.04. The Mint is merely a VM host for this application.
As far as what may have been updated . . . literally everything. I wasn't paying too much attention to when this happened. But here's how I discovered it.
I have a script that runs via cron each night. It creates a backup of my production directories/files to a compressed tar and stores the resulting file on the remote share. That seems to work just fine. But because space is always limited the creation is followed by bash code that deletes all the archives beyond the most recent 7. This is not happening now and if I try it manually (via the CLI) it reports that the file(s) are not found. Here are some examples:

This is a partial list of archive files created by the tar. I displayed these with the command "ls -1 BKUP* "
BKUP_2018-05-21_02:00:01.gz
BKUP_2018-05-22_02:00:01.gz
BKUP_2018-05-23_02:00:01.gz
BKUP_2018-05-24_02:00:01.gz
BKUP_2018-05-25_02:00:01.gz
BKUP_2018-05-26_02:00:01.gz

However, when I try to delete one/many/all of them with:

$rm BKUP_* is get the following response:
BKUP_2018-05-22_02:00:01.gz
BKUP_2018-05-23_02:00:01.gz
BKUP_2018-05-24_02:00:01.gz
BKUP_2018-05-25_02:00:01.gz
BKUP_2018-05-26_02:00:01.gz
$ rm BKUP_2018-05-26_02:00:01.gz
rm: cannot remove 'BKUP_2018-05-26_02:00:01.gz': No such file or directory

Now, if I look at that directory using the Mint filemanager I see the following:

upload_2018-5-26_17-23-46.png


With Samba (SMB) this translation is called "file name mangling". The original reason was that old DOS and early Windows systems could only work with the 8.3 file name scheme so the actual name would be translated to something else to substitute. Again, I have ALL of these options turned off in all the smb.conf files I could find.

And I'm starting with the assumption that the mangling is happening on the smb side in the ASUS firmware. But this is just an assumption (one has to start somewhere).

So before I dig deeping into the 16.04 samba config I am posting here with the hope that someone is familiar enough to isolate where the cause might be.

Thanks for reading. Hope this clears up what is happening.
 
Have you tried the rm command when logged into the router rather than from the Ubuntu box?

Try issuing the following command to see if there are any invisible characters within the file names.
Code:
# ls BKUP* | hd
00000000  42 4b 55 50 5f 32 30 31  38 2d 30 35 2d 32 31 5f  |BKUP_2018-05-21_|
00000010  30 32 3a 30 30 3a 30 31  2e 67 7a 0a 42 4b 55 50  |02:00:01.gz.BKUP|
00000020  5f 32 30 31 38 2d 30 35  2d 32 32 5f 30 32 3a 30  |_2018-05-22_02:0|
00000030  30 3a 30 31 2e 67 7a 0a  42 4b 55 50 5f 32 30 31  |0:01.gz.BKUP_201|
00000040  38 2d 30 35 2d 32 33 5f  30 32 3a 30 30 3a 30 31  |8-05-23_02:00:01|
00000050  2e 67 7a 0a 42 4b 55 50  5f 32 30 31 38 2d 30 35  |.gz.BKUP_2018-05|
00000060  2d 32 34 5f 30 32 3a 30  30 3a 30 31 2e 67 7a 0a  |-24_02:00:01.gz.|
00000070  42 4b 55 50 5f 32 30 31  38 2d 30 35 2d 32 35 5f  |BKUP_2018-05-25_|
00000080  30 32 3a 30 30 3a 30 31  2e 67 7a 0a 42 4b 55 50  |02:00:01.gz.BKUP|
00000090  5f 32 30 31 38 2d 30 35  2d 32 36 5f 30 32 3a 30  |_2018-05-26_02:0|
000000a0  30 3a 30 31 2e 67 7a 0a                           |0:01.gz.|
 
Reply for both above:
I connect to a remote share using the fstab with a mount statement from 16.04. The Mint is merely a VM host for this application.

Have you changed your naming scheme recently? Also, which version of Samba is running on the router? Which model? Also, which version of the firmware did you upgrade from?
 
Last edited:
I suspect the ":" might be causing issues. Try using a wildcard instead of that character, or using quotes around the filenames.
 
I suspect its going to be a mismatch between the samba versions between the NAS and the Ubuntu VM. I'll have to dig into those. But just for your head scratching pleasure check this out:

sysop@PC102 ~ $ ls /RT-AC86U/0fdcx/BKUP_2018-05-07* |hd
00000000 2f 52 54 2d 41 43 38 36 55 2f 30 66 64 63 78 2f |/RT-AC86U/0fdcx/|
00000010 42 4b 55 50 5f 32 30 31 38 2d 30 35 2d 30 37 5f |BKUP_2018-05-07_|
00000020 30 32 3a 30 30 3a 30 31 2e 67 7a 0a |02:00:01.gz.|
0000002c

sysop@PC102 ~ $ rm /RT-AC86U/0fdcx/BKUP_2018-05-07*
rm: cannot remove '/RT-AC86U/0fdcx/BKUP_2018-05-07_02:00:01.gz': No such file or directory

So I'm NOT going crazy (I think!).
 
You're probably right about the Samba versions. But likewise RMerlin identified the problem character, ":".

You can't create a filename that contains a colon in Windows because it's an invalid character. If you create it in Unix and then look at it via a Samba share the filename is mangled (i.e. BLM1R1~7.GZ). If I look at the same filename via a Samba mount in Centos I see the real filename with colons. I can also delete it, although escaping the colons is advisable:

rm BKUP_2018-05-07_02\:00\:01.gz

So the pragmatic solution would be to not use colons in the filename.
 
The “:” sticks out like a sore thumb for those of us who’ve been bitten by it, but OP claims the same setup has been working before, that’s why I was wondering if OP changed the naming convention after the upgrade.
 
Last edited:
OK - here's what I determined. Yes the colons are reserved and trust me, they occur when I create a filename and embed the output of a particular bash date command. Merlin had mentioned that the special characters "might" cause the trigger of the mangling even though it was turned off. I inserted a sed command to strip the colons when creating the name and voila` - works as expected. While the resulting filename sans colons looks similar it can be manipulated programmatically or manually just fine.
So, we old timers still learn every day.
Thanks for the suggestions from all.
btw - the original network setup was through an ASUS RT-N66U running Merlin software and when replaced with an ASUS RT-AC86U running merlin software the problem started occurring. I'm assuming it might have been the embedded Samba version within the firmware as that's really the only thing that changed.
But it works now with the above change.:D
 

Latest threads

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top