version 2, including all changes.
.
Rev |
Author |
# |
Line |
1 |
perry |
1 |
EJECT |
|
|
2 |
!!!EJECT |
|
|
3 |
NAME |
|
|
4 |
SYNOPSIS |
|
|
5 |
DESCRIPTION |
|
|
6 |
COMMAND-LINE OPTIONS |
|
|
7 |
LONG OPTIONS |
|
|
8 |
EXAMPLES |
|
|
9 |
EXIT STATUS |
|
|
10 |
NOTES |
|
|
11 |
AUTHOR |
|
|
12 |
SEE ALSO |
|
|
13 |
---- |
|
|
14 |
!!NAME |
|
|
15 |
|
|
|
16 |
|
|
|
17 |
eject - eject removable media |
|
|
18 |
!!SYNOPSIS |
|
|
19 |
|
|
|
20 |
|
|
|
21 |
eject -h |
|
|
22 |
eject [[-vnrsfq] [[ |
|
|
23 |
eject [[-vn] -d |
|
|
24 |
eject [[-vn] -a on|off|1|0 [[ |
|
|
25 |
eject [[-vn] -c slot [[ |
|
|
26 |
eject [[-vn] -t [[ |
|
|
27 |
!!DESCRIPTION |
|
|
28 |
|
|
|
29 |
|
|
|
30 |
__Eject__ allows removable media (typically a CD-ROM, |
|
|
31 |
floppy disk, tape, or JAZ or ZIP disk) to be ejected under |
|
|
32 |
software control. The command can also control some |
|
|
33 |
multi-disc CD-ROM changers, the auto-eject feature supported |
|
|
34 |
by some devices, and close the disc tray of some CD-ROM |
|
|
35 |
drives. |
|
|
36 |
|
|
|
37 |
|
|
|
38 |
The device corresponding to |
|
|
39 |
|
|
|
40 |
|
|
|
41 |
There are four different methods of ejecting, depending on |
|
|
42 |
whether the device is a CD-ROM, SCSI device, removable |
|
|
43 |
floppy, or tape. By default eject tries all four methods in |
|
|
44 |
order until it succeeds. |
|
|
45 |
|
|
|
46 |
|
|
|
47 |
If the device is currently mounted, it is unmounted before |
|
|
48 |
ejecting. |
|
|
49 |
!!COMMAND-LINE OPTIONS |
|
|
50 |
|
|
|
51 |
|
|
|
52 |
__-h__ |
|
|
53 |
|
|
|
54 |
|
|
|
55 |
This option causes __eject__ to display a brief |
|
|
56 |
description of the command options. |
|
|
57 |
|
|
|
58 |
|
|
|
59 |
__-v__ |
|
|
60 |
|
|
|
61 |
|
|
|
62 |
This makes __eject__ run in verbose mode; more |
|
|
63 |
information is displayed about what the command is |
|
|
64 |
doing. |
|
|
65 |
|
|
|
66 |
|
|
|
67 |
__-d__ |
|
|
68 |
|
|
|
69 |
|
|
|
70 |
If invoked with this option, __eject__ lists the default |
|
|
71 |
device name. |
|
|
72 |
|
|
|
73 |
|
|
|
74 |
__-a on|1|off|0__ |
|
|
75 |
|
|
|
76 |
|
|
|
77 |
This option controls the auto-eject mode, supported by some |
|
|
78 |
devices. When enabled, the drive automatically ejects when |
|
|
79 |
the device is closed. |
|
|
80 |
|
|
|
81 |
|
|
|
82 |
__-c __ |
|
|
83 |
|
|
|
84 |
|
|
|
85 |
With this option a CD slot can be selected from an ATAPI/IDE |
|
|
86 |
CD-ROM changer. Linux 2.0 or higher is required to use this |
|
|
87 |
feature. The CD-ROM drive can not be in use (mounted data CD |
|
|
88 |
or playing a music CD) for a change request to work. Please |
|
|
89 |
also note that the first slot of the changer is referred to |
|
|
90 |
as 0, not 1. |
|
|
91 |
|
|
|
92 |
|
|
|
93 |
__-t__ |
|
|
94 |
|
|
|
95 |
|
|
|
96 |
With this option the drive is given a CD-ROM tray close |
|
|
97 |
command. Not all devices support this command. |
|
|
98 |
|
|
|
99 |
|
|
|
100 |
__-n__ |
|
|
101 |
|
|
|
102 |
|
|
|
103 |
With this option the selected device is displayed but no |
|
|
104 |
action is performed. |
|
|
105 |
|
|
|
106 |
|
|
|
107 |
__-r__ |
|
|
108 |
|
|
|
109 |
|
|
|
110 |
This option specifies that the drive should be ejected using |
|
|
111 |
a CDROM eject command. |
|
|
112 |
|
|
|
113 |
|
|
|
114 |
__-s__ |
|
|
115 |
|
|
|
116 |
|
|
|
117 |
This option specifies that the drive should be ejected using |
|
|
118 |
SCSI commands. |
|
|
119 |
|
|
|
120 |
|
|
|
121 |
__-f__ |
|
|
122 |
|
|
|
123 |
|
|
|
124 |
This option specifies that the drive should be ejected using |
|
|
125 |
a removable floppy disk eject command. |
|
|
126 |
|
|
|
127 |
|
|
|
128 |
__-q__ |
|
|
129 |
|
|
|
130 |
|
|
|
131 |
This option specifies that the drive should be ejected using |
|
|
132 |
a tape drive offline command. |
|
|
133 |
!!LONG OPTIONS |
|
|
134 |
|
|
|
135 |
|
|
|
136 |
All options have corresponding long names, as listed below. |
|
|
137 |
The long names can be abbreviated as long as they are |
|
|
138 |
unique. |
|
|
139 |
|
|
|
140 |
|
|
|
141 |
-h --help |
|
|
142 |
-v --verbose |
|
|
143 |
-d --default |
|
|
144 |
-a --auto |
|
|
145 |
-c --changerslot |
|
|
146 |
-t --trayclose |
|
|
147 |
-n --noop |
|
|
148 |
-r --cdrom |
|
|
149 |
-s --scsi |
|
|
150 |
-f --floppy |
|
|
151 |
-q --tape |
|
|
152 |
!!EXAMPLES |
|
|
153 |
|
|
|
154 |
|
|
|
155 |
Eject the default device: |
|
|
156 |
|
|
|
157 |
|
|
|
158 |
eject |
|
|
159 |
|
|
|
160 |
|
|
|
161 |
Eject a device or mount point named cdrom: |
|
|
162 |
|
|
|
163 |
|
|
|
164 |
eject cdrom |
|
|
165 |
|
|
|
166 |
|
|
|
167 |
Eject using device name: |
|
|
168 |
|
|
|
169 |
|
|
|
170 |
eject /dev/cdrom |
|
|
171 |
|
|
|
172 |
|
|
|
173 |
Eject using mount point: |
|
|
174 |
|
|
|
175 |
|
|
|
176 |
eject /mnt/cdrom/ |
|
|
177 |
|
|
|
178 |
|
|
|
179 |
Eject 4th IDE device: |
|
|
180 |
|
|
|
181 |
|
|
|
182 |
eject hdd |
|
|
183 |
|
|
|
184 |
|
|
|
185 |
Eject first SCSI device: |
|
|
186 |
|
|
|
187 |
|
|
|
188 |
eject sda |
|
|
189 |
|
|
|
190 |
|
|
|
191 |
Eject using SCSI partition name (e.g. a ZIP |
|
|
192 |
drive): |
|
|
193 |
|
|
|
194 |
|
|
|
195 |
eject sda4 |
|
|
196 |
|
|
|
197 |
|
|
|
198 |
Select 5th disc on mult-disc changer: |
|
|
199 |
|
|
|
200 |
|
|
|
201 |
eject -v -c5 /dev/cdrom |
|
|
202 |
|
|
|
203 |
|
2 |
perry |
204 |
Turn on auto-eject on a !SoundBlaster CD-ROM |
1 |
perry |
205 |
drive: |
|
|
206 |
|
|
|
207 |
|
|
|
208 |
eject -a on /dev/sbpcd |
|
|
209 |
!!EXIT STATUS |
|
|
210 |
|
|
|
211 |
|
|
|
212 |
Returns 0 if operation was successful, 1 if operation failed |
|
|
213 |
or command syntax was not valid. |
|
|
214 |
!!NOTES |
|
|
215 |
|
|
|
216 |
|
|
|
217 |
__Eject__ only works with devices that support one or |
|
|
218 |
more of the four methods of ejecting. This includes most |
|
|
219 |
CD-ROM drives (IDE, SCSI, and proprietary), some SCSI tape |
|
|
220 |
drives, JAZ drives, ZIP drives (parallel port, SCSI, and IDE |
|
|
221 |
versions), and LS120 removable floppies. Users have also |
|
|
222 |
reported success with floppy drives on Sun SPARC and Apple |
|
|
223 |
Macintosh systems. If __eject__ does not work, it is most |
|
|
224 |
likely a limitation of the kernel driver for the device and |
|
|
225 |
not the __eject__ program itself. |
|
|
226 |
|
|
|
227 |
|
|
|
228 |
The -r, -s, -f, and -q options allow controlling which |
|
|
229 |
methods are used to eject. More than one method can be |
|
|
230 |
specified. If none of these options are specified, it tries |
|
|
231 |
all four (this works fine in most cases). |
|
|
232 |
|
|
|
233 |
|
|
|
234 |
__Eject__ may not always be able to determine if the |
|
|
235 |
device is mounted (e.g. if it has several names). If the |
|
|
236 |
device name is a symbolic link, __eject__ will follow the |
|
|
237 |
link and use the device that it points to. |
|
|
238 |
|
|
|
239 |
|
|
|
240 |
If __eject__ determines that the device can have multiple |
|
|
241 |
partitions, it will attempt to unmount all mounted |
|
|
242 |
partitions of the device before ejecting. If an unmount |
|
|
243 |
fails, the program will not attempt to eject the |
|
|
244 |
media. |
|
|
245 |
|
|
|
246 |
|
|
|
247 |
You can eject an audio CD. Some CD-ROM drives will refuse to |
|
|
248 |
open the tray if the drive is empty. Some devices do not |
|
|
249 |
support the tray close command. |
|
|
250 |
|
|
|
251 |
|
|
|
252 |
If the auto-eject feature is enabled, then the drive will |
|
|
253 |
always be ejected after running this command. Not all Linux |
|
|
254 |
kernel CD-ROM drivers support the auto-eject mode. There is |
|
|
255 |
no way to find out the state of the auto-eject |
|
|
256 |
mode. |
|
|
257 |
|
|
|
258 |
|
|
|
259 |
You need appropriate privileges to access the device files. |
|
|
260 |
Running as root or setuid root is required to eject some |
|
|
261 |
devices (e.g. SCSI devices). |
|
|
262 |
|
|
|
263 |
|
|
|
264 |
The heuristic used to find a device, given a name, is as |
|
|
265 |
follows. If the name ends in a trailing slash, it is removed |
|
|
266 |
(this is to support filenames generated using shell file |
|
|
267 |
name completion). If the name starts with '.' or '/', it |
|
|
268 |
tries to open it as a device file or mount point. If that |
|
|
269 |
fails, it tries prepending '/dev/', '/mnt/', |
|
|
270 |
|
|
|
271 |
|
|
|
272 |
Creating symbolic links such as /dev/cdrom or /dev/zip is |
|
|
273 |
recommended so that __eject__ can determine the |
|
|
274 |
appropriate devices using easily remembered |
|
|
275 |
names. |
|
|
276 |
|
|
|
277 |
|
|
|
278 |
To save typing you can create a shell alias for the eject |
|
|
279 |
options that work for your particular setup. |
|
|
280 |
!!AUTHOR |
|
|
281 |
|
|
|
282 |
|
|
|
283 |
__Eject__ was written by Jeff Tranter (tranter@pobox.com) |
|
|
284 |
and is released under the conditions of the GNU General |
|
|
285 |
Public License. See the file COPYING and notes in the source |
|
|
286 |
code for details. |
|
|
287 |
!!SEE ALSO |
|
|
288 |
|
|
|
289 |
|
|
|
290 |
mount(2), umount(2), mount(8), umount(8) |
|
|
291 |
/usr/src/linux/Documentation/cdrom/ |
|
|
292 |
---- |