|
[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[i]=$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]
很奇怪这个脚本对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格式的支持,还有人在用,这个看上去很简单 |
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有账号?注册
×
|