Issue #1 resolved

CD won't auto mount

David Couzelis
created an issue

udiskie won't always mount a CD. udiskie works correctly if I do this:

Insert data CD

Start udiskie

CD is automatically mounted

udiskie says "mounted device /org/freedesktop/UDisks/devices/sr0" and "/media/Ubuntu 8.04 i386" appears.

But udiskie won't mount the CD if I do this:

Start udiskie

Insert data CD

CD is not mounted

I'm using Arch Linux. Please let me know if I can provide more information. Thank you.

Comments (11)

  1. David Couzelis reporter

    I quickly added an extra "add_signal_receiver" command to mount.py for "DeviceChanged". I can confirm that both a "DeviceChanged" command is received by udiskie both when a CD is inserted and removed.

    I'm studying the "udisksevt" code to learn more about what to check next, but I don't know Haskell. :-P I'd really like to see a copy of berbae's BASH script. I sent him an email about it.

  2. David Couzelis reporter

    According to a function in the application UDisksEvt in the file "DBus.hs" (haskell), after receiving a "DeviceChanged" event the author checks for "DeviceIsOpticalDisk", "DeviceIsMounted", and "DeviceFile". (See the function "isDeviceOpticalDisc")

    According to his comment, "the first of which designates if device is optical drive, the second - if the media is inserted, the third - whether device is mounted"

  3. David Couzelis reporter

    berbae kindly sent me a copy of his personal "udisksvm" script. It's a simple bash script that is used in the same way that udiskie is used. Please see the attached "udisksvm" script. I can confirm that it works for CDs and flash drives.

    He used the output from udisks for event information. As you can see under the "changed" case in the switch statement, it checks to see if the changed device is not "systeminternal", is "opticaldisc", and not "ismounted". Then, he checks if the device "hasmedia" After that, he mounts it if the "usage" is "filesystem" and the "numaudiotracks" is 0.

    I hope this helps give you an idea what to put into the new "device_changed" function in udiskie. I know I could just use udisksvm, but I'd really like to see udiskie become fully functional, since I think it's a really solid program.

  4. Byron Clark repo owner

    Those are all good things to place in the DeviceChanged handler and go a long way towards identifying that the device is a CD drive. The part I'm worried about is that udisks emits another DeviceChanged handler on unmount and I don't want to mount the device again there. I'm still looking for something that will let me detect that. I'll look into it more tonight.

  5. David Couzelis reporter

    Tested and confirmed. It works fabulously. This has been one of the most satisfying bug reports I've ever submitted. ;)

    Thank you very much for your work, including the updated AUR package. I think Udiskie is one of the best "unheard of" programs I've found. I will continue adding information to the Arch Linux wiki about it, and might end up writing a Udiskie man page.

  6. Log in to comment