LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 02-14-2021, 02:33 PM   #1
chrislewis79
LQ Newbie
 
Registered: Dec 2019
Posts: 11

Rep: Reputation: Disabled
Another incarnation of the Windows-acceptable-filename-characters-problem, without windows.


Hi,

Have googled this and searched the forum, lots of versions of this problem, I am struggling to generalize the solutions to my situation, what am I missing?

I run a headless Rpi sharing 4 folders, 2 private/user and 2 public/shared (Pics/Music). I filled the Music folder from both a Win7 machine and a Linux Lite machine (this was a while back). I ripped my music CD's copied them to therpi samba share Directory. No issues can play from Linux and windows. I used MusicBrainz to get some metadata, but it missed some and there is no cover art (this is not today's problem).

Today (several years later) I am building anew home server and copying the files over. The rpi is on kernel 4.1.20 (2016) and smbclient -V gives version 3.6.6. The RPi has been sucessfully mounted from my Mint laptop, and mounted from the prospective ubuntu box, and mounted from my wife's win7 laptop. Oh and mounted from my daughter's win10 machine though it does ask for passwords for the shared folders too. (also not today's problem).

The Music folder is correctly mounted on the server at /mnt/oldserver/Music. I can browse it and play it. I want to copy the music files over to the new folder on the new server which is /mnt/newshare/Music. When I do a
Code:
 cp -rp /mnt/oldserver/Music /mnt/newshare/Music
I get errors for everything with a space, a colon, a question mark and a few other things in the FILENAME. Given music track creative naming, that is a large proportion of the files.

I appreciate samba will always presume it is talking to windows, and play windows friendly, but.. ..this is linux to linux. The files are not mangled on the RPi shares. (a few are). It is linux to linux. It does not have to mangle anything to send the files over. The error says
Code:
'cannot stat filename : FILENAME WITH:?:?:'
Then says
Code:
cannot open filename : SAMEFILENAMEWITH:?:?:?:  Nosuch file or directory'
. So that is 2 errors per filename and it is almost as if it is the RPI (raspbian) which is struggling. (but not sure)

What have I tried:
I Know about name mangling so I set the name mangling to no. No better.
I know about utf8 so I set the server and the client(newserver) fstab mount to utf8. no better
I read about changeing the doscharset to CY850. no better.
I also bought and read (the very old) "Orielly Using Samba" (2007), and read about telling samba the client architecture with the %a flag on the end of the
Code:
   path = /share/this/please%CIFSFS
, using CIFSFS for linux smb client. No better, still error on filenames acceptable to linux but not Windows, even though there is now windows in the picture.

for completeness:
the unbuntu server is :
me@host :~$ uname - a
Linux PMS1 5.8.0-43-generic #49~20.04.1-Ubuntu SMP Fri Feb 5 09:57:56 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
me@host :~$ smbclient -V
Version 4.11.6 Ubuntu

This is not a new problem and has several solutions, I just can't see how I make this work. Thanks for your help. The attachement is the rpi smb.conf
Attached Files
File Type: txt rpismbconf.txt (12.8 KB, 6 views)
 
Old 02-14-2021, 03:45 PM   #2
wpeckham
LQ Guru
 
Registered: Apr 2010
Location: Continental USA
Distribution: Debian, Ubuntu, RedHat, DSL, Puppy, CentOS, Knoppix, Mint-DE, Sparky, VSIDO, tinycore, Q4OS,Manjaro
Posts: 5,627

Rep: Reputation: 2695Reputation: 2695Reputation: 2695Reputation: 2695Reputation: 2695Reputation: 2695Reputation: 2695Reputation: 2695Reputation: 2695Reputation: 2695Reputation: 2695
Quote:
Originally Posted by chrislewis79 View Post
Hi,

Have googled this and searched the forum, lots of versions of this problem, I am struggling to generalize the solutions to my situation, what am I missing?

I run a headless Rpi sharing 4 folders, 2 private/user and 2 public/shared (Pics/Music). I filled the Music folder from both a Win7 machine and a Linux Lite machine (this was a while back). I ripped my music CD's copied them to therpi samba share Directory. No issues can play from Linux and windows. I used MusicBrainz to get some metadata, but it missed some and there is no cover art (this is not today's problem).

