Latest LQ Deal: Linux Power User Bundle
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 06-04-2005, 12:54 PM   #1
LQ Newbie
Registered: May 2004
Posts: 14

Rep: Reputation: 0
eject command

if i have more than one CD drives(ie,/mnt/cdrom and /.mnt/cdrom1)how can i eject a CD inserted in to the second cd drive(/mnt/cdrom1)using eject command.
Simple eject is not working

I am using redhat 9

with regards
Old 06-04-2005, 01:01 PM   #2
Senior Member
Registered: Apr 2005
Location: BrewCity, USA (Milwaukee, WI)
Distribution: Xubuntu 9.10, Gentoo 2.6.27 (AMD64), Darwin 9.0.0 (arm)
Posts: 1,152

Rep: Reputation: 46
eject /dev/hdx

with hdx being your cdrom device
Old 06-04-2005, 01:12 PM   #3
LQ Newbie
Registered: May 2004
Posts: 14

Original Poster
Rep: Reputation: 0
if there is only one device simple 'eject' will eject the device
if there is 2 or more devices, can i use the commands like 'eject1' or any other simple commands with out specifying device name

Old 06-04-2005, 01:48 PM   #4
Registered: Aug 2003
Distribution: Gentoo
Posts: 73

Rep: Reputation: 15
I have 3 optical drives in my machine running Gentoo.

If I go to the directory /dev/cdroms/ I can see cdrom0, cdrom1, cdrom2.

To eject them, I typed "eject /dev/cdroms/cdrom1" and that device ejected. Then I change to 0 and 2 and they ejected as well. Give that a shot.

If they work, you can write a script or make an alias command in your .bashrc file.

Last edited by needforspeed; 06-04-2005 at 01:50 PM.
Old 06-04-2005, 02:13 PM   #5
LQ Newbie
Registered: Jun 2004
Location: The city of Lost Angels
Distribution: RedHat and Gentoo
Posts: 21

Rep: Reputation: 15
You could create aliases and add them to your /etc/profile.. For example:

alias eject1="eject /dev/cdrom1"
alias eject2="eject /dev/cdrom2"


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
VCD does not eject even eject button pressed ic_torres Linux - Software 4 12-01-2005 05:40 PM
cd eject? mithereal Debian 6 08-09-2005 09:36 AM
bash command for cdrom eject? hexadevil Linux - Newbie 5 06-02-2004 04:00 PM
Cd won't eject techrolla Fedora 13 11-29-2003 08:45 PM
CD Won't Eject With "eject" Command Dr. Ephemeron Slackware 13 11-13-2003 12:27 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 10:25 PM.

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