Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index International Gentoo Users 中文 (Chinese)
  • Search

mount ntfs volume, chinese filenames

欢迎来到Gentoo中文论坛。
Post Reply
  • Print view
Advanced search
27 posts
  • 1
  • 2
  • Next
Author
Message
wildleaf
n00b
n00b
Posts: 71
Joined: Tue Oct 12, 2004 1:17 am

mount ntfs volume, chinese filenames

  • Quote

Post by wildleaf » Sat Dec 18, 2004 6:00 pm

如何mount 可以显示中文文件名?
Top
Hauser
l33t
l33t
User avatar
Posts: 650
Joined: Sat Dec 27, 2003 9:19 pm
Location: 4-dimensional hyperplane

  • Quote

Post by Hauser » Sat Dec 18, 2004 6:11 pm

Try this in your fstab:

Code: Select all

/dev/hda5        /win       ntfs         users,iocharset=cp936,noauto      0 0
or cp950 if you use zh_TW.Big5 locale.
AMD Athlon XP 2600+; 512M RAM;
nVidia FX5700LE; Hitachi 120Gb
2.6.9-nitro4, reiser4, linux26-headers+nptl

Do I like to compile everything?
Positive definite!
Top
akar
Bodhisattva
Bodhisattva
Posts: 348
Joined: Fri Dec 03, 2004 7:05 am
Location: HKSAR,China

  • Quote

Post by akar » Sat Dec 18, 2004 6:14 pm

這樣也可以, 如果你的 GNU/Linux環境是 UTF-8的編碼。

Code: Select all

/dev/hda5        /mnt/win       ntfs         users,iocharset=utf8,noauto      0 0 
AKar
Top
wildleaf
n00b
n00b
Posts: 71
Joined: Tue Oct 12, 2004 1:17 am

  • Quote

Post by wildleaf » Sat Dec 18, 2004 6:50 pm

如何知道我用的是不是utf8?

另外不管我用iocharset=cp936 还是utf8, mount 出错

Code: Select all

mount: wrong fs type, bad option, bad superblock on /dev/hda6,
       or too many mounted file systems

如果去掉iocharset=...这个option就没有问题
akar wrote:這樣也可以, 如果你的 GNU/Linux環境是 UTF-8的編碼。

Code: Select all

/dev/hda5        /mnt/win       ntfs         users,iocharset=utf8,noauto      0 0 
Top
ts
Tux's lil' helper
Tux's lil' helper
Posts: 97
Joined: Wed Dec 15, 2004 4:03 am

  • Quote

Post by ts » Sat Dec 18, 2004 7:35 pm

wildleaf wrote:如何知道我用的是不是utf8?
另外不管我用iocharset=cp936 还是utf8, mount 出错
show your locale first

iocharset=gb2312

iocharset will depend on your locale
Top
wildleaf
n00b
n00b
Posts: 71
Joined: Tue Oct 12, 2004 1:17 am

  • Quote

Post by wildleaf » Sat Dec 18, 2004 8:03 pm

which should i change to zh_CN? I still want to use english majorly but need to read chinese filenames.
I changed LANG=zh_CN.UTF-8, but mount still gave me the exact same error. Why?

Code: Select all

LANG=en_US.UTF-8
LC_CTYPE=zh_CN.UTF-8
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=

ts wrote:
wildleaf wrote:如何知道我用的是不是utf8?
另外不管我用iocharset=cp936 还是utf8, mount 出错
show your locale first

iocharset=gb2312

iocharset will depend on your locale
Top
ts
Tux's lil' helper
Tux's lil' helper
Posts: 97
Joined: Wed Dec 15, 2004 4:03 am

  • Quote

Post by ts » Sat Dec 18, 2004 8:53 pm

wildleaf wrote:which should i change to zh_CN? I still want to use english majorly but need to read chinese filenames.
I changed LANG=zh_CN.UTF-8, but mount still gave me the exact same error. Why?
I need more information, please run

Code: Select all

cat /etc/locales.build
In addition, I'm wondering what codepage (437 or 936) you select for your vfat system when you genkernel --menuconfig all.
Top
wildleaf
n00b
n00b
Posts: 71
Joined: Tue Oct 12, 2004 1:17 am

  • Quote

Post by wildleaf » Sat Dec 18, 2004 10:26 pm

ts wrote:
wildleaf wrote:which should i change to zh_CN? I still want to use english majorly but need to read chinese filenames.
I changed LANG=zh_CN.UTF-8, but mount still gave me the exact same error. Why?
I need more information, please run

Code: Select all

cat /etc/locales.build
In addition, I'm wondering what codepage (437 or 936) you select for your vfat system when you genkernel --menuconfig all.


