LinuxSir.cn,穿越时空的Linuxsir!

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

udev与hal的问题,关于u盘自动挂载

[复制链接]
发表于 2006-7-28 11:30:17 | 显示全部楼层 |阅读模式
FC4,内核2.6.15.4

插入u盘后,在XWindows下后会自动挂载,但在终端模式下(未启动X),很少会自动挂载,
大多数情况下不会自动挂载,需手动执行 mount /dev/sda1即可。 不明白是什么因素在
影响终端下的自动挂载?

看过版上 终极幻想、bbbush和北南南北几位大虾的帖子,照作也是老样子。

在网上查了些udev和hal的资料,有以下两个问题:

1. /dev/sda1节点是udev创建的吗?可我在/etc/udev/rules.d/50-udev.rules中没有发现 和sda相关的规则,但发现了创建 hd[a-z]的规则

2. 插入u盘后HAL只是调用fstab-sync来修改/etc/fstab文件,并创建挂载点/media/usbdisk, 那么是由谁来执行mount /dev/sda1的命令呢?
在XWindows下,这个mount动作由gnome-volume-manage来完成,但在终端模式下呢?


多谢指点!
发表于 2006-7-28 13:28:20 | 显示全部楼层
我的点击计算机后就会现出U盘了
半自动的?
有没有办法插上后就现出U盘
回复 支持 反对

使用道具 举报

发表于 2006-7-28 17:34:19 | 显示全部楼层
Post by lemonade
我的点击计算机后就会现出U盘了
半自动的?
有没有办法插上后就现出U盘
如果你使用gnome,安装上gnome-volumn-manager后一般就会像自动挂载U盘。
回复 支持 反对

使用道具 举报

 楼主| 发表于 2006-8-4 14:02:28 | 显示全部楼层
关于HAL的问题,在其maillist中求教:
hello,  my usb disk can be automounted under XWindow when I insert it, and an icon  also

appears on the desktop.  I think the cooperation of HAL and gnome-volume-manager results in

that.

  But when I log out the XWindow and return to the console terminal, my usb disk cann't be

automounted when I insert it.  I must manually  mount it by "mount /dev/sda1" in order to

access it. However,the /etc/fstab file has been modified by HAL to describe the mount point

and mount options of /dev/sda1,  and the mount point (/media/usbdisk) has also been created

by HAL.  

  I wonder who is responsible to automount /dev/sda1 under console terminal?  Under XWindow ,

I have gnome-volume-manager to do the mount action,  but what under the console?

Vincent

得到答复如下:
Hi,

This will be resolved when we have the infrastructure to reliably track
what user sessions are available / active. It's a difficult problem to
solve, some notes on page 23 of.

http://people.freedesktop.org/~d ... adec2006-davidz.pdf

With this, g-v-m (or whatever automounter you use) will be able to
enforce policy when no-one is logged in. And that policy can be rich,
e.g. it's not unlikely someone is going to add options

[ ] Share removable media on the network
[ ] Share external media on the network

to g-v-m and then we can share these via e.g. mDNS. This would be nice
for e.g. servers.

The whole question does beg for consideration of how applicable this is
to normal users. Most people just log in in order to get their work
done.

HTH,
David

我还是不太明白,既然在终端模式下插入u盘时,HAL已经修改了fstab文件,并创建了挂载点, 为什么系统不能继续完成简单的 mount /dev/sda1的动作? 这和答复中提到的user session 有什么关系么?
请大虾解惑,谢谢!
回复 支持 反对

使用道具 举报

发表于 2006-8-4 14:15:40 | 显示全部楼层
挂载了算哪个用户的?
回复 支持 反对

使用道具 举报

 楼主| 发表于 2006-8-4 15:14:40 | 显示全部楼层
Post by bbbush
挂载了算哪个用户的?


终端模式下用哪个用户登陆就算哪个用户啊,为什么不行呢?
回复 支持 反对

使用道具 举报

发表于 2006-8-4 15:43:40 | 显示全部楼层
估计是不知道谁登录了吧..
不明白。来 IRC 聊聊?也许有人知道。
回复 支持 反对

使用道具 举报

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

本版积分规则

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