CD won't auto mount

David Couzelis avatarDavid Couzelis created an issue

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

  1. Insert data CD
  2. Start udiskie
  3. 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:

  1. Start udiskie
  2. Insert data CD
  3. 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

    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

    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

    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

    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

    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
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.