liony 发表于 2008-7-6 22:21:48

关于fanx无法挂载NTFS,显示中文文件名的解决方法

rc.local文件挂载ntfs格式时使用的格式不正确,应该改正为

mount -t ntfs -o nls(而非iocharset)=cp936(而非zh_CN.gbk) dev dir

改正格式之后,就可以mount到ntfs分区,并能显示中文文件名(看附件1)。更正格式后,需要手动建立欲挂载的目标目录。

例如你的分区是hda1 ,则在/mnt下建立hda1文件夹(mkdir /mnt/hda1),从新启动就可以自动挂载了。(看附件2)

你也可以修改shell文件让它自动建立,或者不喜欢hda1这样的名字,想用自己喜欢的,都可以修改这个rc.local文件。

以下是我的rc.local文件。可以直接复制到你自己的文件保存,或者下载附件覆盖原文件(下载后自行修改文件名)

#!/bin/sh
#
# /etc/rc.d/rc.local:Local system initialization script.
#
# Put any local startup commands in here.Also, if you have
# anything that needs to be run at shutdown time you can
# make an /etc/rc.d/rc.local_shutdown script and put those
# commands in there.

#Modifild by Liony @ <www.linuxfans.org>


fc-cache -f -v
cd /usr/share/fonts/TTF
mkfontscale
cp fonts.scale fonts.dir

hd_vfat=`fdisk -l | awk '/FAT32/{print $1}'`
hd_ntfs=`fdisk -l | awk '/NTFS/{print $1}'`

i=0
for file in $hd_vfat
   do
      vfat_hd=$file
      let i="$i+1"
   done

j=0
for file in $hd_ntfs
   do
      ntfs_hd=$file
      let j="$j+1"
   done
I=0
while [ $I -lt $i ]
   do
      umount "${vfat_hd[$I]}"
      vfat_mnt=`echo${vfat_hd[$I]} | awk -F/ '{print $3}' `
      mount -t vfat -o nls=cp936 "${vfat_hd[$I]}" "/mnt/$vfat_mnt"
      let I="$I+1"
   done
J=0
while [ $J -lt $j ]
   do
      umount "${ntfs_hd[$J]}"
      ntfs_mnt=`echo ${ntfs_hd[$J]} | awk -F/ '{print $3}' `
      mount -t ntfs -o nls=cp936 "${ntfs_hd[$J]}" "/mnt/$ntfs_mnt"
      let J="$J+1"
   done

liony 发表于 2008-7-6 22:27:58

忘记上传附件了:
附件1:

附件2:


[ 本帖最后由 liony 于 2008-7-6 22:41 编辑 ]
页: [1]
查看完整版本: 关于fanx无法挂载NTFS,显示中文文件名的解决方法