Issue ejecting CD-R used to boot Linux
I have a customized Linux distro that I am able to boot from CD-R, where using start-up scripts I am able to run udev to discover and setup my device nodes, and then install a CLFS distro onto the HDD. Everything goes well except when I am "done".
I am unable to successfully eject the CD-R. When I attempt to do so (using the 'eject' command), the CD-ROM tray opens up and then immediately shuts close again, never giving me a chance to physically remove the CD-R. The interesting part is that once this happens, I still have a command prompt and a shell running, however I cannot run any system commands. It is as if the CD-R is no longer mounted, which probably is the case. Anyhow, what can I do to get the CD-ROM tray to remain open so that I can have an opportunity to remove the media? Btw, my CD-ROM device is /dev/hdb and /dev/cdrom has been setup properly using udev and related rules. So everything is good with respect to that. |
eject is supposed to unmount but run..... man eject....... you may notice -v switch
[gordy@gs ~]$ eject -v cdrom eject: device name is `cdrom' eject: expanded name is `/dev/cdrom' eject: `/dev/cdrom' is a link to `/dev/hda' eject: `/dev/hda' is mounted at `/media/cdrom' eject: unmounting device `/dev/hda' from `/media/cdrom' eject: `/dev/hda' is a multipartition device eject: trying to eject `/dev/hda' using CD-ROM eject command eject: CD-ROM eject command succeeded 2) in fstab....change to users,blah blah 0 0 in lieu of user (root) using root powers and see if that makes a difference. |
aus9 -
I found an error in one of my scripts, corrected it, and now I cannot get the CD-tray to open at all. Using your advice, I ran the eject command with the "-v" option. Here is the output I received: Code:
/usr/bin/eject: device name is '/dev/cdrom' Any ideas as to where else I can focus on to resolve this issue? P.S. The CD-ROM drive is a Plextor PX-230A IDE/ATAPI unit. |
do you mind posting the script that you fixed please, in case others can suggest an alternative in your intentions...
2) post all lines of cd/dvd removeable media in your /etc/fstab and are you using HAL daemon to automount or udev or manual commands. 3) leaping ahead...its messy but without fixing your script...delete your fsab lines...change hal rules not automount and use manual commands then a manual umount should work. I use users...not user in fstab to allow normal user to mount/umount cds |
To fulfill your request, I've provided the information below. Please remember that I am booting from a CD, and then attempting to eject such CD when I am done.
For /boot/grub/menu.lst: Code:
... Code:
# Used only when booting from CD-ROM Code:
#!/bin/sh Code:
#!/bin/sh Code:
#!/bin/sh When I select "Cancel", the GUI app terminates, followed by X11, and then control is returned to do_install_wrapper.sh. I see the "Please reboot the system..." banner but the CD-R is never ejected. My system does not use HAL, thus there is no automounter. |
I think that your problem may be that you have /dev/hdb listed twice in /etc/fstab. Try removing the first of the two lines (/cdrom), reboot, and see what happens.
-------------------------- Steve Stites |
I agree but is this script on a re-mastered cdr or on the hard drive...your first post, I thought the cdr was used to install an os onto the hd....now I am not so sure.
btw, that looks like an oldish kernel...I assume http://trac.cross-lfs.org/ allows you to update to a new kernel if you wanted to? you are more advanced than me...I have never used LFS. |
Quote:
Two more CD-R disks, err coasters, created! Yay! |
Quote:
The OS running on the CD-R is a morph of the CLFS. In lieu of using a huge suite of packages, I rely on BusyBox for my shell and various system utilities. The 'eject' command is not part of BusyBox; it is provided by the eject-2.1.5 source package. News update... I have found that I can eject the CD-R if I place two 'eject' statements back-to-back in my script. When the second 'eject' is called, the "CDROM eject" command works, as opposed to the first time where it fails and 'eject' issues a "SCSI eject" command. Now for another problem, if I install the CLFS distro onto the HDD, and following this the two eject commands are issued, then half of my screen is filled with error messages similar to the following: Code:
[ 340.092309] Buffer I/O error on device hdb, logical block 199157 |
I can not help...but why not buy cdrws to save on coasters
|
The CD-R disks are free... my employer buys them. As for the environment, well I'll worry about that tomorrow.
|
Have a look at the shutdown script for knoppix - you'll (probably) need to set the unlock and autoeject flags.
|
I'm leaving to go on holiday tomorrow, and I won't be able to return to this problem for a few weeks. For now, I've decided to use the kludge I discovered earlier.
For my do_install_wrapper.sh script, I have modified it to use two 'eject' commands. This forces the CD-ROM tray to eject the disk. Here's the modified portion of the script: Code:
... |
It's been more than a few weeks, have you returned to the problem & found a more elegant solution?
|
No I was not able to return to this issue. It would be nice to resolve, however I just learned to accept it. The issue will only be seen at the factory (or by service personnel) and never by the client. Nevertheless, it would be nice to clean it up.
|
All times are GMT -5. The time now is 05:55 AM. |