# [solved] missing optical drive

## deathraccoon

my optical drive becomes randomly invisible to applications like vlc and k3b. they simply don't list the drive as available. if I manually 

```
mount /dev/sr0 /mnt/cdrom
```

 I am able to list the contents of the disc, howver no grapical application (k3b, vlc, dragon player, devede) sees it. oddly, this has only happened with this Gentoo installation. I've had Arch and Debian on this machine with no problem.

```
procyon@gentoo ~ $ sudo dmesg | grep /dev/sr0

procyon@gentoo ~ $ sudo dmesg | grep sr0

[    2.302746] sr 0:0:0:0: [sr0] scsi3-mmc drive: 94x/125x writer dvd-ram cd/rw xa/form2 cdda tray

[    2.302866] sr 0:0:0:0: Attached scsi CD-ROM sr0

[  411.617401] VFS: busy inodes on changed media or resized disk sr0

procyon@gentoo ~ $ 

```

support for scsi optical drive is compiled into the kernel. I am using 3.18.9-gentoo. any help is appreciated, my dvd burner is needed often.Last edited by deathraccoon on Wed Apr 29, 2015 2:58 pm; edited 1 time in total

----------

## eccerr0r

Are you using udev/udisks/policykit/consolekit (or systemd)?

How did you set up your machine (emerge --info)?

----------

## deathraccoon

in an attempt to fix this issue, I moved to systemd only moments ago. the disc was identified by the kde device manager as a loop device. I ejected the tray, reinserted it and it appeared again as an optical device in the k3b window. this is very odd behavior, and it never happened with my Arch or Debian systems-- hence the idea to move to systemd to fix it. when I issued umount /dev/sr0 I received a kde pop-up window asking me for root authentication because the device was in use by another user. I don't know if the exact syntax can be found in the logs-- but that was the gist of the message.

to address your questions. I was using openrc, udev and consolekit. the drive acted strange. I dropped them to move to systemd and the behavior persists. here is the system:

```
procyon@gentoo ~ $ sudo emerge --info

Portage 2.2.14 (python 2.7.9-final-0, default/linux/amd64/13.0/desktop/kde/systemd, gcc-4.8.3, glibc-2.20-r2, 3.18.9-gentoo x86_64)

=================================================================

System uname: Linux-3.18.9-gentoo-x86_64-AMD_Phenom-tm-_II_X6_1100T_Processor-with-gentoo-2.2

KiB Mem:    12271676 total,     69704 free

KiB Swap:   12582908 total,  12582908 free

Timestamp of tree: Tue, 31 Mar 2015 02:15:01 +0000

ld GNU ld (Gentoo 2.24 p1.4) 2.24

app-shells/bash:          4.2_p53

dev-java/java-config:     2.2.0

dev-lang/perl:            5.20.1-r4

dev-lang/python:          2.7.9-r1, 3.3.5-r1, 3.4.1

dev-util/cmake:           2.8.12.2-r1

dev-util/pkgconfig:       0.28-r1

sys-apps/baselayout:      2.2

sys-apps/openrc:          0.13.11

sys-apps/sandbox:         2.6-r1

sys-devel/autoconf:       2.13, 2.69

sys-devel/automake:       1.11.6-r1, 1.13.4

sys-devel/binutils:       2.24-r3

sys-devel/gcc:            4.8.3

sys-devel/gcc-config:     1.7.3

sys-devel/libtool:        2.4.6

sys-devel/make:           4.1-r1

sys-kernel/linux-headers: 3.18 (virtual/os-headers)

sys-libs/glibc:           2.20-r2

Repositories: gentoo megacoffee gamerlay silmano

ACCEPT_KEYWORDS="amd64"

ACCEPT_LICENSE="*"

CBUILD="x86_64-pc-linux-gnu"

CFLAGS="-march=amdfam10 -O2 -pipe"

CHOST="x86_64-pc-linux-gnu"

CONFIG_PROTECT="/etc /usr/lib64/libreoffice/program/sofficerc /usr/share/config /usr/share/gnupg/qualified.txt /usr/share/themes/oxygen-gtk/gtk-2.0 /usr/share/themes/oxygen-gtk/gtk-3.0 /var/lib/hsqldb /var/lib/i2pd/certificates"

CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/splash /etc/terminfo"

CXXFLAGS="-march=amdfam10 -O2 -pipe"

DISTDIR="/usr/portage/distfiles"

FCFLAGS="-O2 -pipe"

FEATURES="assume-digests binpkg-logs config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync news parallel-fetch preserve-libs protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync"

FFLAGS="-O2 -pipe"

GENTOO_MIRRORS="http://mirror.lug.udel.edu/pub/gentoo"

LANG="en_US.utf8"

LDFLAGS="-Wl,-O1 -Wl,--as-needed"

MAKEOPTS="-j6"

PKGDIR="/usr/portage/packages"

PORTAGE_CONFIGROOT="/"

PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"

PORTAGE_TMPDIR="/var/tmp"

PORTDIR="/usr/portage"

PORTDIR_OVERLAY="/var/lib/layman/megacoffee /var/lib/layman/gamerlay /var/lib/layman/silmano"

SYNC="rsync://rsync.us.gentoo.org/gentoo-portage"

USE="3dnow 3dnowext X \ a52 aac aalib acl acpi addressbook adns alsa amd64 apm avahi bash-completion berkdb branding bzip2 cairo calendar cdda cdparanoia cdr cli cracklib crypt cryptsetup curl cxx dbus declarative dhcp dri dts dvd dvdr emboss encode exif fam fbcon ffmpeg firefox flac fontconfig fortran frei0r ftp gdbm geoip gif glamor gphoto2 gpm gzip handbook hddtemp iconv imagemagick imap inotify javascript joystick jpeg jpeg2k kde kdenlive kerberos kipi kontact lcms ldap libnotify libsamplerate lm_sensors lzo mad matroska melt mmx mmxext mng modules mozilla mp3 mp4 mpeg mplayer mtp multilib mysql ncurses nls nptl nsplugin nvidia\ offensive ogg opengl openmp oss pam pango pcre pdf perl phonon php plasma png policykit popcnt portaudio ppds pulseaudio qt3support qt4 qt5 raw readline sdl semantic-desktop session smp socks5 sound spell sse sse2 sse3 sse4a ssl startup-notification svg symlink syslog systemd tcpd themedesigner theora tiff truetype udev udisks unicode upnp upnp-av upower usb v4l vaapi vdpau video videos vorbis wifi wxwidgets x264 xcb xcomposite xinerama xml xscreensaver xv xvid zeroconf zlib" ABI_X86="64 32" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="kexi words flow plan sheets stage tables krita karbon braindump author" CAMERAS="canon" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="mmx mmxext sse sse2 sse3 sse4a 3dnow 3dnowext popcnt" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ublox ubx" INPUT_DEVICES="evdev joystick keyboard mouse" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LINGUAS="en_GB en" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-5" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="python2_7 python3_3" RUBY_TARGETS="ruby19 ruby20" USERLAND="GNU" VIDEO_CARDS="nvidia" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"

Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, USE_PYTHON

```

