WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Eject CD  (Read 3899 times)

Offline newbean

  • Newbie
  • *
  • Posts: 24
Eject CD
« on: June 26, 2010, 10:13:28 AM »
tc@box:~$ eject
eject: /dev/cdrom: Input/output error

I can't eject my CD with eject command.
Is this a bug?

newbean

Offline maro

  • Hero Member
  • *****
  • Posts: 1228
Re: Eject CD
« Reply #1 on: June 27, 2010, 11:17:05 PM »
Not sure what might be your problem since it works at my end. I can only suspect that the soft link might not be correctly set up. In my case it looks like this:
Code: [Select]
tc@box:~$ ls -l /dev/cdrom
lrwxrwxrwx    1 root     root             8 Jun 28 17:29 /dev/cdrom -> /dev/hdc
It could well be different if you have more then one CD-ROM and / or DVD device.

Do you know the correct device name? In this case you could try it with: eject /dev/hdd (if '/dev/hdd' is your CD-ROM).

Offline Jason W

  • Administrator
  • Hero Member
  • *****
  • Posts: 9730
Re: Eject CD
« Reply #2 on: June 28, 2010, 01:39:42 AM »
I bet you still have the cd mounted, that is the error message I get if I use the eject command on a mounted cd drive.

Offline newbean

  • Newbie
  • *
  • Posts: 24
Re: Eject CD
« Reply #3 on: June 28, 2010, 10:27:58 AM »
To mario,

My ll /mnt/cdrom displays:
tc@box:~$ ll /dev/cdrom
lrwxrwxrwx    1 root     root             8 Jun 28 16:43 /dev/cdrom -> /dev/sr0

I'm using tinycore_3.0alpha8.iso

I've tried:
eject
eject -T /dev/hdc
eject -T /dev/sr0
eject hdc
eject sr0
eject cdrom
eject /dev/cdrom

nothing works

The funny thing is it mount-up OK using the mounting tool on the control panel and the eject command works in Ubuntu 10.04

Hmmm
I think that /dev/cdrom link is the problem, but I don't have a unmount command at my disposal to reset it.

Thanks
newbean

Offline newbean

  • Newbie
  • *
  • Posts: 24
Re: Eject CD
« Reply #4 on: June 28, 2010, 10:31:23 AM »
To: Jason W

I tried eject mounted and unmounted (using the "Mount Tool" in the Control Panel)
but nadda both ways.

Thanks
newbean

Offline maro

  • Hero Member
  • *****
  • Posts: 1228
Re: Eject CD
« Reply #5 on: June 28, 2010, 03:39:32 PM »
newbean: Trust me the eject command also works with TC. There is not much gain in trying out too many permutations of a command when only few are making sense. The only ones that should work for your case are either eject or eject /dev/cdrom or eject /dev/sr0.

I currently only have a TC 2.x system running and I only own IDE CD-ROMs. Therefore my testing does not mirror your situation, but I'd be very surprised if it turns out that either aspect makes a difference here.

Since command line output is so much either to post here as response I'd like to suggest you share your output of the following command sequence as another round of troubleshooting:
    cat /etc/sysconfig/cdroms ;  echo ; mount | grep '^/dev/' | grep -v loop ; eject

Offline newbean

  • Newbie
  • *
  • Posts: 24
Re: Eject CD
« Reply #6 on: June 29, 2010, 10:13:06 AM »
To: mario

Here is what I get:

tc@box:~$   cat /etc/sysconfig/cdroms;
/dev/sr0 /dev/hdc

tc@box:~$ mount | grep '^/dev/' | grep -v loop ;
/dev/sda2 on /mnt/sda2 type ext3 (rw,relatime,barrier=1,data=ordered)

tc@box:~$ eject
eject: can't open '/dev/cdrom': No such file or directory


This might be an AMD64 processor conflict with Tiny Core's 386 built image, but I'm only guessing.

That was a nice piece of detective work in your line of code.
I'm still learning Linux and I greatly appreciate your time.

I 'll just live w/o eject..  It was convenient to use on the command line.

Thanks mario
newbean



Offline ^thehatsrule^

  • Administrator
  • Hero Member
  • *****
  • Posts: 1726
Re: Eject CD
« Reply #7 on: July 01, 2010, 12:18:27 AM »
Did you try `eject /dev/hdc`?

To: mario
Think that's maro ;)

Quote
This might be an AMD64 processor conflict with Tiny Core's 386 built image, but I'm only guessing.
Unlikely (note that TC minimum is i486)

I bet you still have the cd mounted, that is the error message I get if I use the eject command on a mounted cd drive.
I think eject tries to unmount if it's already mounted but that may fail if the contents are in use.

Offline Jason W

  • Administrator
  • Hero Member
  • *****
  • Posts: 9730
Re: Eject CD
« Reply #8 on: July 01, 2010, 08:06:24 AM »
I used the eject command as a non-root user to duplicate what the OP was doing, therefore the unmount would not take place.

Offline newbean

  • Newbie
  • *
  • Posts: 24
Re: Eject CD
« Reply #9 on: July 01, 2010, 06:47:27 PM »
To: Jason W

It won't eject using: sudo eject.

But eject works fine in Ubunti 10.04

Thanks
newbean