You are not logged in.
Pages: 1
After following directions in the wiki articles on hal and udev to get my ipod to automount and generate the /dev/ipod device, I'm at a loss because nothing seems to work as explained. (I'm running Arch64 with LXDE)
I've added the following rule to /etc/hal/fdi/policy/ipod.fdi:
<?xml version="1.0" encoding="UTF-8"?>
<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>I've added the following rule to /etc/udev/rules.d/60-ipod.rules
BUS=="usb", ATTRS{manufacturer}=="Apple*", ATTRS{model}=="iPod*", KERNEL=="sd?2", SYMLINK+="ipod", NAME="%k", GROUP="storage"When I plug in the ipod, Pcmanfm will show 'Apple Ipod Music Player' in the left column with the other drives. When I click on it, it will properly mount the ipod to /media/{name of ipod}. I would like it to mount every ipod at /media/ipod, and create a link /dev/ipod. I haven't put anything in the fstab yet, but in any case, the /dev/ipod link is not created. I know the udev rules work, because it will create the correct link for /dev/pilot when I plug in my Palm.
Help! I'm trying hard to wrap my brain around this, and I don't understand why it's not creating the /dev/ipod link. I've restarted the computer and restarted hal and reloaded udev rules multiple times with no changes.
Thanks!
Scott
Offline
Ok, it's mostly working now. I added the following rule to /etc/udev/rules.d/10-local.rules :
KERNEL=="sd?1", ATTRS{manufacturer}=="Apple*", ATTRS{product}=="iPod*", OPTIONS="last_rule"
KERNEL=="sd?2", ATTRS{manufacturer}=="Apple*", ATTRS{product}=="iPod*", SYMLINK+="ipod", NAME="%k", GROUP="storage"
ACTION=="add", KERNEL=="sd?2", ATTRS{manufacturer}=="Apple*", ATTRS{product}=="iPod*", RUN+="/bin/mount -t vfat -o rw,noauto,shortname=mixed,uid=1000,utf8,umask=077,nodev,nosuid /dev/ipod /media/ipod", OPTIONS="last_rule"and created the mountpoint /media/ipod. The attributes for the udev rule were wrong for my ipod and I had to change them a bit from the wiki article to make it work. The hal rule didn't ever seem to change anything, so I deleted it. I've tried other hal rules from the wiki, and they never seem to work.
It's not easy understanding hal/udev and how they interact!!
Which leads to a follow-on question: Now that the ipod is automatically mounted, it no longer appears with the other storage volumes in the left pane of pcmanfm. Is there a way to get that to show up as well? Basically, I've lost the right-click to eject option. I also added rules for automounting flash drives using udev and they also don't show up anymore as a USB Storage Device in the pcmanfm left pane.
Also, which group do I need to belong to in order to eject the ipod as a user from the command line? Presently only 'sudo eject /media/ipod' works.
Any ideas?
Thanks, Scott
Last edited by firecat53 (2008-08-31 04:32:53)
Offline
Hi Scott
"It's not easy understanding hal/udev and how they interact!!"
I try also to understand that and it's not easy for me too.
As I understand it presently, I think that when a volume is mounted at the udev level, using RUN+="/bin/mount ..." followed by OPTIONS="last_rule" in the udev rule, the control is not passed to hal after that by the 90-hal.rules.
And it is hal which signals a new volume to the WM/file manager.
So you can try to not use the OPTIONS="last_rule" and insure that the 90-hal.rules is parsed by udev.
Offline
Ahhh....thank you! If I take out the 'last_rule' option it does indeed show up on pcmanfm. However, I think it's happening somewhere outside the parsing of the udev rules (perhaps HAL???) because even if I moved the local rules to the very last (99-local.rules) but kept in the 'last_rule' option, it would still not show up.
Now, second problem is trying to distinguish between flash drive and ipod. I thought you could use a != on an attribute. The rules below still result in /dev/sdb2 on the ipod getting mounted twice .... once to /media/ipod and once to /media/usbhd-sdb2.
## Automount usb drives
#Prevent sd?1 of the ipod from being mounted
KERNEL=="sd?1", ATTRS{manufacturer}=="Apple*", ATTRS{product}=="iPod*", OPTIONS="last_rule"
KERNEL=="sd?2", ATTRS{manufacturer}=="Apple*", ATTRS{product}=="iPod*", SYMLINK+="ipod", NAME="%k", GROUP="storage"
ACTION=="add", KERNEL=="sd?2", ATTRS{manufacturer}=="Apple*", ATTRS{product}=="iPod*", RUN+="/bin/mount -t vfat -o rw,noauto,shortname=mixed,flush,dirsync,quiet,noatime,nodiratime,uid=1000,utf8,umask=077,nodev,nosuid /dev/ipod /media/ipod"
#Automount flash drives to /media/usbdh-sd??
ACTION=="add", ATTRS{product}!="iPod*", KERNEL=="sd[b-z][0-9]", RUN+="/bin/mkdir -p /media/usbhd-%k"
KERNEL=="sd[b-z]", ATTRS{product}!="iPod*", NAME="%k", SYMLINK+="usbhd-%k", GROUP="storage"
ACTION=="add", KERNEL=="sd[b-z][0-9]", ATTRS{product}!="iPod*", SYMLINK+="usbhd-%k", GROUP="storage", NAME="%k"
ACTION=="add", KERNEL=="sd[b-z][0-9]", ATTRS{product}!="iPod*", RUN+="/bin/mkdir -p /media/usbhd-%k"
ACTION=="add", KERNEL=="sd[b-z][0-9]", ATTRS{product}!="iPod*", RUN+="/bin/ln -s /media/usbhd-%k /mnt/usbhd-%k"
ACTION=="add", KERNEL=="sd[b-z][0-9]", ATTRS{product}!="iPod*", PROGRAM=="/lib/udev/vol_id -t %N", RESULT=="vfat", RUN+="/bin/mount -t vfat -o rw,noauto,flush,dirsync,quiet,nodev,nosuid,noatime,nodiratime,dmask=000,fmask=111 /dev/%k /media/usbhd-%k"
ACTION=="add", KERNEL=="sd[b-z][0-9]", ATTRS{product}!="iPod*", RUN+="/bin/mount -t auto -o rw,noauto,async,dirsync,nodev,noatime /dev/%k /media/usbhd-%k"
#Unmount everything on removal
ACTION=="remove", KERNEL=="sd[a-z][0-9]", RUN+="/bin/rm -f /mnt/usbhd-%k"
ACTION=="remove", KERNEL=="sd[a-z][0-9]", RUN+="/bin/umount -l /dev/%k"
ACTION=="remove", KERNEL=="sd[a-z][0-9]", RUN+="/bin/rmdir /media/usbhd-%k"Any ideas?
Thanks, Scott
Offline
Why don't you just allow hal to automount your ipod, without any udev interaction. I got it working perfectly. Check this out:
Archi686 User | Old Screenshots | Old .Configs
Vi veri universum vivus vici.
Offline
Haxit, I've tried over and over mucking with the hal rules and I just can't seem to get them to change anything. I've added those lines in the HAL wiki for the ipod to /etc/hal/fdi/policy/ipod.fdi and still it didn't work. Is that the right place to put it? Is there a different format for the file?
Scott
Offline
What I did was put all my policies in:
/usr/share/hal/fdi/policy/10osvendor/20-ntfs-config-write-policy.fdi
I put NTFS, iPod and everything else in this file, changing what I needed. Make sure you make the directory for the ipod mount point also.
Archi686 User | Old Screenshots | Old .Configs
Vi veri universum vivus vici.
Offline
Ok, I'll try that when I get a chance. Thanks ![]()
In any case, if I understand it correctly, the HAL rules will not actually automount the devices when they're plugged in, but just be able to direct which mountpoint is used when they're actually mounted by the user. I'm using LXDE, so there's no automatic volume managers running like thunar-volume-manager or gnome-volume-manager to detect and mount the devices without any user interaction. That's why I started going with the udev rules -- because you can add actual mount & unmount commands into the udev rules.
They're SO close to working!! Just that little problem with the double mounting of the ipod! Everything else works great -- mounting to the correct directory when they're plugged in, and unmounting automatically when unplugged, and maintaining visibility in the pacmanfm file manager.
Thanks for your help!
Scott
Offline
No problem. Anytime.
Archi686 User | Old Screenshots | Old .Configs
Vi veri universum vivus vici.
Offline
Ok, I took out my udev rules, because I discovered they don't work with ALL ipods. I added the following to /usr/share/hal/fdi/policy/10osvendor/20-ntfs-config-write-policy.fdi :
<?xml version="1.0" encoding="UTF-8"?>
<deviceinfo version="0.2">
<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>
</deviceinfo>I created the /media/ipod directory. I've restarted HAL and rebooted the computer. It still mounts the ipod at /media/{NAME of IPOD}, and not at /media/ipod.
What the heck am I doing wrong?? Do I need to add an fstab entry? I thought using hal/udev to do this made that unnecessary?
Thanks!
Scott
Offline
It always mounts the ipod as its name.
Archi686 User | Old Screenshots | Old .Configs
Vi veri universum vivus vici.
Offline
Wait a sec . . . . from the wiki entry on hal:
If you don't tell hal where to mount ipods it will mount them under whatever you name your ipod. To change this you must make a policy for hal.I thought that was the whole point of doing this. It mounted fine before . . . . but I wanted a consistent mount point for any ipod at /media/ipod.
Now I'm REAlly confused ![]()
Scott
Offline
I think there is an error in the writing of the hal fdi policy file.
Syntax is :
<merge key="key name" type="type name">content of the key</merge>
"volume.policy.desired_mount_point" is a string which contains the name of the mount point :
<merge key="volume.policy.desired_mount_point" type="string">ipod</merge>
"volume.policy.mount_option.sync" is a boolean value indicating if the sync option is used :
<merge key="volume.policy.mount_option.sync" type="bool">true</merge>
"volume.policy.mount_option.iocharset" is a string which contains the iocharset chosen, so logically :
<merge key="volume.policy.mount_option.iocharset" type="string">iso8859-15</merge>
So I think there is a syntax error in the wiki.
I don't know if that will solve your problem, but hal should better like a correct syntax.
Edit: Finally I'm not so sure of that after reading http://lists.freedesktop.org/archives/h … 01901.html, but the hal developers may have changed that since 2005, so it can be tested if the original writing doesn't work.
Last edited by berbae (2008-09-03 09:19:35)
Offline
Berbae . . . I tried your fix with the hal syntax for iocharset, but it didn't change anything.
Thanks! Scott
Last edited by firecat53 (2008-09-01 21:41:52)
Offline
I've also tried targeting just MY ipod (instead all ipods) by changing the match key line to:
<match key="info.udi" string="/org/freedesktop/Hal/devices/volume_uuid_D7B3_C2E6">after inspecting the output of lshal with my ipod connected.
It still won't work .... keeps mounting the ipod to /media/SCOTTY . . . . even with the desired_mount_point of ipod (/media/ipod)
This is driving me crazy!!
Scott
Offline
Pages: 1