# CD-ROM not auto-detected [SOLVED]

## mounty1

If I insert a USB, it is detected by the file manager (Thunar) and can be mounted.  A CD-ROM and and DVD-ROM are not.

```
00:00.0 Host bridge: Intel Corporation 4 Series Chipset DRAM Controller (rev 03)

00:01.0 PCI bridge: Intel Corporation 4 Series Chipset PCI Express Root Port (rev 03)

00:1b.0 Audio device: Intel Corporation NM10/ICH7 Family High Definition Audio Controller (rev 01)

00:1c.0 PCI bridge: Intel Corporation NM10/ICH7 Family PCI Express Port 1 (rev 01)

00:1c.1 PCI bridge: Intel Corporation NM10/ICH7 Family PCI Express Port 2 (rev 01)

00:1d.0 USB controller: Intel Corporation NM10/ICH7 Family USB UHCI Controller #1 (rev 01)

00:1d.1 USB controller: Intel Corporation NM10/ICH7 Family USB UHCI Controller #2 (rev 01)

00:1d.2 USB controller: Intel Corporation NM10/ICH7 Family USB UHCI Controller #3 (rev 01)

00:1d.3 USB controller: Intel Corporation NM10/ICH7 Family USB UHCI Controller #4 (rev 01)

00:1d.7 USB controller: Intel Corporation NM10/ICH7 Family USB2 EHCI Controller (rev 01)

00:1e.0 PCI bridge: Intel Corporation 82801 PCI Bridge (rev e1)

00:1f.0 ISA bridge: Intel Corporation 82801GB/GR (ICH7 Family) LPC Interface Bridge (rev 01)

00:1f.1 IDE interface: Intel Corporation 82801G (ICH7 Family) IDE Controller (rev 01)

00:1f.2 IDE interface: Intel Corporation NM10/ICH7 Family SATA Controller [IDE mode] (rev 01)

00:1f.3 SMBus: Intel Corporation NM10/ICH7 Family SMBus Controller (rev 01)

01:00.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] Park [Mobility Radeon HD 5430]

01:00.1 Audio device: Advanced Micro Devices, Inc. [AMD/ATI] Cedar HDMI Audio [Radeon HD 5400/6300 Series]

03:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller (rev 03)
```

  I've followed http://wiki.gentoo.org/wiki/CDROM.It makes no difference whether or not the CD-ROM has an entry in /etc/fstab.This is not an autofs matter --- the inserted USB shows up in Thunar's devices list and that's all I want for the CD-ROM.  There's nothing in dmesg when the CD-ROM is inserted.  It does auto-play on the same machine rebooted into MS-Windows.Any ideas?

----------

## Logicien

Have-you acticate /Devices Drivers/SCSI devices support/SCSI cdrom support in your kernel config?

Have-you activate /File sytems/CDROM/DVD Filesystems/ISO 9660 CDROM file system support and UDF file system support in your kernel config?

----------

## eccerr0r

Definitely check CD/DVD support if you can't detect your drive at all (see dmesg).

Then see if you get an event

$ udevadm monitor

if not, you can try 

    sudo bash -c 'echo 2000 > /sys/block/sr0/events_poll_msecs'

----------

## mounty1

All the kernel options mentioned above are enabled / checked.

After the events_poll_msecs change, on inserting a CD:

```
KERNEL[164266.976764] change   /devices/pci0000:00/0000:00:1f.1/ata1/host0/target0:0:1/0:0:1:0/block/sr0 (block)

UDEV  [164271.362916] change   /devices/pci0000:00/0000:00:1f.1/ata1/host0/target0:0:1/0:0:1:0/block/sr0 (block)
```

but still no auto-detect by Thunar.

The CD can be mounted with an explicit mount command.  However, I really want it to be treated like a USB stick --- presented as a device to Thunar, so that it can be mounted or unmounted thereby.

Kernel config. at http://pastebin.com/fEshAWig.

----------

## eccerr0r

What are your USE flags on Thunar?

----------

## VoidMage

 *Quote:*   

> 
> 
> ```
> 00:1f.2 IDE interface: Intel Corporation NM10/IC :roll: H7 Family SATA Controller [IDE mode] (rev 01)
> ```
> ...

 

 :Rolling Eyes:  Honestly,...