Here is the output of cat /etc/locales.build:

Code: Select all

wildleaf portage # cat /etc/locales.build
# This file names the list of locales to be built when glibc is installed.
# The format is <locale>/<charmap>, where <locale> is a locale from the
# /usr/share/i18n/locales directory, and <charmap> is name of one of the files
# in /usr/share/i18n/charmaps/. All blank lines and lines starting with # are
# ignored. Here is an example:
# en_US/ISO-8859-1

en_US/ISO-8859-1
en_US.UTF-8/UTF-8
ja_JP.EUC-JP/EUC-JP
ja_JP.UTF-8/UTF-8
ja_JP/EUC-JP
en_HK/ISO-8859-1
en_PH/ISO-8859-1
de_DE/ISO-8859-1
de_DE@euro/ISO-8859-15
es_MX/ISO-8859-1
fa_IR/UTF-8
fr_FR/ISO-8859-1
fr_FR@euro/ISO-8859-15
it_IT/ISO-8859-1
[/code]
Top
ts
Tux's lil' helper
Tux's lil' helper
Posts: 97
Joined: Wed Dec 15, 2004 4:03 am

  • Quote

Post by ts » Sun Dec 19, 2004 2:59 am

wildleaf wrote: Here is the output of cat /etc/locales.build:

Code: Select all

wildleaf portage # cat /etc/locales.build
# This file names the list of locales to be built when glibc is installed.
# The format is <locale>/<charmap>, where <locale> is a locale from the
# /usr/share/i18n/locales directory, and <charmap> is name of one of the files
# in /usr/share/i18n/charmaps/. All blank lines and lines starting with # are
# ignored. Here is an example:
# en_US/ISO-8859-1

en_US/ISO-8859-1
en_US.UTF-8/UTF-8
ja_JP.EUC-JP/EUC-JP
ja_JP.UTF-8/UTF-8
ja_JP/EUC-JP
en_HK/ISO-8859-1
en_PH/ISO-8859-1
de_DE/ISO-8859-1
de_DE@euro/ISO-8859-15
es_MX/ISO-8859-1
fa_IR/UTF-8
fr_FR/ISO-8859-1
fr_FR@euro/ISO-8859-15
it_IT/ISO-8859-1
我想你应该把中文加入你的 locales.build,法语和日语等其它语言没有必要,你可以把文件改成如下这样:

Code: Select all

# This file names the list of locales to be built when glibc is installed.
# The format is <locale>/<charmap>, where <locale> is a locale from the
# /usr/share/i18n/locales directory, and <charmap> is name of one of the files
# in /usr/share/i18n/charmaps/. All blank lines and lines starting with # are
# ignored. Here is an example:
# en_US/ISO-8859-1

en_US/ISO-8859-1
en_US.UTF-8/UTF-8
zh_CN.UTF-8/UTF-8
zh_CN/gb2312
完了之后,试一下 mount 你的分区;不行,再试一下

Code: Select all

export LC_ALL="zh_CN.UTF-8/UTF-8"
再试一下用 iocharset=UTF8 来 mount 你的分区;如果还不行(这也是最可能发生的情况),你需要重新重新编译你的 kde,我就不知道你是否有时间和精力呢。

Good luck, 兄弟。
Top
ts
Tux's lil' helper
Tux's lil' helper
Posts: 97
Joined: Wed Dec 15, 2004 4:03 am

  • Quote

Post by ts » Sun Dec 19, 2004 3:04 am

补充一下,

当你:

Code: Select all

genkernel --menuconfig all 

DOS/VFAT 的编码选项时绝对不能选 cp936 或 gb2312,只能是默认值。要不任何 iocharset 选项都不会 work,我想这是核心的一个 bug。
Top
wildleaf
n00b
n00b
Posts: 71
Joined: Tue Oct 12, 2004 1:17 am

  • Quote

Post by wildleaf » Sun Dec 19, 2004 3:57 am

NO, I didn't select that. BTW, i want to mount a ntfs volume, not VFAT.
ts wrote:补充一下,

当你:

Code: Select all

genkernel --menuconfig all 

DOS/VFAT 的编码选项时绝对不能选 cp936 或 gb2312,只能是默认值。要不任何 iocharset 选项都不会 work,我想这是核心的一个 bug。
Top
Hauser
l33t
l33t
User avatar
Posts: 650
Joined: Sat Dec 27, 2003 9:19 pm
Location: 4-dimensional hyperplane

  • Quote

Post by Hauser » Sun Dec 19, 2004 4:41 am

