LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
Search this Thread
Old 06-06-2008, 12:08 AM   #1
deevarvar
LQ Newbie
 
Registered: Jan 2006
Posts: 7

Rep: Reputation: 0
How to use hal methods to mount,umount volume?


I want to use dbus-send to send a method to umount the usb volume.
However,the error is shown below:

dbus-send --system --print-reply --dest=org.freedesktop.Hal /org/freedesktop/Hal/devices/volume_uuid_4409_6AFB org.freedesktop.Hal.Device.Volume.Unmount
Error org.freedesktop.DBus.Error.UnknownMethod: Method "UnMount" with signature "" on interface "org.freedesktop.Hal.Device.Volume" doesn't exist

I use "lshal" to see the hal info:
udi = '/org/freedesktop/Hal/devices/volume_uuid_4409_6AFB'
volume.unmount.valid_options = {'lazy'} (string list)
volume.mount.valid_options = {'ro', 'sync', 'dirsync', 'noatime', 'nodiratime', 'noexec', 'quiet', 'remount', 'exec', 'utf8', 'sho
rtname=', 'codepage=', 'iocharset=', 'umask=', 'dmask=', 'fmask=', 'uid='} (string list)
org.freedesktop.Hal.Device.Volume.method_execpaths = {'hal-storage-mount', 'hal-storage-unmount', 'hal-storage-eject'} (string lis
t)
org.freedesktop.Hal.Device.Volume.method_argnames = {'mount_point fstype extra_options', 'extra_options', 'extra_options'} (string
list)
org.freedesktop.Hal.Device.Volume.method_signatures = {'ssas', 'as', 'as'} (string list)
org.freedesktop.Hal.Device.Volume.method_names = {'Mount', 'Unmount', 'Eject'} (string list)
info.interfaces = {'org.freedesktop.Hal.Device.Volume'} (string list)
volume.ignore = false (bool)
info.udi = '/org/freedesktop/Hal/devices/volume_uuid_4409_6AFB' (string)
..........


As you can see,the Unmount method is right there.
How can I solve it?
Thanks!
 
Old 06-06-2008, 02:03 AM   #2
jschiwal
Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 654Reputation: 654Reputation: 654Reputation: 654Reputation: 654Reputation: 654
Check if you have the halmount command. It does what you are trying to do. If you have it but you don't want to use it, you can at least read it because it is a python script. ( on my system at least )
 
Old 06-06-2008, 02:10 AM   #3
deevarvar
LQ Newbie
 
Registered: Jan 2006
Posts: 7

Original Poster
Rep: Reputation: 0
Which package does the "halmount" belong to ?
I use debian 4.0 and use apt-cache search halmount, got nothing matched.
Thanks!
 
Old 06-06-2008, 06:42 AM   #4
jschiwal
Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 654Reputation: 654Reputation: 654Reputation: 654Reputation: 654Reputation: 654
It is a part of ivman. Ike's volume manager.

I just had a thought. Make sure that you don't have the "noacpi" kernel boot option. This will prevent the dbus and hal daemons from running.

Last edited by jschiwal; 06-06-2008 at 06:44 AM.
 
Old 06-06-2008, 08:05 AM   #5
deevarvar
LQ Newbie
 
Registered: Jan 2006
Posts: 7

Original Poster
Rep: Reputation: 0
I have installed the ivman,but there is no "halmount".
Is the ivman the right package in your distribution?
Could you tell me the details in halmount?
Thanks!
 
Old 06-06-2008, 08:32 AM   #6
jschiwal
Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 654Reputation: 654Reputation: 654Reputation: 654Reputation: 654Reputation: 654
I use an rpm based system. rpm -qi ivman shows this url:
URL : http://ivman.sourceforge.net/
 
Old 06-06-2008, 11:30 PM   #7
jschiwal
Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 654Reputation: 654Reputation: 654Reputation: 654Reputation: 654Reputation: 654
I downloaded the ivman source myself and I guess that the halmount is a wrapper around the commands supplied by ivman. It may be suse specific.

ftp://ftp.pbone.net/mirror/ftp.opens....14-72.src.rpm
If you download the SuSE rpm package, you can use "mc" to extract the halmount.py script. The /usr/bin/halmount command is simply a symbolic link to /usr/bin/halmount.py.

The rest of the source package is a tarball of the ivman package. There should be plenty there to study. Maybe you will write your own wrapper for the ivman commands to do what you want, or simply craft the xml rules.

--
You can also use:
rpm2cpio ivman-0.6.14-72.src.rpm >ivman-0.6.14-72.cpio
cpio -vid < ivman-0.6.14-72.cpio
to extract the files from the rpm.

---

There is also a halmount.1 man page. However, be sure to study the script before using it. The xml files used by ivman or hal may differ between my setup and yours. HAL works hand in hand with udevinfo when a device is added. Your system may be configured differently. This script uses the label of a filesystem, and udev creates a /dev/disk/by-label/<label> symbolic shortcut to the actual device. The rules for it to do this are in /etc/udev/rules.d/. Your system may not do this as its configured.

Another thing to look at is your system uses the PolicyKit package which may control whether a regular user using a desktop manager can mount a device. The policy kit distinguishes between a user using the desktop or one ssh'ing into the computer and may allow or deny an action accordingly. ( some documentation in /usr/share/doc/policykit/spec/polkit-spec.html if it's installed )

I know this is a lot to digest. I wish there was better documentation on dbus, hal, udev & policy kit and how it all fits together.

Last edited by jschiwal; 06-06-2008 at 11:48 PM.
 
Old 06-07-2008, 12:20 PM   #8
deevarvar
LQ Newbie
 
Registered: Jan 2006
Posts: 7

Original Poster
Rep: Reputation: 0
Thanks very much!
I will dig it!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
DVD (auto)mount problem, gnome-mount, hal, Fedora C 5 lazarion Linux - Hardware 5 01-10-2007 04:45 AM
util-linux-2.12r error on 'make -C mount mount umount' james penguin Linux From Scratch 2 08-28-2006 11:55 PM
gnome-volume-manager and HAL quadfour Mandriva 2 06-25-2005 12:19 AM
In fc3 Can I umount a Logical Volume which is mounted auto in fstab? TomF Linux - Newbie 2 12-16-2004 01:40 AM
can't umount nfs volume GŠutama Linux - Networking 0 07-10-2003 08:20 AM


All times are GMT -5. The time now is 10:05 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration