You are not logged in.

#1 2008-12-11 18:03:13

brisbin33
Member
From: boston, ma
Registered: 2008-07-24
Posts: 1,796
Website

Udev, HAL, and Automounting... a little clarification please?

So I'm running a pretty bare system with openbox as a wm and pcmanfm as a file manager.  when i first noticed that my usb drive's weren't automounting i assumed that w/o a gnome/thunar/ivman type volume manager i couldn't get the behavior i want.  namely: when i insert a usb drive, mount it under /media by it's label or some other attribute if it has no label.  much like mac os or the other heavier DE's. 

now, i looked through ivman/autofs/etc before settling on a nice udev approach in the udev wiki.  it used a udev rules files to mkdir/mount/umount/rmdir etc.  now i've decided to rethink this whole approach as that added /media/usb_%k instead of the labels like i want.

but i'm getting a bit confused...

HAL wiki wrote:

HAL does not detect the hardware (kernel), manage the devices or the drivers (udev) or automount drives (volume managers).

ok.  so i need a volume manager to do what i want, sounds good.  but wait...

SAME HAL wiki wrote:

...
If you don't tell HAL where to mount iPods it will mount them under /media
...
By default HAL automounts all available partitions not mounted in /etc/fstab
...

now, HAL either automounts or it doesn't. 

1) is it possible to get my desired behavior (automount in /media by label) w/o bringing in a volume manager

2) if so, what should i check to find out why that's not happening now?

i've been through the bug report on testing/hal + policykit + consolekit and tried some workarounds but i'm not using the hal from testing and i havent been home to test my changes yet; so that might not be an issue.

furthermore, the hal wiki is slightly vague on where to put the workaround policy rules, usb rules, ipod mount point section etc.  is it in hal.conf? policykit.fdi? make you're own file in the /10osvendor directory? very vague.

any clarification would be appreciated.

many thanks

edit:  cd/dvd's work just fine; no changes to anything (they are in fstab though)

Last edited by brisbin33 (2008-12-11 18:03:56)

Offline

#2 2008-12-11 18:54:56

ak-89
Member
From: Finland
Registered: 2008-08-26
Posts: 86
Website

Re: Udev, HAL, and Automounting... a little clarification please?

PCManFM has built-in volume manager. But it is gui-only, it does'nt mount drives when you plug them, only when you access them from its own sidebar.

Offline

#3 2008-12-11 19:58:34

thayer
Fellow
From: Vancouver, BC
Registered: 2007-05-20
Posts: 1,560
Website

Re: Udev, HAL, and Automounting... a little clarification please?

brisbin33 wrote:

but i'm getting a bit confused...

It's very easy to get confused about this stuff...it's a convoluted mess!

I think our own Hal wiki does a pretty good job of summing up the roles of udev, D-Bus and Hal in the first paragraph of the article.

brisbin33 wrote:

HAL does not detect the hardware (kernel), manage the devices or the drivers (udev) or automount drives (volume managers).

ok.  so i need a volume manager to do what i want, sounds good.  but wait...

I believe in your case you do need a volume manager to accomplish your goal of dynamic automounting based on label names.  This will involve udev, dbus, hal, and a volume manager.

Alternatively, you can manually configure automount rules to mount devices based on label without the use of a volume manager, but I believe you would need to predefine each label for and every device, so it's not very dynamic.

I ditched hal/dbus a couple weeks ago and now I use udev rules to automount USB drives and SD cards--and I don't bother with labels, instead they mount to /media/usb_%k and /media/card_%k respectively.


thayer williams ~ cinderwick.ca

Offline

#4 2008-12-11 21:15:21

brisbin33
Member
From: boston, ma
Registered: 2008-07-24
Posts: 1,796
Website

Re: Udev, HAL, and Automounting... a little clarification please?

ak-89 wrote:

PCManFM has built-in volume manager. But it is gui-only, it does'nt mount drives when you plug them, only when you access them from its own sidebar.

good to know.  i'll play around with that and see how it works.

thayer wrote:

I ditched hal/dbus a couple weeks ago and now I use udev rules to automount USB drives and SD cards--and I don't bother with labels, instead they mount to /media/usb_%k and /media/card_%k respectively.

