LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 06-01-2005, 12:48 PM   #1
uselpa
Senior Member
 
Registered: Oct 2004
Location: Luxemburg
Distribution: Slackware, OS X
Posts: 1,507

Rep: Reputation: 47
KDE: problems ejecting CDs


All,

Mounting and unmounting CDs or DVDs works perfectly from the command line.
pu@slackw:~$ mount /media/cdrom/
pu@slackw:~$ du -s /media/cdrom/
4543179 /media/cdrom/
pu@slackw:~$ umount /media/cdrom/
pu@slackw:~$ eject -v /dev/cdrom
eject: device name is `/dev/cdrom'
eject: expanded name is `/dev/cdrom'
eject: `/dev/cdrom' is a link to `/dev/hdc'
eject: `/dev/hdc' is not mounted
eject: `/dev/hdc' is not a mount point
eject: `/dev/hdc' is a multipartition device
eject: trying to eject `/dev/hdc' using CD-ROM eject command
eject: CD-ROM eject command succeeded

When I mount a CD by clicking on the "CD-ROM" icon on my KDE desktop, Konqueror opens and shows the contents (data). I close Konqueror, I am able to unmount the CD by right-clicking the "CD-ROM" icon and choosing "unmount". However, if I chose "eject", I get the message "eject /dev/cdrom" failed.

lsof gives me the following:
pu@slackw:~$ lsof /dev/cdrom
COMMAND PID USER FD TYPE DEVICE SIZE NODE NAME
kio_audio 7367 pu 12r BLK 22,0 4183 /dev/hdc
kio_audio 7367 pu 13r BLK 22,0 4183 /dev/hdc

If I use the eject command from bash as a normal user, the CD is not ejected:
pu@slackw:~$ eject -v /dev/cdrom
eject: device name is `/dev/cdrom'
eject: expanded name is `/dev/cdrom'
eject: `/dev/cdrom' is a link to `/dev/hdc'
eject: `/dev/hdc' is not mounted
eject: `/dev/hdc' is not a mount point
eject: `/dev/hdc' is a multipartition device
eject: trying to eject `/dev/hdc' using CD-ROM eject command
eject: CD-ROM eject command failed
eject: trying to eject `/dev/hdc' using SCSI commands
eject: SCSI eject failed
eject: trying to eject `/dev/hdc' using floppy eject command
eject: floppy eject command failed
eject: trying to eject `/dev/hdc' using tape offline command
eject: tape offline command failed
eject: unable to eject, last error: Invalid argument

The same as root works:
root@slackw:/dev$ eject -v /dev/cdrom
eject: device name is `/dev/cdrom'
eject: expanded name is `/dev/cdrom'
eject: `/dev/cdrom' is a link to `/dev/hdc'
eject: `/dev/hdc' is not mounted
eject: `/dev/hdc' is not a mount point
eject: `/dev/hdc' is a multipartition device
eject: trying to eject `/dev/hdc' using CD-ROM eject command
eject: CD-ROM eject command failed
eject: trying to eject `/dev/hdc' using SCSI commands
eject: SCSI eject failed
eject: trying to eject `/dev/hdc' using floppy eject command
eject: floppy eject command failed
eject: trying to eject `/dev/hdc' using tape offline command
eject: tape offline command failed
eject: unable to eject, last error: Invalid argument

And, as a normal user, killing the process keeping /dev/cdrom in use also works:
pu@slackw:~$ kill 7367
pu@slackw:~$ eject -v /dev/cdrom
eject: device name is `/dev/cdrom'
eject: expanded name is `/dev/cdrom'
eject: `/dev/cdrom' is a link to `/dev/hdc'
eject: `/dev/hdc' is not mounted
eject: `/dev/hdc' is not a mount point
eject: `/dev/hdc' is a multipartition device
eject: trying to eject `/dev/hdc' using CD-ROM eject command
eject: CD-ROM eject command succeeded

So I guess all this is due to a KDE process keeping /dev/cdrom busy, although that still does not explain why root is able to eject the CD without killing the process first.

My definitions are as follows:
root@slackw:/dev$ cat /etc/fstab | grep cdrom
/dev/cdrom /media/cdrom auto noauto,user,ro 0 0

root@slackw:/dev$ v cdrom
lrwxrwxrwx 1 root cdrom 8 2005-06-01 19:32 cdrom -> /dev/hdc

root@slackw:/dev$ v hdc
brw-rw---- 1 root cdrom 22, 0 2005-06-01 18:17 hdc

pu@slackw:~$ id
uid=1000(pu) gid=1000(pu) groups=6(disk),17(audio),18(video),19(cdrom),20(games),100(users),1000(pu)

So my questions are:
- what is this kio_audio process doing there, especially after the CD has been unmounted?
- why can root eject without killing the offending process?
 
Old 06-01-2005, 01:34 PM   #2
uselpa
Senior Member
 
Registered: Oct 2004
Location: Luxemburg
Distribution: Slackware, OS X
Posts: 1,507

Original Poster
Rep: Reputation: 47
I solved the problem temporarily by modifying /opt/kde/bin/kdeeject:

*)
for p in `lsof -t $1` ; do # added by uselpa 3 lines
kill $p
done
eject $1 >/dev/null 2>&1
;;
 
Old 09-24-2005, 11:32 AM   #3
koyi
Member
 
Registered: Jul 2003
Location: Osaka, Japan
Distribution: Arch, Ubuntu
Posts: 421

Rep: Reputation: 31
I solved it by changing the permission of my DVD-RW and DVD-ROM to 666. Maybe a security risk, though.

Adding yourself to group "disk" and "cdrom"(check the group of the related device file) may help, too.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Install KDE 3.4 on Mandriva from FC4 CDs Mehtaw Linux - Software 1 08-04-2005 09:41 AM
KDE problem (I think) ejecting cdrom firehawk256 Linux - Software 2 01-09-2005 10:57 AM
ejecting CD with kde lopette Linux - Hardware 0 09-12-2004 09:34 AM
CD-rw problems Ejecting jklaroe Slackware 4 06-20-2004 03:22 PM
cd ejecting in KDE vinthund Linux - Newbie 1 02-09-2004 09:03 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 01:33 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration