Announcement

Collapse
No announcement yet.

Automounting optical media

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Automounting optical media

    I'm using Ubuntu Server 10.04 as the base and running Fluxbox as the GUI. Everything seems to work normally except automounting of the CD and DVD drives which are sr0 and sr1. USB flash drives are automatically mounted and unmounted, but not the optical drives. I can mount by typing:
    Code:
    sudo mount -t iso9660 /dev/sr0 /media/cd
    That works very well, but if the CD is removed or the drawer is opened and closed, it will not allow unmounting. In that case it reports that the device is in use.

    I've looked at /usr/sbin/hald, and /etc/rc.local but can't find anything relevant. I've installed pmount and libpmount0.0 without any effect. Autofs supposedly runs in kernel space, so perhaps CD automount support is not compiled into 2.6.32-22-generic-pae. I don't know. It seems most telling that USB will automount and IDE will not.

    All suggestions welcome.

    #2
    Re: Automounting optical media

    Maybe


    Searching:
    Code:
    apt-cache search automount
    autofs5 - kernel-based automounter for Linux, version 5
    ltspfsd - Fuse based remote filesystem hooks for LTSP thin clients
    afuse - automounting file system implemented in user-space using FUSE
    am-utils - automounter utilities from 4.4BSD (includes amd)
    am-utils-doc - automounter utilities documentation
    autofs5-hesiod - Hesiod map support for autofs, version 5
    autofs5-ldap - LDAP map support for autofs, version 5
    halevt - Generic handler for HAL events
    ivman - daemon to auto-mount and manage media devices
    libamu-dev - Support library for amd the 4.4BSD automounter (development)
    libamu4 - Support library for amd the 4.4BSD automounter (runtime)
    pmount - mount removable devices as normal user
    vfu - A versatile text-based filemanager
    autodir - Automatically creates home and group directories for LDAP/NIS/SQL/local accounts
    Code:
    apt-cache show halevt
    Description: Generic handler for HAL events
    halevt is a daemon that acts as a policy agent on top of HAL. It
    listens to HAL events and reacts with user-configurable
    actions. It is a reimplementation of ivman project.
    .
    Among other things, halevt is useful as an automount daemon that will mount
    removable devices but with a much smaller set of dependencies than tools such
    as gnome-volume-manager.
    Homepage: http://www.environnement.ens.fr/perso/dumas/halevt.html
    Bugs: https://bugs.launchpad.net/ubuntu/+filebug
    Origin: Ubuntu

    Testing

    Installing the halevt:
    Installed the following packages:
    halevt (0.1.5-3)
    libboolstuff-0.1-0 (0.1.12-3)
    Reading the help/man
    :~$ halevt -help
    Usage: halevt [option]
    Execute arbitrary commands in response to HAL events

    -c x use config file <x> instead of searching below HOME
    /etc and /usr/share
    -f stay in the foreground, don't run as a daemon
    -g x run as group <x>
    -p x use pid file <x> instead of the default
    '-' means not to use any pid file
    -u x run as user <x>

    -i report events, no configuration read, stay in foreground

    Starting the halevt with the option -f and inserting a CD

    :~$ halevt -f
    hal_interface.c:861 (halevt_run_command) Running: halevt-mount -u /org/freedesktop/Hal/devices/volume_part_1_size_452796416 -o sync -m 002
    hal_interface.c:861 (halevt_run_command) Running: halevt-mount -s
    hal_interface.c:861 (halevt_run_command) Running: halevt-mount -s
    The CD is automounted under the /media/disk

    When removing the CD:
    hal_interface.c:861 (halevt_run_command) Running: halevt-umount -u /org/freedesktop/Hal/devices/volume_part_1_size_452796416; halevt-umount -s
    Cannot find a device to be umounted
    The CD is unmounted.

    Inserting another CD
    hal_interface.c:861 (halevt_run_command) Running: halevt-mount -u /org/freedesktop/Hal/devices/volume_label_040321_2034 -o sync -m 002
    hal_interface.c:861 (halevt_run_command) Running: halevt-mount -s
    ... and the CD #2 is mounted...


    Looking sources from the net > TipsAndTricks_MediaSources
    ...
    To automatically mount removable media (CDROMS, SD/MMC/MS cards, USB sticks,... and hot swap harddrives), I use halevt.

    USB sticks and flash media

    On my Kubuntu 10.04, the configuration file for halevt is located at /etc/halevt/halevt.xml...
    Before you edit, BACKUP !

    Why there are dead links ?
    1. Thread: Please explain how to access old kubuntu forum posts
    2. Thread: Lost Information

    Comment


      #3
      Re: Automounting optical media

      Thanks Rog131!
      That may indeed be the way to go. I installed halevt and it looks like it could be a solution but I haven't figured it out yet. At the moment I only have telnet access to the computer and it sounds like I need to sit there and put disks in to record the events for the config file - if I got that right. It looks like a program well worth having in one's tool kit.

      However, it does not really address the underlying problem. The hard drives are SATA and the optical drives are IDE. Perhaps that gives a hint as to why the installation didn't set things up quite right. All the information on the net seems to refer to gnome-volume-manager, but I can't find it anywhere on the computer and apt-get reports that it "has no installation candidate". If anyone else has any ideas about how automounting is normally configured in Kubuntu, I'd be grateful.

      Comment


        #4
        Re: Automounting optical media

        I've been searching 'til I'm blue in the face and it looks like it's a common bug but no solution yet. I think the problem with this kind of thing is that you can't properly report a bug that has no package candidate.

        I still haven't found out how 10.04 is supposed to mount optical drives, but I found out how it doesn't:
        Lucid is no longer by default using fstab entries for cd/dvd drives. Media that has a filesystem now mounts to /media/<volume label> and also by default there is no /media/cdrom0, /media/cdrom1 dir's created, nor a /media/cdrom link.

        Comment


          #5
          Re: Automounting optical media

          ...If anyone else has any ideas about how automounting is normally configured in Kubuntu, I'd be grateful.
          and
          ...I still haven't found out how 10.04 is supposed to mount optical drives...

          (Here: Kubuntu = buntu + KDE desktop, Ubuntu = buntu + Gnome desktop. ...)

          Here, with the Kubuntu 10.04 KDE 4.4.2

          The KDE should use the settings from the "Removable Devices"

          System Settings > Advanced - tab > Removable Devices
          or
          Right click the "Device Notifier" plasmoid > Device Notifier Settings > Removable Devices

          From the net > How to Manage Removable Devices in KDE

          Here the Removable Devices seems to have this problem > Problem automount CDROM and USB in KDE:
          nttKDE
          Thu May 27, 2010 9:27 pm

          I think the problem is the Device Overrides list (bottom half on your screenshot). Whenever I insert a CDROM or USB Stick. It appears on this list with the column "Automount at login" and "Automount on Attach" unchecked. Since it overrides all the setting at the first half, KDE doesn't automount it.
          =>
          Here, i need to
          - mount the CD once so the named CD is on the Disconnected Devices list
          - click the Automount on attach on the Device Overrides

          Next time the named CD is automounted...


          Ole Juul wrote:
          I still haven't found out how 10.04 is supposed to mount optical drives, but I found out how it doesn't:

          Lucid is no longer by default using fstab entries for cd/dvd drives. Media that has a filesystem now mounts to /media/<volume label> and also by default there is no /media/cdrom0, /media/cdrom1 dir's created, nor a /media/cdrom link.
          Yes, i have noticed this and i have added the CD/DVD devices back to the fstab. I have scripts that are needing the info that the file path is pointing to the cdrom.

          Note !
          The halevt does not work if the cdrom is in the fstab.
          Before you edit, BACKUP !

          Why there are dead links ?
          1. Thread: Please explain how to access old kubuntu forum posts
          2. Thread: Lost Information

          Comment


            #6
            Re: Automounting optical media

            Thanks a lot Rog131 for all your trouble. I'm not sure what to say about all that. I think I'm out of my depth and will just have to wait until the bug gets fixed.

            First there is no KDE on this machine - it is using fluxbox as the GUI. In any event, I don't have easy access to the computer from here. I'm using Telnet.

            Looking at the net and trying to report this as a bug on Launchpad, I seems that many people believe that there is a problem with gnome-volume-manager. However there is no installation candidate. Apt-get reports:
            Package gnome-volume-manager is not available, but is referred to by another package.
            This may mean that the package is missing, has been obsoleted, or
            is only available from another source
            E: Package gnome-volume-manager has no installation candidate
            Other suggestions are equally baffling. For example there is no autofs. I'm not sure if it is safe to install it. Especially since USB automounts already which to me would indicate that some mechanism is already in place which is supposed to do this but is somewhat broken. I don't want to create a conflict. Especially since this machine is being used a lot and I can't afford to take it down for long.

            I think I just have to accept that optical media needs to be mounted by hand in 10.04 and that unmounting gives errors. /sigh However, I'm OK with that.

            Comment


              #7
              Re: Automounting optical media

              Actually, I just made some progress on this front. I installed the 2.6.34-020634-generic kernel. Now it automounts the first optical drive but still not the second. Interestingly wodim also only reports one optical drive now, whereas before it reported two. lshw still shows two.

              Comment

              Working...
              X