LinuxSir.cn,穿越时空的Linuxsir!

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

使用kde4还不能用dolphin自动mount ntfs盘的进来看看吧.

[复制链接]
发表于 2008-11-8 01:51:31 | 显示全部楼层 |阅读模式
一直很奇怪按照arch的wiki里的hal(中文)部份介绍不能让kde4自动mount ntfs的盘.原来是中文没更新(有可能是我火星了)

打开 /usr/share/hal/fdi/policy/10osvendor/20-storage-methods.fdi 这个文件,找到以下部份..红色字体的几行就是我们要加进入的.

<match key="volume.fstype" string="ntfs">
<match key="/org/freedesktop/Hal/devices/computer:system.kernel.name" string="Linux">
   <merge key="volume.fstype" type="string">ntfs-3g</merge>
   <merge key="volume.policy.mount_filesystem" type="string">ntfs-3g</merge>

  <append key="volume.mount.valid_options" type="strlist">uid=</append>
  <append key="volume.mount.valid_options" type="strlist">gid=</append>
  <append key="volume.mount.valid_options" type="strlist">umask=</append>
  <append key="volume.mount.valid_options" type="strlist">dmask=</append>
  <append key="volume.mount.valid_options" type="strlist">fmask=</append>
  <append key="volume.mount.valid_options" type="strlist">locale=</append>
  <append key="volume.mount.valid_options" type="strlist">utf8</append>
</match>
<match key="/org/freedesktop/Hal/devices/computer:system.kernel.name" string="FreeBSD">
   <merge key="volume.fstype" type="string">ntfs-3g</merge>
   <merge key="volume.policy.mount_filesystem" type="string">ntfs-3g</merge>

  <append key="volume.mount.valid_options" type="strlist">-u=</append>
  <append key="volume.mount.valid_options" type="strlist">-g=</append>
  <append key="volume.mount.valid_options" type="strlist">-m=</append>
  <append key="volume.mount.valid_options" type="strlist">-a</append>
  <append key="volume.mount.valid_options" type="strlist">-i</append>
  <append key="volume.mount.valid_options" type="strlist">-C=</append>
  <append key="volume.mount.valid_options" type="strlist">-W=</append>
</match>

保存退出......然后运行
/etc/rc.d/hal restart (如果不是在root.就用sudo /etc/rc.d/hal restart)

OK..运行 dolphin . 点左边ntfs的盘符.发现能mount上.中文也没问题.hal介绍要重新做一个/sbin/mount.ntfs-3g文件的步骤也省了(不确定是否真的不需要)

我把这部份也贴了

If you use KDE, you may have problem with filenames containing non-latin characters. This happens because KDE's mounthelper is not parsing the policies and locale option correctly. There is a workaround for this:

1) Remove this symlink: rm /sbin/mount.ntfs-3g

2) Replace it with a new bash script containing:

   #!/bin/bash
   /bin/ntfs-3g $1 "$2" -o locale=en_US.UTF-8,$4 #put your own locale here

3) Make it executable: chmod +x /sbin/mount.ntfs-3g

4) Add "NoUpgrade = sbin/mount.ntfs-3g" to /etc/pacman.conf.


Here's an alternative solution for the problem with non-latin characters:

1) Open a shell as root

2) Type: "mv /sbin/mount.ntfs-3g /sbin/mount.ntfs-3g.sav"

3) Create the file /sbin/mount.ntfs-3g containing:

    #!/bin/bash
    /sbin/mount.ntfs-3g.sav $1 $2 -o locale=de_DE.UTF-8

Change locale accordingly to your system.

4) Make the newly created file executable

" chmod +x /sbin/mount.ntfs-3g "


PS: 谁有空把Hal的中文翻译更新一下吧.
发表于 2008-11-8 02:17:20 | 显示全部楼层
还是/etc/fstab方便~~~
回复 支持 反对

使用道具 举报

发表于 2008-11-8 09:51:32 | 显示全部楼层
赞一个。这解决了那些喜欢用自动挂载的人们的问题。
ps:hal中文wiki已经被我更新。
回复 支持 反对

使用道具 举报

发表于 2009-1-9 23:33:05 | 显示全部楼层
谢谢LZ,用LZ的方法问题解决了~
但是我的U盘还是不行,我的U盘也是NTFS格式的
回复 支持 反对

使用道具 举报

发表于 2009-1-9 23:45:25 | 显示全部楼层
顶一个~~~
回复 支持 反对

使用道具 举报

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

本版积分规则

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