LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices


Reply
  Search this Thread
Old 02-12-2011, 03:54 PM   #1
securobo
LQ Newbie
 
Registered: Feb 2011
Posts: 1

Rep: Reputation: 0
Question Eject cdrom and shutdown computer


When using a live distribution, I can exit the system with the following command

Code:
shutdown -h now
This however does not eject the cdrom

I tried

Code:
shutdown -h now | eject
This shutdown the system, but did not eject the cdrom. It also noted an error that the cdrom was in use.

How can I properly eject the cdrom with the shutdown command?
 
Old 02-12-2011, 04:02 PM   #2
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387
Hi,

eject && shutdown -h now

This ejects the cd and if that command is successful (the &&) it executes the shutdown command.

You could also do this: eject ; shutdown -h now, but it will execute the shutdown command even if the eject fails.


Sorry just realized that this is a live cd. It should eject by itself when shutting down properly.

Hope this helps.

Last edited by druuna; 02-12-2011 at 04:03 PM.
 
Old 02-12-2011, 05:58 PM   #3
DavidMcCann
Senior Member
 
Registered: Jul 2006
Location: London
Distribution: CentOS, Salix
Posts: 4,164

Rep: Reputation: 1223Reputation: 1223Reputation: 1223Reputation: 1223Reputation: 1223Reputation: 1223Reputation: 1223Reputation: 1223Reputation: 1223
Live CDs are usually intended to run in GUI mode. If you tell them to shutdown or reboot using the menu, they usually eject the disk. Unless the developers forgot that bit, of course!
 
  


Reply


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
CDRom Won't eject! SentralOrigin Linux - Hardware 8 03-31-2006 12:35 AM
how eject cdrom ?? arunvk Linux - Software 2 01-24-2006 08:51 AM
Can't eject cdrom seagreen Linux - Newbie 4 12-09-2004 03:34 PM
Eject Cdrom themuppeteer Linux - General 5 11-12-2001 09:25 AM
cdrom eject FNC Linux - General 2 05-31-2001 10:47 PM


All times are GMT -5. The time now is 03:09 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration