LinuxSir.cn,穿越时空的Linuxsir!

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

看archwiki时的几个问题,求老鸟回答【已解决】

[复制链接]
发表于 2011-3-28 18:44:07 | 显示全部楼层 |阅读模式
想怎么自动挂载U盘,看了hal和autofs的wiki ,有下面的疑惑,HAL说
1:wiki原文"HAL默认设置是用户被拒绝访问如挂载或者卸载卷的接口。下面的策略就是来让'power'和'storage'组用户访问特定设备的:
File: /etc/dbus-1/system.d/hal.conf<policy group="power">   <all……"

也就是说要自动挂在U盘,必须要把当前非root用户,加到某个用户组,然后再在
/etc/dbus-1/system.d/hal.conf里配置,把给这个用户组”权限“?那么挂载,卸载U盘要怎么配置这个hal.conf?


2:wiki原文“HAL对可移动设备开启noatime挂载选项。这可以加速文件操作,同时降低闪存设备如U盘、SD卡的损耗.
File: /etc/hal/fdi/policy/20-noatime-removable.fdi
<device>  <match ……”

开启noatime挂载选项是必须的吗?

3:装autofs的步骤是 第一步。 pacman -S autofs  第二步。 modprobe autofs4  第三步。配置/etc/autofs/auto.master 第四步。配置/etc/nsswitch.conf and add an entry for automount” automount: files“,第五步。To start the daemon on boot you can add autofs to the DAEMONS array in /etc/rc.conf, and autofs4 to the modules array in the same file.

这里第四步的/etc/nsswitch.conf怎么配置?wiki说的太简单了( add an entry for automount,直接在/etc/nsswitch.conf末尾插入一句 ”automount: files“就行了吗?),第五步里的在开机时怎么autofs4 to the modules array in the same file, the same file是哪个文件怎么弄啊
 楼主| 发表于 2011-3-28 18:45:31 | 显示全部楼层
回复 支持 反对

使用道具 举报

发表于 2011-3-28 19:36:17 | 显示全部楼层
noatime是一个加速文件读取的mount的参数。而且现在hal已经逐渐被大家抛弃,而转向了udisk。

挂载的问题主要是取决于你用什么作为桌面,如果是DE,例如gnome,kde,那么找对应的系统设置即可,不用困扰于其他方面。

如果是纯wm或者无X,那么应当考虑基于udev规则的挂载。google了一个link,也许对你有用,虽然是基于gentoo的。
http://snipt.net/rschu68/mount-usb-disk-with-udev-and-autofs/
回复 支持 反对

使用道具 举报

 楼主| 发表于 2011-3-28 20:10:53 | 显示全部楼层
http://blog.csdn.net/yuzhangqiu/archive/2009/02/25/3936607.aspx
http://www.linuxsir.cn/bbs/thread323186.html
看了以上两个链接,知道怎么挂了。不过还没回答我帖子的问题,至少回答下我最后这个问题?

Post by zjsxwc;2132485
第五步里的在开机时怎么autofs4 to the modules array in the same file, the same file是哪个文件怎么弄啊
回复 支持 反对

使用道具 举报

发表于 2011-3-28 20:15:51 | 显示全部楼层
Post by zjsxwc;2132509
http://blog.csdn.net/yuzhangqiu/archive/2009/02/25/3936607.aspx
http://www.linuxsir.cn/bbs/thread323186.html
看了以上两个链接,知道怎么挂了。不过还没回答我帖子的问题,至少回答下我最后这个问题?


就是/etc/rc.conf,加载模块那一行
回复 支持 反对

使用道具 举报

 楼主| 发表于 2011-3-28 20:32:13 | 显示全部楼层
/etc/rc.conf里加这句 modprobe autofs4 到哪个位置?可以加吗?还是把autofs4加到MODULES=(……)?
回复 支持 反对

使用道具 举报

发表于 2011-3-28 21:54:38 | 显示全部楼层
Post by zjsxwc;2132512
/etc/rc.conf里加这句 modprobe autofs4 到哪个位置?可以加吗?还是把autofs4加到MODULES=(……)?


是后者。嗯。《凑字数》
回复 支持 反对

使用道具 举报

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

本版积分规则

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