ts wrote:我想你应该把中文加入你的 locales.build,法语和日语等其它语言没有必要,你可以把文件改成如下这样:

Code: Select all

# This file names the list of locales to be built when glibc is installed.
# The format is <locale>/<charmap>, where <locale> is a locale from the
# /usr/share/i18n/locales directory, and <charmap> is name of one of the files
# in /usr/share/i18n/charmaps/. All blank lines and lines starting with # are
# ignored. Here is an example:
# en_US/ISO-8859-1

en_US/ISO-8859-1
en_US.UTF-8/UTF-8
zh_CN.UTF-8/UTF-8
zh_CN/gb2312
完了之后,试一下 mount 你的分区;不行,再试一下

Code: Select all

export LC_ALL="zh_CN.UTF-8/UTF-8"
再试一下用 iocharset=UTF8 来 mount 你的分区;如果还不行(这也是最可能发生的情况),你需要重新重新编译你的 kde,我就不知道你是否有时间和精力呢。
如果之前設了locales.build而又沒有中文的locale,現在光是加進去是不行的,你得重編glibc才行。
另外編譯kernel的時候要把Native Language Support裡中文及UTF-8的選項編進去。
AMD Athlon XP 2600+; 512M RAM;
nVidia FX5700LE; Hitachi 120Gb
2.6.9-nitro4, reiser4, linux26-headers+nptl

Do I like to compile everything?
Positive definite!
Top
ts
Tux's lil' helper
Tux's lil' helper
Posts: 97
Joined: Wed Dec 15, 2004 4:03 am

  • Quote

Post by ts » Sun Dec 19, 2004 6:54 am

Hauser wrote: 如果之前設了locales.build而又沒有中文的locale,現在光是加進去是不行的,你得重編glibc才行。
另外編譯kernel的時候要把Native Language Support裡中文及UTF-8的選項編進去。
Good points, you are right. :D
Top
wildleaf
n00b
n00b
Posts: 71
Joined: Tue Oct 12, 2004 1:17 am

  • Quote

Post by wildleaf » Sun Dec 19, 2004 5:38 pm