that's exactly the system i've been using until i decided i wanted a dynamic label based (sadly, more noob friendly) system.  i think i could add a PROGRAM to those udev rules that will return the labels then mount to /media/%e (%e being the returned label), i'd just be worried about an unlabeled drive case.  oh well.  as i suspected, a volume manager is probably what i want... i just wanted confirmation that the lines in the wiki that say "HAL will automount..." aren't exactly true and i don't just have a 'broken' hal configuration.

i guess it all started when i configured amarok to access my ipod on /media/usb_sdb3 and then the following week i happend to have a thumb drive in first and my ipod became /media/usb_sdc3 and quietly broke amarok.  my sulotion now is an ipod only rule using ATTRS{model}== and then a usb rule for thumb drives.  i may stick with that.

thanks for the info guys... more research to follow.

Offline

#5 2008-12-12 06:50:35

gorn
Member
Registered: 2008-02-01
Posts: 56

Re: Udev, HAL, and Automounting... a little clarification please?

I was doing the same thing recently and found it awkward. I ended up using Ivman, which is no longer supported, but was really quick to setup. I posted about it here:

http://wiki.archlinux.org/index.php/Ivman_HowTo

Offline

#6 2008-12-12 07:58:25

joephantom
Member
From: Latinoamérica
Registered: 2008-01-09
Posts: 94
Website

Re: Udev, HAL, and Automounting... a little clarification please?

gorn wrote:

I was doing the same thing recently and found it awkward. I ended up using Ivman, which is no longer supported, but was really quick to setup. I posted about it here:

http://wiki.archlinux.org/index.php/Ivman_HowTo

thunar-volman and thunar --daemon work great. ¿any advantage of using ivman or autofs?


By striving to do the impossible, man has always achieved what is possible. Those who have cautiously done no more than they believed possible have never taken a single step forward - Mikhail Bakunin

Offline

#7 2008-12-12 16:02:05

brisbin33
Member
From: boston, ma
Registered: 2008-07-24
Posts: 1,796
Website

Re: Udev, HAL, and Automounting... a little clarification please?

joephantom wrote:

thunar-volman and thunar --daemon work great

i was using that until i found out pcmanfm had tabs... i love me some tabs.  pcmanfm -d is a daemon mode too.  i'll try that tonight and see how it works.

i thought about autofs but the wiki made it sound like you need to have a sort of autofs.fstab that it'll go to to automount.  my goal was to _not_ have to maintain lines in a config file for every specific device i think might some day be connected to my system... then again i might be confused, anyone using autofs around here?

Last edited by brisbin33 (2008-12-12 16:03:36)

Offline

#8 2008-12-12 16:09:01

bgc1954
Member
From: Edmonton, AB, Canada
Registered: 2006-03-14
Posts: 1,160

Re: Udev, HAL, and Automounting... a little clarification please?

+1 for pcmanfm and tabs.  I've been using it for quite awhile and haven't really found I needed auto-mounting.  I plug in my camera or card reader and it appears in the pcmanfm sidebar as ak-89 said; then, when you click on it, the drive contents are shown and you just right-click on it in the side bar to unmount it when you're done.


Time is a great teacher, but unfortunately it kills all its pupils ... - Louis Hector Berlioz

Offline

#9 2008-12-12 16:37:37

gorn
Member
Registered: 2008-02-01
Posts: 56

Re: Udev, HAL, and Automounting... a little clarification please?

joephantom wrote:
gorn wrote:

I was doing the same thing recently and found it awkward. I ended up using Ivman, which is no longer supported, but was really quick to setup. I posted about it here:

http://wiki.archlinux.org/index.php/Ivman_HowTo

thunar-volman and thunar --daemon work great. ¿any advantage of using ivman or autofs?

Don't know. I don't use thunar so I never tried using it as just a volume manager. Ivman seemed small and turned out to be pretty easy to configure. I first tried autofs and I couldn't get it to work for generic volumes, only ones that I specified, which isn't practical.

Offline

#10 2008-12-12 22:31:48

Diaz
Member
From: Portugal
Registered: 2008-04-16
Posts: 366

Re: Udev, HAL, and Automounting... a little clarification please?

