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?
|