summaryrefslogtreecommitdiff
path: root/usr/src/man/man1/eject.1
blob: 142322011f03972c87bf5910ebfcd3eda255c537 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
'\" te
.\" Copyright (c) 2009, Sun Microsystems, Inc.
.\" 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.
.\"  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
.\" the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
.TH EJECT 1 "Sep 8, 2009"
.SH NAME
eject \- eject media such as CD-ROM and floppy from drive
.SH SYNOPSIS
.LP
.nf
\fBeject\fR [\fB-dflqt\fR] [ [\fIdevice\fR | \fInickname\fR]]
.fi

.SH DESCRIPTION
.sp
.LP
The \fBeject\fR utility is used for those removable media devices that do not
have a manual eject button, or for those that might be locked due to, for
instance, being mounted. The device may be specified by its name or by a
nickname. If no device is specified, the default device is used.
.sp
.LP
Only devices that support \fBeject\fR under program control respond to this
command.
.sp
.LP
When \fBeject\fR is used on media that can only be ejected manually, it does
everything except remove the media, including unmounting the file system if it
is mounted. In this case, \fBeject\fR displays a message that the media can now
be manually ejected.
.sp
.LP
Do not physically eject media from a device that contains mounted file systems.
\fBeject\fR automatically searches for any mounted file systems that reside on
the device, and attempts to umount them prior to ejecting the media. See
\fBmount\fR(1M). If the unmount operation fails, \fBeject\fR prints a warning
message and exits. The \fB-f\fR option can be used to specify an eject even if
the device contains mounted partitions.
.sp
.LP
If you have inserted a floppy diskette, you might need to use \fBvolcheck\fR(1)
before ejecting the media to inform the system the floppy's presence.
.sp
.LP
Pressing the physical media eject button located on some drives' front panel
has the same effect as invoking \fBeject\fR for the respective drive. Not all
drives have this capability.
.SH OPTIONS
.sp
.LP
The following options are supported:
.sp
.ne 2
.na
\fB\fB-d\fR\fR
.ad
.RS 6n
Display the name of the default device to be ejected.
.RE

.sp
.ne 2
.na
\fB\fB-f\fR\fR
.ad
.RS 6n
Force the device to eject even if it is busy.
.RE

.sp
.ne 2
.na
\fB\fB-l\fR\fR
.ad
.RS 6n
Display paths and nicknames of ejectable devices.
.RE

.sp
.ne 2
.na
\fB\fB-q\fR\fR
.ad
.RS 6n
Query to see if the media is present.
.RE

.sp
.ne 2
.na
\fB\fB-t\fR\fR
.ad
.RS 6n
Issues the drive a CD-ROM tray close command.
.sp
Not all devices support this command.
.RE

.SH OPERANDS
.sp
.LP
The following operands are supported:
.sp
.ne 2
.na
\fB\fIdevice\fR\fR
.ad
.RS 12n
Specifies which device to \fBeject\fR, by the name it appears in the directory
\fB/dev\fR.
.RE

.sp
.ne 2
.na
\fB\fInickname\fR\fR
.ad
.RS 12n
Specifies which device to \fBeject\fR, by its nickname as known to this
command.
.sp
Volume label or device type (for example, cdrom or floppy0) can be used as a
nickname.
.RE

.SH EXAMPLES
.LP
\fBExample 1 \fREjecting Media
.sp
.LP
The following example ejects media by its volume label:

.sp
.in +2
.nf
example> \fBeject \&'My Pictures\&'\fR
.fi
.in -2
.sp

.LP
\fBExample 2 \fREjecting a Floppy Disk
.sp
.LP
The following example ejects a floppy disk from the first floppy drive:

.sp
.in +2
.nf
example> \fBeject floppy0\fR
.fi
.in -2
.sp

.SH EXIT STATUS
.sp
.LP
The following exit codes are returned:
.sp
.ne 2
.na
\fB\fB0\fR\fR
.ad
.RS 5n
The operation was successful or, with the \fB-q\fR option, the media \fIis\fR
in the drive.
.RE

.sp
.ne 2
.na
\fB\fB1\fR\fR
.ad
.RS 5n
The operation was unsuccessful or, with the \fB-q\fR option, the media is
\fInot\fR in the drive.
.RE

.sp
.ne 2
.na
\fB\fB2\fR\fR
.ad
.RS 5n
Invalid options were specified.
.RE

.sp
.ne 2
.na
\fB\fB3\fR\fR
.ad
.RS 5n
An \fBioctl()\fR request failed.
.RE

.sp
.ne 2
.na
\fB\fB4\fR\fR
.ad
.RS 5n
Manually ejectable media is now okay to remove.
.RE

.SH FILES
.sp
.ne 2
.na
\fB\fB/dev/diskette0\fR\fR
.ad
.RS 18n
default diskette file
.RE

.sp
.ne 2
.na
\fB\fB/dev/sr0\fR\fR
.ad
.RS 18n
default \fBCD-ROM\fR file (deprecated)
.RE

.SH SEE ALSO
.sp
.LP
\fBvolcheck\fR(1), \fBmount\fR(1M), \fBrmmount\fR(1M), \fBioctl\fR(2),
\fBattributes\fR(5)