Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I'm attempting to backup a windows box to a Linux box (Ubuntu 9.10) using rsync on the Linux box, and I get "file has vanished" errors for filenames with unusual characters in the filenames. I get a similar error ("no such file or directory") if I use "cp" instead of rsync. The source in a share on an English language Windows box.

One of the characters is the apostrophe character.

I've been playing around with various --iconv options but haven't been able to solve the problem. Suggestions?

share|improve this question
    
it's probably not the real apostrophe; it's probably a "smart" single-quote character. –  quack quixote Jan 6 '10 at 12:08
add comment

2 Answers

up vote 2 down vote accepted

You're mounting the share from Windows on Linux, then using rsync to copy files locally. How do you mount the share?

Windows should be storing filenames in UTF8 or UTF16, but you need to tell Linux that so it can mount the share correctly. Use a mount option like utf8/utf16, or iocharset=utf8/iocharset=utf16 in your mount command:

mount -t cifs -o utf16,other,options,here //server/share /path/to/mount/point
              ^^^^^^^^
                   |
                   -- if utf16 doesn't help, try iocharset=utf16
                      utf8 or iocharset=utf8 may also work

Other users are indicating that UTF16 is more likely to be correct.

share|improve this answer
1  
mhh .. claiming ntfs is storing the filenames as utf8 is kind of bold. the m$-api mostly does its thing in utf16 (bit.ly/7c8SeR and bit.ly/8hK2rs) but the general direction of your answer is correct :) –  akira Jan 6 '10 at 13:29
    
you might be right about that. all i can say is, i've never had a filename translation problem that mounting as UTF8 didn't fix, but then i'm not using an incredibly large set of non-ascii characters. –  quack quixote Jan 6 '10 at 14:01
    
and i think: just replace your utf8 in your answer with utf16 and that shoould be the solution to the problem of the question :) –  akira Jan 6 '10 at 16:25
    
I'll try both when I get home and let you know, thanks for the tips so far. –  Nerdfest Jan 6 '10 at 16:59
    
options utf8 and utf16 had no effect. iocharset=utf16 generated an error stating "cannot access a needed shared library". iocharset=utf8 seems to have worked perfectly. Thanks very much for your help! –  Nerdfest Jan 6 '10 at 22:06
add comment

One way to get around this is -- for the limited directories with special character filenames, zip or tar the directory and rsync with an exclusion for that directory (but including the zip/tar file instead).

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.