Terminal Tip: Eject Media Disc
Jun 17th, 2008 by Willy V.
Terminal Tip: Eject Media Disc - In this tutorial I will show you how to use Terminal to EJECT or force a media disc to eject from you slot loaded disc drive. From time to time you may have a disc that stay in it’s drive and does not eject once your done working or maybe you closed out your program & forgot to eject the disc. So then you like normal will hit/press the eject key & nothing happens the disc does not eject. Then your forced to have to restart your system so that the disc is ejected. Well no more of that, just open up Terminal. See example below.
Open up Terminal & type: drutil eject [Hit Return]
or
Open up Terminal & type: drutil tray open [Hit Return]
And that will do the trick for ya.












Hey, thank you for your tips. his one is the one i found quite useful. I just want share something with you related to that tip. My mom owns a MacMini and she doesn’t live in the same city. Maybe the only thing i have noticed she has problems with is disks that would not eject. So I was thinking how do I help her easily solve this kind of problem, with what I found out from you? Well I have written in the terminal the command as you said and then file/save as/ and in it i gave it a name (force disk eject) and i selcted
… so I just wanted to share this little trick. Here some photos of what i described in text so people can more easily understand.
“execute this command (specify complete path)”
written the command in the field below “drutil eject”
uncheck “execute command in shell” (so it closes the terminal window automatically after id ejects)
and check “hide extension” … click save. From this you get a executable terminal file … which if you double click does the same thing you showed in this tutorial. Now this is ok but not quite yet … so I right clicked on the file and went to get info and then did the same thing on a png file of the icon that represents the eject task, in the get info of that png file i cmd+c and then in the get info of the terminal file i clicked on the default look of the file and cmd+v. Now viewed in finder this file looks the same as the png file. I now drag and droped this file in finder window’s toolbar.
Voila … now you have a button for force ejecting disk, without the need to write or remember what to write in terminal. I personally like doing that and I am trying to learn a little bit of it …. but for people like my mom that is not an option
http://img.skitch.com/20080924-tfh7g1derby39yeggne7gbjnx1.preview.jpg
click here
http://img.skitch.com/20080924-fe6g61psskx36n2h71jjjgei3a.preview.jpg
and cmd +c
click here
http://img.skitch.com/20080924-kh6e1mp31fpuxay6pcui8411bc.preview.jpg
and cmd+v
and now this file drag and drop here.
http://img.skitch.com/20080924-cg143agrkfej9axuxjapbwwuxr.preview.jpg
And that file must stay in that folder in order to work.
Hope someone can find this useful.
oops I taught it will be visible for others to see
I don’t really think this will be useful to you. Well … thank you for your tips anyway.