个人工具

自动挂载Windows分区

来自Ubuntu中文

117.32.188.98讨论2010年1月13日 (三) 09:51的版本 自动挂载 Windows 分区

跳转至: 导航, 搜索

自动挂载 Windows 分区

本文作者:oneleaf

授权许可:创作共用协议

编辑人员:

校对人员:

适用版本:

文章状态:

参考文献:无


自动挂载 windows 分区执行下列命令, 编辑挂载脚本 autowinfs.

sudo gedit /usr/sbin/autowinfs

复制粘贴以下引用的内容, 保存文件, 退出。

mkdir  -p  /windows/
rmdir   /windows/*   1> /dev/null
grep  -v  '/windows/'  /etc/fstab  >  /etc/fstab.swp
fdisk  -l /dev/[hs]d[a-z]  |  grep     'NTFS'  | cut -d' ' -f1    |   cut -d/ -f3  |   while read WDISKS
do echo  "/dev/$WDISKS  /windows/$WDISKS  ntfs  auto,user,nls=utf8,umask=0   0 0"    >>  /etc/fstab.swp
mkdir  "/windows/$WDISKS"
done
fdisk  -l /dev/[hs]d[a-z]  |  grep     'FAT'  | cut -d' ' -f1    |   cut -d/ -f3  |   while read WDISKS
do echo  "/dev/$WDISKS  /windows/$WDISKS  vfat  auto,user,utf8,umask=0   0 0"    >>  /etc/fstab.swp
mkdir  "/windows/$WDISKS"
done
mv   /etc/fstab.swp    /etc/fstab
mount   -a
exit  0

再运行命令:

sudo chmod +x /usr/sbin/autowinfs
sudo /usr/sbin/autowinfs

就可以了,Windows分区将挂载在 /windows/ 下


这个方法不行!

楼上的错了,此方法我百试不爽。估计你操作有问题的。