Mailing List Archive


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [tlug] migrating Japanese filenames from old to new samba server



On Fri, Aug 21, 2009 at 6:02 PM, Micheal Cooper <cooper.me@example.com> wrote:
- 1 - I am sure someone has experience with this situation. What would be the best way to bring the old file server files over to the new machine so that I can manipulate the Japanese-named files through the command line? My initial plan was to rsync them over with ownership, groups, etc. intact. I have already prepared lists of usernames and directories to get it done.
- 2 - Should I change the 'dos charset' and/or the 'unix charset' in the smb.conf of the new RHEL5 file server? CP850 is western characters only, and even Microsoft claims to not support it any longer. On the other hand, it is working really well, so obviously I don't understand well enough. If the 'dos charset' is CP850, shouldn't the server be spitting out garbled filenames to the MacOSX and the WinXPJA clients? The filesystem is Unicode, right? And Samba 3 can speak Unicode, so shouldn't I have to set the 'dos charset' to utf-8, too?

 ---------- Forwarded message ----------
From: Edmund Edgar <lists@example.com>
To: Tokyo Linux Users Group <tlug@example.com>
Date: Fri, 21 Aug 2009 18:33:02 +0900
Subject: Re: [tlug] migrating Japanese filenames from old to new samba server

You should be able to do something like
rsync -avz --delete --iconv=cp850,utf8
oldserver:/path/to/fileserver/stuff
newserver:/path/to/fileserver/stuff/

Thank you very much for the info.

The charset in old file server smb.conf is cp932 for dos_charset and unix_charset.

The newer version (v 3.01) of rsync can do '--iconv=UTF-8' to convert charset as it copies, but RHEL5 has version 2.6, so I tried using convmv first.

Downloaded convmv from rhttp://dag.wieers.com/rpm/packages/convmv/ and installed.
'convmv --list' confirmed that convmv can convert from cp932.

------ Did some testing and tweaking ------
  1. Logout and login WinXP.
  2. Umount the share from MacOSX.
  3. rsync -a --delete --numeric-ids sekai:/home/users/staff/Common/shisetu_setsubi /srv/samba/share/test
  4. That worked well.
  5. convmv -f cp932 -t utf-8 /srv/samba/share -r --notest
  6. Works really well.
  7. vi /etc/samba/smb.conf
  8. [global]
  9.         dos charset = UTF8
  10.         unix charset = UTF8
  11.         display charset = UTF8
  12. service smb restart

Connected with XP and OSX again, wrote, read, modified... it still works wonderfully. I get no mojibake on iTerm from my Mac, none from the XP, none from the mounted share in Mac Finder, and none from the Linux terminal in X on the file server itself.

This was a very positive experience. Thank you for the input. I am so greatful for convmv, and of course for TLUG, too. Great stuff.

Notes: Read the convmv man page carefully. Recursion is not default, and neither is actually changing the names. You have to use --notest to actually change anything. Otherwise, it just tells you what it would do. Excellent software.

So I am going home for some rest. Thanks again.

--
Micheal Cooper
Miyazaki, Japan (GMT+9, no DST)

Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links