Today (several years later) I am building anew home server and copying the files over. The rpi is on kernel 4.1.20 (2016) and smbclient -V gives version 3.6.6. The RPi has been sucessfully mounted from my Mint laptop, and mounted from the prospective ubuntu box, and mounted from my wife's win7 laptop. Oh and mounted from my daughter's win10 machine though it does ask for passwords for the shared folders too. (also not today's problem).

The Music folder is correctly mounted on the server at /mnt/oldserver/Music. I can browse it and play it. I want to copy the music files over to the new folder on the new server which is /mnt/newshare/Music. When I do a
Code:
 cp -rp /mnt/oldserver/Music /mnt/newshare/Music
I get errors for everything with a space, a colon, a question mark and a few other things in the FILENAME. Given music track creative naming, that is a large proportion of the files.

I appreciate samba will always presume it is talking to windows, and play windows friendly, but.. ..this is linux to linux. The files are not mangled on the RPi shares. (a few are). It is linux to linux. It does not have to mangle anything to send the files over. The error says
Code:
'cannot stat filename : FILENAME WITH:?:?:'
Then says
Code:
cannot open filename : SAMEFILENAMEWITH:?:?:?:  Nosuch file or directory'
. So that is 2 errors per filename and it is almost as if it is the RPI (raspbian) which is struggling. (but not sure)

What have I tried:
I Know about name mangling so I set the name mangling to no. No better.
I know about utf8 so I set the server and the client(newserver) fstab mount to utf8. no better
I read about changeing the doscharset to CY850. no better.
I also bought and read (the very old) "Orielly Using Samba" (2007), and read about telling samba the client architecture with the %a flag on the end of the
Code:
   path = /share/this/please%CIFSFS
, using CIFSFS for linux smb client. No better, still error on filenames acceptable to linux but not Windows, even though there is now windows in the picture.

for completeness:
the unbuntu server is :
me@host :~$ uname - a
Linux PMS1 5.8.0-43-generic #49~20.04.1-Ubuntu SMP Fri Feb 5 09:57:56 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
me@host :~$ smbclient -V
Version 4.11.6 Ubuntu

This is not a new problem and has several solutions, I just can't see how I make this work. Thanks for your help. The attachement is the rpi smb.conf
There may be no WINDOWS in the picture, but you are mounting using SMB/CIFS which is a Microsoft protocol. SAMBA assumes you need to deal with Windows, or you would be using a Linux native protocol. And THAT sets up an obvious solution!
I would copy the files over using SFTP/SCP or RSYNC without using the SAMBA mount at all. This would avoid any translation or inappropriate checking of the file names.

PS: If you need a mount, look into sshfs. It uses the ssh protocol to create an NFS like mount that APPEARS to work like SAMBA, but is just SSH under the covers. A Very nice tool.

Last edited by wpeckham; 02-14-2021 at 08:31 PM.
 
Old 02-14-2021, 05:01 PM   #3
Emerson
LQ Sage
 
Registered: Nov 2004
Location: Saint Amant, Acadiana
Distribution: Gentoo ~amd64
Posts: 7,661

Rep: Reputation: Disabled
Probably locale issue, what are supported locales in both machines?
 
Old 02-19-2021, 04:31 PM   #4
chrislewis79
LQ Newbie
 
Registered: Dec 2019
Posts: 11

Original Poster
Rep: Reputation: Disabled
Hi

Thanks for the quick replies.
Sorry it took so much time to come back, I work in healthcare, things are.. ..busy.
I have a week off now - I can look at this again.

Thanks for the replies, Yes why do it the long way? I previously struggled with Rsync. It worked but I was using it as the wrong tool, as backup not syncing. I will have another look.

The new server is ubuntu locale en_GB.UTF-8, and also en_US.UTF-8 is also uncommented, in /etc/locale.gen. ON the old pi only the en_GB line is uncommented.

I will post an update shortly
 
Old 02-22-2021, 03:07 AM   #5
chrislewis79
LQ Newbie
 
Registered: Dec 2019
Posts: 11

Original Poster
Rep: Reputation: Disabled
Fixed!! (by taking the obvious simple striaght road as suggested!)
Just an update:

I did it with a mixture of scp and rsync, and a little file manager in ubuntu.

Initially I thought it crazy encrypting thousands of pics on a tiny rpi processor to send across my lan to decrypt on the server (an old opteron), but it worked. It was not really any slower than by samba, as I think the bottle neck it is the usb drive.

I looked at rsync (used before a long time ago) but that too uses ssh. You can specify the shell, I don't know if you can use an unencrypted one, but I was probably going to leave it on overnight.

Due to several years of poor data hygeine by users (self included) there was a lot file searching and moving, once on the server side. For single files that was done in file manager and for groups or folders I used mv but also rsync locally. It is all much tidier now and some of it is on a ZFS pool, and the machine is on a battery backup, so I feel a lot safer from power blowouts and fat fingers.

Work in progress, thanks everyone
 
Old 02-22-2021, 03:39 AM   #6
lvm_
Member
 
Registered: Jul 2020
Posts: 926

Rep: Reputation: 337Reputation: 337Reputation: 337Reputation: 337
...and for the record vfs_catia module is created to address exactly this problem: https://www.samba.org/samba/docs/cur...s_catia.8.html
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Renaming filename with another part of the filename iicapn Linux - Newbie 5 10-25-2020 11:53 AM
[SOLVED] How to use Visual Studio (Linux incarnation)? AlexBB Linux - Software 6 11-07-2016 02:32 PM
Convert static library (Filename.a) to dynamic shared object (filename.so) afx2029 Linux - Software 4 08-17-2007 06:07 AM
change uploaded files from filename.avi to filename.avi.html like www.rapidshare.de latheesan Linux - Newbie 3 06-16-2005 04:33 AM
filename- and filename~ files? slinky2004 Linux - Newbie 5 10-17-2004 10:32 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 06:38 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration