2 .\" Copyright (c) 2009, Sun Microsystems, Inc.
3 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License. You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.
4 .\" See the License for the specific language governing permissions and limitations under the License. When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with
5 .\" the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
6 .TH EJECT 1 "Sep 8, 2009"
8 eject \- eject media such as CD-ROM and floppy from drive
12 \fBeject\fR [\fB-dflqt\fR] [ [\fIdevice\fR | \fInickname\fR]]
18 The \fBeject\fR utility is used for those removable media devices that do not
19 have a manual eject button, or for those that might be locked due to, for
20 instance, being mounted. The device may be specified by its name or by a
21 nickname. If no device is specified, the default device is used.
24 Only devices that support \fBeject\fR under program control respond to this
28 When \fBeject\fR is used on media that can only be ejected manually, it does
29 everything except remove the media, including unmounting the file system if it
30 is mounted. In this case, \fBeject\fR displays a message that the media can now
34 Do not physically eject media from a device that contains mounted file systems.
35 \fBeject\fR automatically searches for any mounted file systems that reside on
36 the device, and attempts to umount them prior to ejecting the media. See
37 \fBmount\fR(8). If the unmount operation fails, \fBeject\fR prints a warning
38 message and exits. The \fB-f\fR option can be used to specify an eject even if
39 the device contains mounted partitions.
42 If you have inserted a floppy diskette, you might need to use \fBvolcheck\fR(1)
43 before ejecting the media to inform the system the floppy's presence.
46 Pressing the physical media eject button located on some drives' front panel
47 has the same effect as invoking \fBeject\fR for the respective drive. Not all
48 drives have this capability.
52 The following options are supported:
59 Display the name of the default device to be ejected.
68 Force the device to eject even if it is busy.
77 Display paths and nicknames of ejectable devices.
86 Query to see if the media is present.
95 Issues the drive a CD-ROM tray close command.
97 Not all devices support this command.
103 The following operands are supported:
110 Specifies which device to \fBeject\fR, by the name it appears in the directory
120 Specifies which device to \fBeject\fR, by its nickname as known to this
123 Volume label or device type (for example, cdrom or floppy0) can be used as a
129 \fBExample 1 \fREjecting Media
132 The following example ejects media by its volume label:
137 example> \fBeject \&'My Pictures\&'\fR
143 \fBExample 2 \fREjecting a Floppy Disk
146 The following example ejects a floppy disk from the first floppy drive:
151 example> \fBeject floppy0\fR
159 The following exit codes are returned:
166 The operation was successful or, with the \fB-q\fR option, the media \fIis\fR
176 The operation was unsuccessful or, with the \fB-q\fR option, the media is
177 \fInot\fR in the drive.
186 Invalid options were specified.
195 An \fBioctl()\fR request failed.
204 Manually ejectable media is now okay to remove.
211 \fB\fB/dev/diskette0\fR\fR
214 default diskette file
223 default \fBCD-ROM\fR file (deprecated)
229 \fBvolcheck\fR(1), \fBmount\fR(8), \fBrmmount\fR(8), \fBioctl\fR(2),