LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 1989|回复: 17

怎样在gnome中实现自动挂载?

[复制链接]
发表于 2009-1-10 20:56:32 | 显示全部楼层 |阅读模式
我想实现:在侧栏中点击本地分区的图标,就自动挂载该分区(印象中,gnome中应该很容易实现),但是具体实施的时候却出错:
Invalid mount option when attempting to mount the volume 'data'.(ntfs分区 )

You are not privileged to mount the volume 'suse'.(reiserfs分区)

但是奇怪的是挂载u盘时却一切正常(无论是ntfs分区还是reiserfs分区)
发表于 2009-1-10 22:39:57 | 显示全部楼层
先在/etc/fstab里面写好,用noauto
回复 支持 反对

使用道具 举报

 楼主| 发表于 2009-1-10 22:48:04 | 显示全部楼层
以前用ubuntu的时候hal+gnome-mount就能实现。当时觉得平淡无奇,现在。。。
回复 支持 反对

使用道具 举报

发表于 2009-1-11 01:17:50 | 显示全部楼层
楼主的错误信息说是参数有问题哦,贴fstab出来让大家瞧瞧。
回复 支持 反对

使用道具 举报

发表于 2009-1-11 19:20:31 | 显示全部楼层
自动挂载 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/ 下
回复 支持 反对

使用道具 举报

发表于 2009-1-12 10:02:06 | 显示全部楼层
楼上的兄弟很牛。
回复 支持 反对

使用道具 举报

 楼主| 发表于 2009-1-12 10:53:03 | 显示全部楼层
我说的是:实现图形挂载,点击相应图标,就能自动挂载。opensuse和ubuntu都能实现!
回复 支持 反对

使用道具 举报

发表于 2009-1-17 20:36:32 | 显示全部楼层
......
回复 支持 反对

使用道具 举报

发表于 2009-1-19 10:54:47 | 显示全部楼层
不写fstab不行吗?在其他发行版里是可以的.
回复 支持 反对

使用道具 举报

发表于 2009-10-25 11:56:10 | 显示全部楼层
Post by hqg250;1937022
自动挂载 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/ 下


这个办法的确是很有效,谢谢啦
回复 支持 反对

使用道具 举报

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

本版积分规则

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