side note, if this can be fixed in a manner which allows me to return to openrc, that would be ideal.

----------

## eccerr0r

You didn't have to move to systemd :o  It should have worked either way (that is, using udisks and consolekit/policykit or systemd).  I just wanted to confirm you were using one of these versus trying to get this to work without the 'needed' software infrastructure - a common problem when you're installing Gentoo.

If you have the software infrastructure, the most common way to break this is to have the cdrom device in /etc/fstab somewhere.  If you have a reference to you cdrom there, the udisks code will honor that first and will not try to 'detect' the cdrom.

Actually re-reading your post this is a very strange problem... it "randomly" becomes unavailable?  Then that's a different problem and much harder to solve... nevermind...

----------

## deathraccoon

it is very strange indeed. I can verify there is nothing wrong with the drive-- the bios sees it and I can boot from disc.

oddest is that this only happens in Gentoo. I use genkernel with a few tweaks, so it's not my kernel. when mounting from the command line I can 'ls /mnt/cdrom' and see the contents of the drive every time. it's just that no graphical application recognizes it, and KDE's device manager sometimes "shows" it as a loop device. could this be a KDE problem? I am stuck and I really need that drive to function.

----------

## eccerr0r

You need to be a bit more clear..."Random" or not random...

If some apps always shows it this way and others see it another way, that's not random... 

If you can always mount it, that's not random.

Manually mounting the drive with the 'mount' command, will also tend to make the drive disappear especially if you use root to mount.  If your setup is working properly, you should never need the 'mount' command to use the cdrom.  But once again, if this is different from other distributions, there's something wrong and need more clarification of what the symptoms are.

I've basically only used Gnome and XFCE, so not sure if there are any KDE specific issues here, but KDE still uses the same *kit (or systemd) infrastructure to let you see disks without needing to su to root...

----------

## deathraccoon

my fstab:

/dev/sr0        /mnt/cdrom         auto           user,noauto

relevant dmesg:

sudo dmesg | grep sr0

[    1.832199] sr 0:0:0:0: [sr0] scsi3-mmc drive: 62x/125x writer dvd-ram cd/rw xa/form2 cdda tray

[    1.832619] sr 0:0:0:0: Attached scsi CD-ROM sr0

[   67.738887] udevd[4093]: timeout 'ata_id --export /dev/sr0'

[   68.253580] udevd[4093]: timeout 'scsi_id --export --whitelisted -d /dev/sr0'

[   68.916313] udevd[4078]: worker [4093] /devices/pci0000:00/0000:00:11.0/ata1/host0/target0:0:0/0:0:0:0/block/sr0 timeout; kill it

[   68.916342] udevd[4078]: seq 1777 '/devices/pci0000:00/0000:00:11.0/ata1/host0/target0:0:0/0:0:0:0/block/sr0' killed

when I say random... I've tried to pin it down to no avail... sometimes when I boot with a disc in the tray, it appears (by appears, I mean in the device notifier and in applications as an optical disc). other times, removing and reinserting the disc makes it appear. and when I do 'mount /dev/sr0 /mnt/cdrom' it will sometimes appear correctly and other times be listed as a loop device by the system. however, I am always able to mount the device manually and access the files from a shell prompt. I have tried different fstab settings, different kernel configurations, even voodoo and witchcraft and nothing sticks.

----------

## eccerr0r

That entry in /etc/fstab should not be there, auto or noauto - it needs to be gone or completely commented out.  If you have it there, it means that udisks is assuming the user (or root) will be handling it and won't touch.

Udisks assumes all removable disks (including USB) that aren't mentioned in /etc/fstab are on console, and if consolekit(or systemd) knows you're at console, it can/will mount for you when they are attached.

----------

## deathraccoon

I removed the fstab entry (side note-- maybe clarify that in the installation handbook?) so, it appeared properly for the next three boots, then returned to it's prior behaviour. this baffles me. I have no experience writing udev rules. it there perhaps something I could do there to rectify the situation?

----------

## deathraccoon

to clarify an earlier statement... my foray into the netherland of systemd was brief and regrettable. I have returned to the fold and won't do that again. however, I will say... that system booted FAST.

----------

## deathraccoon

bought a new drive. problem solved.

----------