bgc1954 wrote:

+1 for pcmanfm and tabs.  I've been using it for quite awhile and haven't really found I needed auto-mounting.  I plug in my camera or card reader and it appears in the pcmanfm sidebar as ak-89 said; then, when you click on it, the drive contents are shown and you just right-click on it in the side bar to unmount it when you're done.

that aproach is just anoying, i mean having to click on the device to mount it. Imagine i have my external hard drive almost always plug to the pc, and that i have some program downloading stuff directly to the external drive. If i want to have the program autostart in each session so it starts downloding rigth away without my intervention, it still need me to click on the device to mount it. It is stupid. I want that on each session i start, if there is a connected device, for it to automount. For me thunar fails to do that, pcmanfm too, and only nautilus does that to some extent, not really the way i like it... At least the last time i tried those apps. tongue

Last edited by Diaz (2008-12-12 22:33:03)

Offline

#11 2008-12-13 04:48:25

u_no_hu
Member
Registered: 2008-06-15
Posts: 453

Re: Udev, HAL, and Automounting... a little clarification please?

Diaz wrote:
bgc1954 wrote:

+1 for pcmanfm and tabs.  I've been using it for quite awhile and haven't really found I needed auto-mounting.  I plug in my camera or card reader and it appears in the pcmanfm sidebar as ak-89 said; then, when you click on it, the drive contents are shown and you just right-click on it in the side bar to unmount it when you're done.

that aproach is just anoying, i mean having to click on the device to mount it. Imagine i have my external hard drive almost always plug to the pc, and that i have some program downloading stuff directly to the external drive. If i want to have the program autostart in each session so it starts downloding rigth away without my intervention, it still need me to click on the device to mount it. It is stupid. I want that on each session i start, if there is a connected device, for it to automount. For me thunar fails to do that, pcmanfm too, and only nautilus does that to some extent, not really the way i like it... At least the last time i tried those apps. tongue

Then why do you need automount.. why not put it in fstab?


Don't be a HELP VAMPIRE. Please search before you ask.

Subscribe to The Arch Daily News.

Offline

#12 2008-12-13 14:46:51

Diaz
Member
From: Portugal
Registered: 2008-04-16
Posts: 366

Re: Udev, HAL, and Automounting... a little clarification please?

u_no_hu wrote:
Diaz wrote:
bgc1954 wrote:

+1 for pcmanfm and tabs.  I've been using it for quite awhile and haven't really found I needed auto-mounting.  I plug in my camera or card reader and it appears in the pcmanfm sidebar as ak-89 said; then, when you click on it, the drive contents are shown and you just right-click on it in the side bar to unmount it when you're done.

that aproach is just anoying, i mean having to click on the device to mount it. Imagine i have my external hard drive almost always plug to the pc, and that i have some program downloading stuff directly to the external drive. If i want to have the program autostart in each session so it starts downloding rigth away without my intervention, it still need me to click on the device to mount it. It is stupid. I want that on each session i start, if there is a connected device, for it to automount. For me thunar fails to do that, pcmanfm too, and only nautilus does that to some extent, not really the way i like it... At least the last time i tried those apps. tongue

Then why do you need automount.. why not put it in fstab?

Because in my way of thinking, fstab should be just for internal partitions, things that i really know are always there. Mine just hava root, home and boot. All the rest is dynamic, i mean i can always be changing. External drives sometimes are connected, sometimes not. Pens are the same thing and cdroms, and etc...

Offline

#13 2008-12-13 15:00:22

bgc1954
Member
From: Edmonton, AB, Canada
Registered: 2006-03-14
Posts: 1,160

Re: Udev, HAL, and Automounting... a little clarification please?

u_no_hu wrote:

       

Diaz wrote:

           

bgc1954 wrote:

            +1 for pcmanfm and tabs.  I've been using it for quite awhile and haven't really found I needed auto-mounting.  I plug in my camera or card reader and it appears in the pcmanfm sidebar as ak-89 said; then, when you click on it, the drive contents are shown and you just right-click on it in the side bar to unmount it when you're done.

