[Samba] how to copy files from the Samba server (small/big characters and other problems)?

Tomasz Chmielewski mangoo at wpkg.org
Mon May 15 09:32:46 GMT 2006


Perhaps the question sounds trivial, and is only partially related to 
Samba, but in reality, I'm trying to cope with this problem for several 
days now.

I have an archive of files that are placed on ext3 filesystem.
I need to copy all the files from there to a fat-formatted drive.

Unfortunately, it's not so easy: ext3 allows filename characters that 
are not allowed by fat, for example, " or |.
To make the things even worse, there are plenty of files there which 
have small/big character set, that are different for ext3 (i.e. FILE.txt 
and file.txt), but are the same for fat (which doesn't understand 
character case).

I tried several methods to copy the files from ext3 to fat:

1) cp/rsync - after that, I had over ~1000 files less (out of ~100000) 
on the destination drive (fat filesystem)

2) mounting the ext3 drive as a Samba share - files with | or " in the 
name were changed by Samba to some random-looking names, and some of 
them couldn't be copied (permission denied)

3) making an iso image of the ext3 drive, and then copying the files 
back. This was close to the solution - converted illegal characters, 
coped with small/big character case (changed conflicting names to 
file.txt, file001.txt etc.), but unfortunately, is only able to create 
31 character long filenames (if I create the iso image as a Joliet 
image, the filenames can be longer, but they won't be "converted").


So I'm still stuck, I don't know how to copy files from ext3 to fat 
reliably.
I even created a small oneliner which converts fat-illegal characters 
(like | or ") to _, but then, I still have the problem with character 
case (FILE.txt and file.txt).

Anyone had this problem before?


-- 
Tomasz Chmielewski
http://wpkg.org



More information about the samba mailing list