How to copy a file named with Chinese characters to a vfat filesystem?

Solution Unverified - Updated -

Issue

  • When copying a file named with Chinese characters to a vfat file system, it will report error like this:
# grep media /proc/mounts
/dev/sdb1 /media vfat rw,nodiratime,fmask=0022,dmask=0022 0 0

# cp Linux编程.zip /media/
cp: 无法创建一般文件‘/media/Linux编程.zip’: 无效的参数

Or if in en_US.UTF-8 environment, it will report like this:

# cp Linux����.zip /media/
cp: cannot create regular file `/media/Linux\261\340\263\314.zip': Invalid argument

This phenomenon appears exactly the same in both RHEL 4 and RHEL 6, but a little different in RHEL 5. In RHEL 5, when copying the local file to vfat filesystem, it could succeed. However, the destination file will be an incorrect file, like this:

# ls -l LINUX编程.zip 
-rw-r--r-- 1 root root 45746688 07-19 12:36 LINUX编程.zip
#cp LINUX编程.zip /media/
# ls -l /media/
总计 0
?--------- ? ? ? ?          ? LINUX.zip

Environment

  • Red Hat Enterprise Linux 4
  • Red Hat Enterprise Linux 5
  • Red Hat Enterprise Linux 6

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In
Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.