Does it mean I have to recompile the entire system? :(
Hauser wrote: 如果之前設了locales.build而又沒有中文的locale,現在光是加進去是不行的,你得重編glibc才行。
另外編譯kernel的時候要把Native Language Support裡中文及UTF-8的選項編進去。
Top
Hauser
l33t
l33t
User avatar
Posts: 650
Joined: Sat Dec 27, 2003 9:19 pm
Location: 4-dimensional hyperplane

  • Quote

Post by Hauser » Sun Dec 19, 2004 5:42 pm

There's no need to do that. Just recompile glibc, and if necessary, the kernel.:)
AMD Athlon XP 2600+; 512M RAM;
nVidia FX5700LE; Hitachi 120Gb
2.6.9-nitro4, reiser4, linux26-headers+nptl

Do I like to compile everything?
Positive definite!
Top
wildleaf
n00b
n00b
Posts: 71
Joined: Tue Oct 12, 2004 1:17 am

  • Quote

Post by wildleaf » Sun Dec 19, 2004 5:58 pm

Thanks guys! I found I by mistake set CP936 and CP950 and UTF8 as Module in the Native Language Support and forgot to load them. After I insmod, now i can mount it using iocharset=cp926 or utf8 option. But the chinese file name does not show up correctly. What is the problem now?

Is this because I have to recompile glibc? And how can I recompile it? emerge glibc?

Also, is it better to compile language support into kernel instead of modules?

Sorry still one more, How do I know my system is now using UTF8 or not , since the language option was not loaded ever.
Top
ts
Tux's lil' helper
Tux's lil' helper
Posts: 97
Joined: Wed Dec 15, 2004 4:03 am

  • Quote

Post by ts » Mon Dec 20, 2004 1:54 am

wildleaf wrote:But the chinese file name does not show up correctly. What is the problem now?

Is this because I have to recompile glibc? And how can I recompile it? emerge glibc?
这样就好

Code: Select all

emerge glibc
Also, is it better to compile language support into kernel instead of modules?

Sorry still one more, How do I know my system is now using UTF8 or not , since the language option was not loaded ever.
刚才我又重新编译核心试了一下,只要你 make.conf 文件 USE 设了 nls,默认就是 utf8,编译时各语言包作为模块就行。

但是,我试了一下不同的 iocharset,只有 gb2312 才行,好像如果 cp936(gb2312) 和 UTF8 同时选择的话,gb2312 优先。

good luck.
Top
wildleaf
n00b
n00b
Posts: 71
Joined: Tue Oct 12, 2004 1:17 am

not work:(

  • Quote

Post by wildleaf » Mon Dec 20, 2004 5:44 am

I had no luck to make this work:(

I use this to mount

Code: Select all

wildleaf mnt #  mount -t ntfs -o iocharset=cp936 /dev/hda6 d
then I got

Code: Select all

wildleaf Chinese # dir
\301\367\320\320\270\350\307\372
wildleaf Chinese # ll
ls: �����: No such file or directory
total 0
wildleaf Chinese #
Top
akar
Bodhisattva
Bodhisattva
Posts: 348
Joined: Fri Dec 03, 2004 7:05 am
Location: HKSAR,China

  • Quote

Post by akar » Mon Dec 20, 2004 8:23 am

I think it is the locale problem of the user root
How about,

Code: Select all

#  mount -t ntfs -o iocharset=cp936 /dev/hda6 d 
# export LC_ALL=zh_CN.GB2312
#ls 
it is only locale problem for the root user for your case.

explaination

.config of kernel 2.6.9

Code: Select all

glc linux # grep -i nls .config |grep -v ^#
CONFIG_UDF_NLS=y
CONFIG_NLS=y
CONFIG_NLS_DEFAULT="iso8859-1"
CONFIG_NLS_CODEPAGE_936=m
CONFIG_NLS_CODEPAGE_950=m
CONFIG_NLS_ISO8859_1=m
CONFIG_NLS_UTF8=m
For my kernel 2.6.9, the nls modules are black magicly loaded when need

Mount without any parameter, module nls_iso8859_1(nls default in kernel config) is loaded

Code: Select all

glc root # mount /dev/hda6 /mnt/C
glc root # lsmod
Module                  Size  Used by
nls_iso8859_1           4096  1
nvidia               4814004  12
eepro100               25868  0
Mount with parameter "iocharset=utf8", we can see:

1. the module "nls_iso8859_1" is still there but Used=0 after umount the previous mount!!
2. the module "nls_utf8" is now loaded

Code: Select all

glc root # umount /mnt/C
glc root # mount -o iocharset=utf8 /dev/hda6 /mnt/C
glc root # lsmod
Module                  Size  Used by
nls_utf8                1920  1
nls_iso8859_1           4096  0
:idea: I have not read the kernel manual, but i think the Used=N of every kernel module is to support the experiment "unload module" feature of kernel. N<>0, is a module that should not be unloaded.

edit.20041221: better BBcode formating
Last edited by akar on Tue Dec 21, 2004 7:55 am, edited 1 time in total.
AKar
Top
wildleaf
n00b
n00b
Posts: 71
Joined: Tue Oct 12, 2004 1:17 am

:(

  • Quote

Post by wildleaf » Tue Dec 21, 2004 6:19 am

Thanks! But It is not working:(
Here is what i got:

Code: Select all

wildleaf Chinese # grep -i nls /usr/src/linux/.config |grep -v ^#
CONFIG_UDF_NLS=y
CONFIG_NLS=y
CONFIG_NLS_DEFAULT="iso8859-1"
CONFIG_NLS_CODEPAGE_437=y
CONFIG_NLS_CODEPAGE_936=m
CONFIG_NLS_CODEPAGE_950=m
CONFIG_NLS_ISO8859_1=y
CONFIG_NLS_UTF8=m

and when I mount it using cp936

Code: Select all

Module                  Size  Used by

nls_utf8                2688  0
nls_cp950             104832  0
nls_cp936             127232  1
ntfs                  143632  1
e100                   31360  0

Any other ideas?
Top
akar
Bodhisattva
Bodhisattva
Posts: 348
Joined: Fri Dec 03, 2004 7:05 am
Location: HKSAR,China

Re: not work:(

  • Quote

Post by akar » Tue Dec 21, 2004 8:38 am

wildleaf wrote:I had no luck to make this work:(

I use this to mount

Code: Select all

wildleaf mnt #  mount -t ntfs -o iocharset=cp936 /dev/hda6 d
I have overlook, your preferred codepage is zh_CN.UTF-8, so

Code: Select all

wildleaf mnt #  mount -t ntfs -o iocharset=utf8 /dev/hda6 d
wildleaf mnt # ls d
to see if it works.


---If the above still not work !! ---

:idea: Hmmm,,,,, i should invite you to create a file with Chinese name to test if your system is Chinese ready. :)

at least set LC_CTYPE to processing chinese characters.

Code: Select all

$ export LC_CTYPE="zh_CN.UTF-8"
TestCase: if the file with chinese name created under Linux native file sytem is handled correctly.

Code: Select all

$ touch /tmp/中文文件名.txt
$ ls /tmp/
AKar
Top
wildleaf
n00b
n00b
Posts: 71
Joined: Tue Oct 12, 2004 1:17 am

Re: not work:(

  • Quote

Post by wildleaf » Tue Dec 21, 2004 3:47 pm

akar wrote:
I have overlook, your preferred codepage is zh_CN.UTF-8, so

Code: Select all

wildleaf mnt #  mount -t ntfs -o iocharset=utf8 /dev/hda6 d
wildleaf mnt # ls d
to see if it works.
I tried this utf8 before, didn't work either.
---If the above still not work !! ---

:idea: Hmmm,,,,, i should invite you to create a file with Chinese name to test if your system is Chinese ready. :)

at least set LC_CTYPE to processing chinese characters.

Code: Select all

$ export LC_CTYPE="zh_CN.UTF-8"

TestCase: if the file with chinese name created under Linux native file sytem is handled correctly.

Code: Select all

$ touch /tmp/中文文件名.txt
$ ls /tmp/
I've no problem to create and see chinese name while i'm in gnome, but i cant see chinese names without it. Also, the mount is still not working.

If I give you a test account, could u log on and see what 's wrong?
wildleaf.3322.org
user: testuser
pass: wildleaf

Thanks!
Top
akar
Bodhisattva
Bodhisattva
Posts: 348
Joined: Fri Dec 03, 2004 7:05 am
Location: HKSAR,China

  • Quote

Post by akar » Wed Dec 22, 2004 3:10 am

8) : btw, i have changed the passwd of the account "testuser".

i found you have recompiled the kernel! now the nls modules are compiled into kernel. :!: Make sure you are using the correct kernel to boot up your Gentoo, (and of coz the new compiled version has properly installed). otherwise mounting with option of "iocharset=utf8" will prompt you an error.

During my login session, i found your have mounted two ntfs, but WITHOUT the iocharset=utf8 option. was it having problem when mounting with such option?

Code: Select all

$ mount
/dev/hda6 on /mnt/d type ntfs (rw,noexec,nosuid,nodev,umask=0022)
/dev/hda7 on /mnt/e type ntfs (rw,noexec,nosuid,nodev,umask=0022) 
mine is something like:

Code: Select all

/dev/hda6 on /mnt/D type vfat (rw,noexec,nosuid,nodev,umask=022,iocharset=utf8,iocharset=utf8)
AKar
Top
wildleaf
n00b
n00b
Posts: 71
Joined: Tue Oct 12, 2004 1:17 am

  • Quote

Post by wildleaf » Wed Dec 22, 2004 3:26 am

Thanks a lot! It works now! But I didn't figure out why it works :?
Here is what I did today:
1. I do recompiled kernel with language support (utf8, cp936, cp950) built in
2. recompiled glibc with updated locales.build
3. unmerge linux-headers, merge linux26-headers
4. recompiled glibc
5. merge kde

Then I suspect it is only because I built the language support into kernel instead of modules. This is weird.

But anyway, thanks guys, everything is working now, kde works much better than gnome, i like it.

akar wrote:8) : btw, i have changed the passwd of the account "testuser".

i found you have recompiled the kernel! now the nls modules are compiled into kernel. :!: Make sure you are using the correct kernel to boot up your Gentoo, (and of coz the new compiled version has properly installed). otherwise mounting with option of "iocharset=utf8" will prompt you an error.

During my login session, i found your have mounted two ntfs, but WITHOUT the iocharset=utf8 option. was it having problem when mounting with such option?

Code: Select all

$ mount
/dev/hda6 on /mnt/d type ntfs (rw,noexec,nosuid,nodev,umask=0022)
/dev/hda7 on /mnt/e type ntfs (rw,noexec,nosuid,nodev,umask=0022) 
mine is something like:

Code: Select all

/dev/hda6 on /mnt/D type vfat (rw,noexec,nosuid,nodev,umask=022,iocharset=utf8,iocharset=utf8)
:? :?
Last edited by wildleaf on Wed Dec 22, 2004 3:32 am, edited 1 time in total.
Top
wildleaf
n00b
n00b
Posts: 71
Joined: Tue Oct 12, 2004 1:17 am

OK

  • Quote

Post by wildleaf » Wed Dec 22, 2004 3:31 am

OK a last question. 8O
akar I cant be happier if you can help me fix this

Now I can read the chinese file names of the mounted volumes correctly only in kde/gnome. The chinese characters are screwed in text mode, say, when i'm not running X. How can I get this fixed?
Top
Post Reply
  • Print view

27 posts
  • 1
  • 2
  • Next

Return to “中文 (Chinese)”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy

 

 

magic