要如何在桌面自動產生隨身碟圖示?

Moderator: Forums Team

zxvc
Posts: 22
Joined: Tue Jul 19, 2005 9:49 pm

要如何在桌面自動產生隨身碟圖示?

Post by zxvc »

我在Debian下有這種功能。就是進入X Window後,
插上隨身碟或光碟片,在GNOME桌面就會自動產生啟動圖示。
我上google找相關的文章,試了幾個方法都失敗了。

請問有沒有人成功過?用什麼方法?
謝謝。
yurenju
Posts: 37
Joined: Sat Apr 26, 2003 8:57 pm
Location: 雲林

Re: 要如何在桌面自動產生隨身碟圖示?

Post by yurenju »

zxvc wrote:我在Debian下有這種功能。就是進入X Window後,
插上隨身碟或光碟片,在GNOME桌面就會自動產生啟動圖示。
我上google找相關的文章,試了幾個方法都失敗了。

請問有沒有人成功過?用什麼方法?
謝謝。
我的 Gentoo 也會耶

是不是要 hald 要啟動呢?

亂猜的 :p
ww
Posts: 142
Joined: Sun Feb 15, 2004 3:37 pm
Contact:

Post by ww »

好像還要 udev
gentoo linux
ˋ(′~‵")ˊ
kevwalker
Posts: 234
Joined: Sun Apr 25, 2004 3:23 pm

Re: 要如何在桌面自動產生隨身碟圖示?

Post by kevwalker »

yurenju wrote:
我的 Gentoo 也會耶

是不是要 hald 要啟動呢?

亂猜的 :p
可以請教您的fstab怎麼設的嗎
(跟fstab有關??)

hald是什麼呢?
=Kev=
yurenju
Posts: 37
Joined: Sat Apr 26, 2003 8:57 pm
Location: 雲林

Re: 要如何在桌面自動產生隨身碟圖示?

Post by yurenju »

kevwalker wrote:
可以請教您的fstab怎麼設的嗎
(跟fstab有關??)

hald是什麼呢?
我的 fstab 沒有特別設定耶。

hal 是什麼嘛…我也不太清楚 ~_~
不過把他裝起來好像就會自動 mount 了(USE flags 要打開)

詳細情形你可能要請教其他人,因為我也不是很懂 XD
ww
Posts: 142
Joined: Sun Feb 15, 2004 3:37 pm
Contact:

Post by ww »

HAL (an abstraction layer for hardware that provides a unified model of the devices in the system to interested applications, along with notification of any hardware changes),

D-BUS (a means for applications to communicate with one another; it's used by HAL and e.g. desktop environments to talk to each other about things like device discovery and changes),

udev by Greg Kroah-Hartman (a means to maintain the special files in /dev based on devices and drivers present in the system) and the

GNOME volume manager (automatically mounts hot-plugged storage volumes).

從http://arstechnica.com/columns/linux/linux-01-23-2004.ars摳下來的
gentoo linux
ˋ(′~‵")ˊ
ww
Posts: 142
Joined: Sun Feb 15, 2004 3:37 pm
Contact:

Re: 要如何在桌面自動產生隨身碟圖示?

Post by ww »

zxvc wrote:我在Debian下有這種功能。就是進入X Window後,
插上隨身碟或光碟片,在GNOME桌面就會自動產生啟動圖示。
我上google找相關的文章,試了幾個方法都失敗了。

請問有沒有人成功過?用什麼方法?
謝謝。
或許可以參考這:

http://www.gentoo.org/doc/en/gnome-config.xml
http://www.gentoo.org/doc/en/udev-guide.xml
http://www.gentoo.org.tw/doc/udev-guide.xml
gentoo linux
ˋ(′~‵")ˊ
zxvc
Posts: 22
Joined: Tue Jul 19, 2005 9:49 pm

Post by zxvc »

ww wrote:HAL (an abstraction layer for hardware that provides a unified model of the devices in the system to interested applications, along with notification of any hardware changes),

D-BUS (a means for applications to communicate with one another; it's used by HAL and e.g. desktop environments to talk to each other about things like device discovery and changes),

udev by Greg Kroah-Hartman (a means to maintain the special files in /dev based on devices and drivers present in the system) and the

GNOME volume manager (automatically mounts hot-plugged storage volumes).

從http://arstechnica.com/columns/linux/linux-01-23-2004.ars摳下來的
謝謝!你說的這些我都裝了,就成功了。

我另外提供一個可以正常顯示自動掛載裝置的字元集問題。
(原文:http://phorum.vbird.org/viewtopic.php?t=15554&highlight=)
建立一個檔案 "/usr/share/hal/fdi/95userpolicy/storage-policy.fdi"
==============================================
<?xml version="1.0" encoding="ISO-8859-1"?> <!-- -*- SGML -*- -->

<deviceinfo version="0.2">

<device>

<!-- Handle drives with non-partitioned media -->
<match key="storage.no_partitions_hint" bool="true">
<!-- optical drives -->
<match key="storage.drive_type" string="cdrom">
<merge key="storage.policy.mount_option.iocharset=cp950" type="bool">true</merge>
</match>
<!-- floppy drives -->
<match key="storage.drive_type" string="floppy">
<merge key="storage.policy.mount_option.iocharset=cp950" type="bool">true</merge>
</match>
</match>

<!-- Normal volumes; use volume label, uuid or drive_type -->
<match key="block.is_volume" bool="true">
<match key="volume.fsusage" string="filesystem">
<!-- skip for drives with the no partitions hint (they are handled above) -->
<match key="@block.storage_device:storage.no_partitions_hint" bool="false">
<!-- Use noatime and sync options for all hotpluggable or removable
volumes smaller than 2GB -->
<match key="volume.size" compare_lt="2147483648">
<match key="@block.storage_device:storage.removable" bool="true">
<merge key="volume.policy.mount_option.iocharset=cp950" type="bool">true</merge>
</match>
</match>
</match>
</match>
</match>

</device>

</deviceinfo>
==============================================
zxvc
Posts: 22
Joined: Tue Jul 19, 2005 9:49 pm

Post by zxvc »

YA!我又成功啟動自動掛載、產生啟動光碟機圖示了。
我把/etc/fstab加入光碟機的普通掛載方式,
就成功給gnome-volume-manager掛載、產生啟動圖示了。
我只不過在/etc/fstab加入一行:
/dev/hda /mnt/cdrom1 iso9660 ro 0 0
就成功了。

我稍微整理一下自動掛載USB碟、光碟機,
並在GNOME桌面產生啟動圖示的方法:
0.USE加入hald??(可是我原本沒加,卻發現早已有hotplog hal dbus...
只是沒有gnome-volume-manager。)
1.emerge hotplug
2.emerge udev
3.emerge hal
4.emerge gnome-volume-manager
5.emerge dbus
6.rc-update add hald default
7.在/etc/fstab中加入光碟機的掛載(不用加USB碟掛載也可以)
8.reboot
9.Good luck!

註:
另外提供一個可以正常顯示自動掛載裝置的字元集問題。
也就是讓被掛載的裝置可以正常顯示中文。
(原文:http://phorum.vbird.org/viewtopic.php?t=15554&highlight=)
建立一個檔案 "/usr/share/hal/fdi/95userpolicy/storage-policy.fdi"
如下的內容:
==============================================
<?xml version="1.0" encoding="ISO-8859-1"?> <!-- -*- SGML -*- -->

<deviceinfo version="0.2">

<device>

<!-- Handle drives with non-partitioned media -->
<match key="storage.no_partitions_hint" bool="true">
<!-- optical drives -->
<match key="storage.drive_type" string="cdrom">
<merge key="storage.policy.mount_option.iocharset=cp950" type="bool">true</merge>
</match>
<!-- floppy drives -->
<match key="storage.drive_type" string="floppy">
<merge key="storage.policy.mount_option.iocharset=cp950" type="bool">true</merge>
</match>
</match>

<!-- Normal volumes; use volume label, uuid or drive_type -->
<match key="block.is_volume" bool="true">
<match key="volume.fsusage" string="filesystem">
<!-- skip for drives with the no partitions hint (they are handled above) -->
<match key="@block.storage_device:storage.no_partitions_hint" bool="false">
<!-- Use noatime and sync options for all hotpluggable or removable
volumes smaller than 2GB -->
<match key="volume.size" compare_lt="2147483648">
<match key="@block.storage_device:storage.removable" bool="true">
<merge key="volume.policy.mount_option.iocharset=cp950" type="bool">true</merge>
</match>
</match>
</match>
</match>
</match>

</device>

</deviceinfo>
==============================================
ww
Posts: 142
Joined: Sun Feb 15, 2004 3:37 pm
Contact:

Post by ww »

zxvc wrote:YA!我又成功啟動自動掛載、產生啟動光碟機圖示了。
嗯,如果你只想用 GNOME,G-V-M 應該就夠了。如果你也想不必進入 GNOME 也可以掛上光碟、USB,也可以 emerge ivman,效果跟 G-V-M 是一樣的。

zxvc wrote: 我把/etc/fstab加入光碟機的普通掛載方式,
就成功給gnome-volume-manager掛載、產生啟動圖示了。
我只不過在/etc/fstab加入一行:
/dev/hda /mnt/cdrom1 iso9660 ro 0 0
^^^^^
這個好像不太對,hda 是硬碟吧(希望我沒記錯)? 下面這個應該比較好:

Code: Select all

/dev/cdroms/cdrom0      /mnt/cdrom      iso9660         noauto,ro               0 0
參考:
http://gentoo-wiki.com/HOWTO_ivman
http://packages.gentoo.org/search/?sstring=ivman
http://forums.gentoo.org//viewtopic-t-272656.html
http://gentoo-wiki.com/HOWTO_gnome-volume-manager
Which is which? /hda /sda /usb ???
gentoo linux
ˋ(′~‵")ˊ
User avatar
【Palatis】
Posts: 956
Joined: Wed Apr 02, 2003 4:21 pm
Location: 偶爾插花...</br>亞利安星球
Contact:

Post by 【Palatis】 »

別忘了 ivman.
「從麻雀之城回來的時候,被問到『你要大的藤箱還是小的藤箱?』為此煩惱不已。大家都有過這種煩惱吧?」
「是啊是啊!大的藤箱可以放很多東西覺得很划算,小的藤箱小小的裡面也許放著很不錯的東西,真的很難取捨阿!」
「靠這個就能告別這種煩惱『中型的藤箱』!」
「好厲害!」
「不要再煩惱大小的問題了,現在還贈送可以煮出鐵質,增進健康的鐵銼刀。」
「這是一定要買的!」
「我要一個!」
zxvc
Posts: 22
Joined: Tue Jul 19, 2005 9:49 pm

Post by zxvc »

ww wrote:
zxvc wrote: 我把/etc/fstab加入光碟機的普通掛載方式,
就成功給gnome-volume-manager掛載、產生啟動圖示了。
我只不過在/etc/fstab加入一行:
/dev/hda /mnt/cdrom1 iso9660 ro 0 0
^^^^^
這個好像不太對,hda 是硬碟吧(希望我沒記錯)? 下面這個應該比較好:
這樣也可以。
其實我是用SATA的硬碟。所以hda是光碟機。
ranma37
Posts: 106
Joined: Sat Feb 22, 2003 11:24 am
Location: 風城購物袋中心
Contact:

Post by ranma37 »

ww wrote: 嗯,如果你只想用 GNOME,G-V-M 應該就夠了。如果你也想不必進入 GNOME 也可以掛上光碟、USB,也可以 emerge ivman,效果跟 G-V-M 是一樣的。
有沒有人知道 for KDE 的類似 G-V-M 的工具呀?
Si
Posts: 333
Joined: Sun Apr 20, 2003 12:15 pm
Location: New Zealand

Post by Si »

ranma37 wrote:有沒有人知道 for KDE 的類似 G-V-M 的工具呀?
在桌面上自動建立圖示我不清楚,不過可以用 Konqueror 到 media:/ 就可以看到自動建立的裝置了,不過不會自動 Mount...
ww
Posts: 142
Joined: Sun Feb 15, 2004 3:37 pm
Contact:

Post by ww »

ranma37 wrote:
ww wrote: 嗯,如果你只想用 GNOME,G-V-M 應該就夠了。如果你也想不必進入 GNOME 也可以掛上光碟、USB,也可以 emerge ivman,效果跟 G-V-M 是一樣的。
有沒有人知道 for KDE 的類似 G-V-M 的工具呀?
我沒在用 KDE,不過我想 ivman 應該就是了 。

If you want KDE to auto-mount your devices you'll need to install dbus, hal and ivman as well after which you add each one of them to the default run level:

Code: Select all

Code Listing 2.4: Setup auto-mounting
# emerge dbus hal ivman
# rc-update add dbus default
# rc-update add hald default
# rc-update add ivman default
http://www.gentoo.org/doc/en/kde-config.xml
gentoo linux
ˋ(′~‵")ˊ
Post Reply