QQ登录

只需一步,快速开始

 找回密码
 注册

QQ登录

只需一步,快速开始

楼主: wjping119

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

[复制链接]
发表于 2005-5-20 17:42:37 | 显示全部楼层

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

[quote:25c2d5d2aa="wjping119"][code]
...
...
...
很奇怪这个脚本对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 | tail  or 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 | tail  or so

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

使用道具 举报

发表于 2005-5-20 18:14:27 | 显示全部楼层
嗯,我对比了最上面的脚本很最下边的脚本
因为最上边的脚本虽然有问题,但是可以运行
对照它修改成最后的脚本内容,成功了!
至于为什么老是运行不了我也不知道。
不管那么多了,可以用了,FanX可以放出了!
BOoRFGOnZ,  
回复

使用道具 举报

发表于 2005-5-20 18:18:05 | 显示全部楼层
[quote:7b33552d13="Anomymous"]嗯,我对比了最上面的脚本很最下边的脚本
因为最上边的脚本虽然有问题,但是可以运行
对照它修改成最后的脚本内容,成功了!
至于为什么老是运行不了我也不知道。
不管那么多了,可以用了,FanX可以放出了!
BOoRFGOnZ,  [/quote]
哎呀 哎呀
我还没有搞明白呢
回复

使用道具 举报

 楼主| 发表于 2005-5-20 19:14:31 | 显示全部楼层
给你贴出来好了
[code:1]
#!/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
[/code:1]
至于为什么有执行权限还要说找不到文件的问题我也不知道是怎么回事。
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

GMT+8, 2024-4-18 21:39 , Processed in 0.053024 second(s), 13 queries .

© 2021 Powered by Discuz! X3.5.

快速回复 返回顶部 返回列表