BOoRFGOnZ 发表于 2005-5-20 17:42:37

Re: To BOoRFGOnZ, rc.local 脚本测试这里


...
...
...
很奇怪这个脚本对fat分区支持的很好,可是对ntfs似乎没有起到什么作用,(如果手动挂载加上cp936是没有问题的) 运行时显示有如下信息
Cannot umount ""

mount: wrong fs type, bad option, bad superblock on ,
       missing codepage or other error
       In some cases useful info is found in syslog - try
       dmesg | tailor so

Cannot umount ""

mount: wrong fs type, bad option, bad superblock on ,
       missing codepage or other error
       In some cases useful info is found in syslog - try
       dmesg | tailor so

对了,还要增加对FAT格式的支持,还有人在用,这个看上去很简单
先前 你发的信息 是由于我把第2个for循环中的"j" 写成"i" 的缘故, 可以我已经改过了.

Anomymous 发表于 2005-5-20 18:14:27

嗯,我对比了最上面的脚本很最下边的脚本
因为最上边的脚本虽然有问题,但是可以运行
对照它修改成最后的脚本内容,成功了!
至于为什么老是运行不了我也不知道。
不管那么多了,可以用了,FanX可以放出了!
谢BOoRFGOnZ,:mrgreen:

BOoRFGOnZ 发表于 2005-5-20 18:18:05

嗯,我对比了最上面的脚本很最下边的脚本
因为最上边的脚本虽然有问题,但是可以运行
对照它修改成最后的脚本内容,成功了!
至于为什么老是运行不了我也不知道。
不管那么多了,可以用了,FanX可以放出了!
谢BOoRFGOnZ,:mrgreen:
哎呀 哎呀
我还没有搞明白呢

wjping119 发表于 2005-5-20 19:14:31

给你贴出来好了

#!/bin/sh
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[i]=$file
      let i="$i+1"
   done
j=0
for file in $hd_ntfs
   do
      ntfs_hd[j]=$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 iocharset=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 iocharset=cp936 "${ntfs_hd[$J]}" "/mnt/$ntfs_mnt"
      let J="$J+1"
   done

至于为什么有执行权限还要说找不到文件的问题我也不知道是怎么回事。
页: 1 2 [3]
查看完整版本: To BOoRFGOnZ, rc.local 脚本测试这里