LinuxSir.cn,穿越时空的Linuxsir!

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

XFCE4 关于光驱和 USB 的使用问题

[复制链接]
发表于 2006-10-17 00:46:52 | 显示全部楼层 |阅读模式
如果用 gnome 的话,我知道 gnome-volume-manager 可以实现自动管理。
但在 XFCE4 环境下,不想装一个这么庞大的体系,,

首先,说说我的光驱,我在 fstab 文件里写了挂载的信息,用了 noauto,ro 的参数,使用过程中,把光盘放进去后,在 ROX 中双击挂载点,如果是 root 用户,可以成功使用,关闭目录还会提示保持还是卸载,我觉得很人性化了,这样的功能也够用。但在普通用户的情况下则提示没有权限,无法使用,想问问我应该设置什么,如何设置才能达到和 root 一样的效果?

其次,说说 USB,我没有在 fstab 中写任何关于 USB 的信息。在使用过程中,我把 U 盘插好后,进入 root 提示符下,想 mount 但不知道设备名称是什么,用 fdisk -l 查看也只有硬盘的,因此,手动挂载都不可能了,也就无法使用 U 盘。现在问题有几个:

1,如何获得 U 盘的设备名称?是不是需要装什么系统工具或者如何配置内核,使得 U 盘插上去后,自动分配(即使不挂载)到一个设备名,比如 /dev/sda1 之类的。

2,如果获知这个设备名后,理论上讲,也可以参考光驱的挂载方式,将 U 盘的挂载写到 fstab 里,设置成 noauto,这样,使用过程中插入 U 盘,在 ROX 中双击挂载点,应该可以得到和使用光驱一样的效果?那么普通用户挂载权限的问题也可以参考光驱的方法解决了。── ROX 是否支持这样挂载 U 盘?

3,如果问题 2 可行的话,U 盘毕竟不同于光盘,需要有写权限,那在写入 fstab 的时候应该用哪些参数来赋予普通用户对 U 盘有全部权限呢?
发表于 2006-10-17 20:46:23 | 显示全部楼层
现在 udev + dbus + hal已经实现自动挂载了,不需要特别配置,不需要写 fstab。
/media/usbdisk

但如果要 改 iocharset 为 cp936 中文,要改 udev 配置。
回复 支持 反对

使用道具 举报

 楼主| 发表于 2006-10-18 23:40:53 | 显示全部楼层
#emerge udev
#emerge dbus
#emerge hal
#rc-update add dbus default
#rc-update add hald default
#gpasswd -a myusername plugdev

重启之后,插入 U 盘,用 fdisk -l 可以看到设备名了,也可以手动加载,
但要实现自动加载还要配置什么地方吗?

另外,看了官方有关 udev 的文档,发现内核部分没有 General Setup ----> Support for hotpluggable devices 这项,也没有 Pseudo filesystem ----> /dev file system ----> Automatically mount at boot 这项。其他的没有问题。

附上 fdisk -l 显示的信息:
Disk /dev/hda: 80.0 GB, 80026361856 bytes
255 heads, 63 sectors/track, 9729 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/hda1   *           1           9       72261   83  Linux
/dev/hda2              10         134     1004062+  83  Linux
/dev/hda3             135        1131     8008402+  83  Linux
/dev/hda4            1132        9729    69063435    5  Extended
/dev/hda5            1132        6361    42009943+  83  Linux
/dev/hda6            6362        8852    20008926   83  Linux
/dev/hda7            8853        9729     7044471   83  Linux

Disk /dev/sda: 1024 MB, 1024311808 bytes
32 heads, 62 sectors/track, 1008 cylinders
Units = cylinders of 1984 * 512 = 1015808 bytes

This doesn't look like a partition table
Probably you selected the wrong device.

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   ?      392206      967564   570754815+  72  Unknown
Partition 1 has different physical/logical beginnings (non-Linux?):
     phys=(357, 116, 40) logical=(392205, 19, 11)
Partition 1 has different physical/logical endings:
     phys=(357, 32, 45) logical=(967563, 8, 51)
Partition 1 does not end on cylinder boundary.
/dev/sda2   ?       85025     1060846   968014120   65  Novell Netware 386
Partition 2 has different physical/logical beginnings (non-Linux?):
     phys=(288, 115, 43) logical=(85024, 30, 47)
Partition 2 has different physical/logical endings:
     phys=(367, 114, 50) logical=(1060845, 20, 42)
Partition 2 does not end on cylinder boundary.
/dev/sda3   ?      942481     1918302   968014096   79  Unknown
Partition 3 has different physical/logical beginnings (non-Linux?):
     phys=(366, 32, 33) logical=(942480, 18, 30)
Partition 3 has different physical/logical endings:
     phys=(357, 32, 43) logical=(1918301, 7, 39)
Partition 3 does not end on cylinder boundary.
/dev/sda4   ?           1     1833280  1818613248    d  Unknown
Partition 4 has different physical/logical beginnings (non-Linux?):
     phys=(372, 97, 50) logical=(0, 0, 1)
Partition 4 has different physical/logical endings:
     phys=(0, 10, 0) logical=(1833279, 15, 30)
Partition 4 does not end on cylinder boundary.

Partition table entries are not in disk order
回复 支持 反对

使用道具 举报

发表于 2006-10-19 17:38:57 | 显示全部楼层
同问。
我的gnome-mount也不能自动挂载了。
回复 支持 反对

使用道具 举报

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

本版积分规则

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