----------

## mounty1

 *eccerr0r wrote:*   

> What are your USE flags on Thunar?

 

```
[ Legend : U - final flag setting for installation]

[        : I - package is installed with flag     ]

[ Colors : set, unset                             ]

 * Found these USE flags for xfce-base/thunar-1.6.3:

 U I

 + + dbus                 : Enable dbus support for anything that needs it

                            (gpsd, gnomemeeting, etc)

 - - debug                : Enable extra debug codepaths, like asserts and

                            extra output. If you want to get meaningful

                            backtraces see

                            http://www.gentoo.org/proj/en/qa/backtraces.xml

 + + exif                 : Add support for reading EXIF headers from JPEG and

                            TIFF images

 + + libnotify            : Enable desktop notification support

 + + pcre                 : Add support for Perl Compatible Regular Expressions

 + + startup-notification : Enable application startup event feedback mechanism

 - - test                 : Workaround to pull in packages needed to run with

                            FEATURES=test. Portage-2.1.2 handles this

                            internally, so don't set it in

                            make.conf/package.use anymore

 + + udisks               : Enable storage management support (automounting,

                            volume monitoring, etc)

 + + xfce_plugins_trash   : Build thunar-tpa (trash) plugin for panel
```

It does work for USB sticks, so it's unlikely to be a Thunar problem, as they're all just volumes at that level.

----------

## eccerr0r

Now I have to look at a real machine with Thunar installed as I don't know if Thunar code handles this properly - it needs to listen to dbus that media got inserted and act accordingly.  This is slightly different because the *drive* will always exist, but the *media* in the drive may not.  For a USB stick the *drive* and the *media* go away together.

It looks like my machine doesn't even behave right with removable media.

Do you have thunar-volman installed?  I need to install that to see what next...  Unfortunately this is a machine that's I don't tend to use, so not going to be a high priority debug effort...

----------

## mounty1

 *eccerr0r wrote:*   

> Do you have thunar-volman installed?

 Yes.

Are you really saying that Thunar might not be able to handle removable media ?  Surely I wouldn't have been the first person to notice that ?

----------

## eccerr0r

No idea, agreed doesn't make sense why removable drives work but removable media does not... but they do need to be handled differently.

----------

## VoidMage

Looks like everyone missed my point.

It's in  '[IDE mode]' - it should be AHCI. Might or might not matter, but it's something to check. Change it in BIOS.

----------

## eccerr0r

I have old regular IDE CDROM drives that autodetect media with polling, hence I'm not sure AHCI is necessary.

AHCI is great for autodetecting the whole drive however, as regular IDE is NOT made for hotplug.

----------

## VoidMage

 *eccerr0r wrote:*   

> I have old regular IDE CDROM drives that autodetect media with polling, hence I'm not sure AHCI is necessary.

 

Irrelevant, you're confusing the drive with the controller here.

Also, IDE CDROM would be connected to an IDE controller.

----------

## mounty1

 *VoidMage wrote:*   

> Irrelevant, you're confusing the drive with the controller here.
> 
> Also, IDE CDROM would be connected to an IDE controller.

 Well whatever it is, MS-Windows seems to deal with it alright.  By setting the polling interval to 2 s (as above), I can get udev to see something when a CD be inserted, but that doesn't go all the way up the stack to Thunar.

----------

## eccerr0r

 *VoidMage wrote:*   

> Irrelevant, you're confusing the drive with the controller here.
> 
> Also, IDE CDROM would be connected to an IDE controller.

 

Actually, AHCI is completely irrelevant and you missed the point that the original problem is that the machine cannot autodetect media insertion/removal, not that the machine cannot detect the drive.  The point was being made because even old Linux distributions using old IDE CDROM hardware is still able to autodetect CDs inserted into the drive, without any hint of AHCI - you can see the icon changing to the cdrom's .ico file when you insert a disk, just by inserting media (of course, blank or defective media would throw this into a tizzy and hence I tend to disable this feature anyway and don't care it doesn't work :-)).