that aproach is just anoying, i mean having to click on the device to mount it. Imagine i have my external hard drive almost always plug to the pc, and that i have some program downloading stuff directly to the external drive. If i want to have the program autostart in each session so it starts downloding rigth away without my intervention, it still need me to click on the device to mount it. It is stupid. I want that on each session i start, if there is a connected device, for it to automount. For me thunar fails to do that, pcmanfm too, and only nautilus does that to some extent, not really the way i like it... At least the last time i tried those apps. tongue
Then why do you need automount.. why not put it in fstab?

Because in my way of thinking, fstab should be just for internal partitions, things that i really know are always there. Mine just hava root, home and boot. All the rest is dynamic, i mean i can always be changing. External drives sometimes are connected, sometimes not. Pens are the same thing and cdroms, and etc...

Well now, isn't that why we all use Linux.  It's all a matter of choice; no one way is the right or better way.  It depends on how you're using your computer.  What works for one doesn't for another. tongue

Last edited by bgc1954 (2008-12-13 15:06:39)


Time is a great teacher, but unfortunately it kills all its pupils ... - Louis Hector Berlioz

Offline

#14 2008-12-13 16:52:53

brisbin33
Member
From: boston, ma
Registered: 2008-07-24
Posts: 1,796
Website

Re: Udev, HAL, and Automounting... a little clarification please?

all good ideas... many thanks for the input.  i'm going to reask a subpart of my OP now.  i think i'm gonna just try the pcmanfm approach (amarok can execute a command to mount my ipod before it syncs, that's the only time i wouldn't want to have to click-to-mount something smile).  now, in the hal wiki there's a couple of sort of trip&tricks notes towards the bottom.  one such note says to add

  <device>
    <match key="@block.storage_device:storage.model" string="iPod">
      <merge key="volume.policy.desired_mount_point" type="string">ipod</merge>
      <merge key="volume.policy.mount_option.iocharset=iso8859-15" type="bool">true</merge>
      <merge key="volume.policy.mount_option.sync" type="bool">true</merge>
    </match>
  </device>

to set the /media/ipod mountpoint for my ipod, very useful.  as i mentioned in the OP, the wiki never tells you where to add this (at least that i could find).  hal.conf? Policykit.fdi? a new file in /10osvendor?

where should i place these xml lines?

thanks.

Last edited by brisbin33 (2008-12-13 16:53:44)

Offline

#15 2008-12-13 17:41:52

bgc1954
Member
From: Edmonton, AB, Canada
Registered: 2006-03-14
Posts: 1,160

Re: Udev, HAL, and Automounting... a little clarification please?

I would guess that you'd put a new .fdi in 10osvendor or 20thirdparty.  I doubt it really matters.  Try it  out to see if it works--can't hurt.


Time is a great teacher, but unfortunately it kills all its pupils ... - Louis Hector Berlioz

Offline

#16 2008-12-13 18:45:14

brisbin33
Member
From: boston, ma
Registered: 2008-07-24
Posts: 1,796
Website

Re: Udev, HAL, and Automounting... a little clarification please?

ok well, i added as a new rule at /usr/share/hal/fdi/policy/20thirdparty/10-ipod-mountpoint.fdi with the two versions mentioned in the wiki.  then i added the *.desired_mount_pount line to an existing libgpod policy rule.  restarting hal each attempt it _always_ just mounted it at /media/disk.

does anyone have the ipod mount point mentioned in the wiki working?

Last edited by brisbin33 (2008-12-13 18:50:15)

Offline

#17 2008-12-13 19:21:37

joephantom
Member
From: Latinoamérica
Registered: 2008-01-09
Posts: 94
Website

Re: Udev, HAL, and Automounting... a little clarification please?

Diaz wrote:

that aproach is just anoying, i mean having to click on the device to mount it.
[...]
For me thunar fails to do that, pcmanfm too, and only nautilus does that to some extent, not really the way i like it... At least the last time i tried those apps. tongue

I don't need to click on the device to mount it. You can configure thunar automount on "Edit->Preferences->Advanced->Configure the management of removable drives and media".


By striving to do the impossible, man has always achieved what is possible. Those who have cautiously done no more than they believed possible have never taken a single step forward - Mikhail Bakunin

Offline

Board footer

Powered by FluxBB