LinuxQuestions.org
Review your favorite Linux distribution.
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, 02: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, 03:02 PM   #2
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
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 03:03 PM.
 
Old 02-12-2011, 04:58 PM   #3
DavidMcCann
LQ Veteran
 
Registered: Jul 2006
Location: London
Distribution: PCLinuxOS, Debian
Posts: 6,131

Rep: Reputation: 2302Reputation: 2302Reputation: 2302Reputation: 2302Reputation: 2302Reputation: 2302Reputation: 2302Reputation: 2302Reputation: 2302Reputation: 2302Reputation: 2302
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-30-2006 11:35 PM
how eject cdrom ?? arunvk Linux - Software 2 01-24-2006 07:51 AM
Can't eject cdrom seagreen Linux - Newbie 4 12-09-2004 02:34 PM
Eject Cdrom themuppeteer Linux - General 5 11-12-2001 08:25 AM
cdrom eject FNC Linux - General 2 05-31-2001 09:47 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 09:56 AM.

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
Open Source Consulting | Domain Registration