The issue indeed is that there should be a dbus message passed from udev to Thunar.  This message pathway is not working, or Thunar is ignoring the insert event for some reason.  Next item of interest is if udev is announcing the insert on dbus or not... unfortunately I don't know the best incantation to sniff dbus for this event.  But I suspect this is working as USB flash drive plug-ins works fine...  You could also try turning on USE=debug for Thunar and/or thunar-volman and see if it detects any dbus events for media insertion or not.

This should be the same problem as having those card readers and plugging a new card should generate an event to the GUI that new media was inserted into the slot (versus the reader plugged into USB).  It would be great that it's interrupt driven but unfortunately most flash media readers require polling just like CD/DVD drives.

----------

## VoidMage

 :Rolling Eyes:  Gosh...

IDE mode of AHCI controller exists pretty much for the sake of Windows XP only, as it was released before those became ubiquitous, so the original install CDs wouldn't work with them. For quite a few years, "AHCI controller in IDE mode" means pretty much "system configured not quite correctly"

I'm not saying that I'm sure the above is behind the problems, but it's something to clean up.

As for those 'incantations', 'udevadm monitor' and 'udisksctl monitor' should cover most of it, though out of curiosity, post 'udevadm info' on the cdrom node to.

----------

## Logicien

In the Preferences of Thunar, Advanced options, there is a check box to allow Thunar to manage volumes with a link to confiugre them. Is it activated?

Is your user is in the cdrom group? If there's a dbus group, it can be a good idea to include a normal user to it.

In /etc/fstab, having a line for the mount of the cdrom with the user or the users option (see man mount) can help to automount cds inserted in the cdrom.

I use autofs who is a good automounter for cds.

----------

## VoidMage

 *Logicien wrote:*   

> Is your user is in the cdrom group? If there's a dbus group, it can be a good idea to include a normal user to it.

 

As long as you have TMPFS_POSIX_ACL for DEVTMPFS, cdrom group should be irrelevant for udisks.

 *Logicien wrote:*   

> In /etc/fstab, having a line for the mount of the cdrom with the user or the users option (see man mount) can help to automount cds inserted in the cdrom.

 

Under udisks1 that was actually harmful, under udisks2 it's - again - irrelevant.

----------

## Logicien

So VoidMage,

pass to AHCI mode is it what you propose? Is the dbus and udisks flag should be set globally?

----------

## VoidMage

 :Rolling Eyes:  How many times I've got to repeat myself - no, I'm not saying I'm sure switching to AHCI will matter, I just want to make sure we're handling a common, instead of a corner case.

For file managers  with udisks backend, it doesn't matter all that much whether it's an usb drive or a cdrom, so that strongly hints the problem lies deeper.

While most common AHCI-controler-in-IDE-mode problems are of a different type, I just want to make sure it's not simply an uncommon one.

That dbus path route is a one to check too, but again, if it works with usb, it seems quite unlikely.

----------

## eccerr0r

I had forgotten I had xfce installed on my server and this pathway actually works (see how much I actually login onto its console...) - at least it detects USB attached CDROM drive media as I eject and insert as well as media inserted into flash readers.  In the idle state upon fresh login and USB cdrom attached I see thunar-volman --device-added /sys/jibberjabber/path/to/sr0 and Thunar running.   All these removable medias show up on the desktop.

I found a new thing to help debug:

```
user$ dbus-monitor --system
```

This will actually monitor if udev is actually dumping something on dbus that media got inserted.

One thing to make sure for this udisks mounting: There should NOT be an entry in /etc/fstab for the drive, with user option or noauto or not.  I'd even make sure there's no mention of /dev/sr0 at all in /etc/fstab, though commented out lines are OK.

You also may want to try re-emerging thunar, thunar-volman, dbus, udisks, and udev for the heck of it...

----------

## mounty1

 *eccerr0r wrote:*   

> One thing to make sure for this udisks mounting: There should NOT be an entry in /etc/fstab for the drive, with user option or noauto or not.

 This fixed it.  I had tried it before but I think there were other things wrong but this time, it was the last obstacle and removing it has solved the problem so thanks to you and the others who contributed.

The next step is to be able to play a video DVD rather than just open it and look at VIDEO_TS etc.  Should Parole be able to do this?

----------

