OSDN Git Service

Import translated manuals from JM CVS Repository.
[linuxjm/jm.git] / manual / eject / original / man1 / eject.1
1 .\" This file Copyright (C) 1994-2005 Jeff Tranter
2 .\" (tranter@pobox.com)
3 .\" It may be distributed under the GNU Public License, version 2, or
4 .\" any higher version. See section COPYING of the GNU Public license
5 .\" for conditions under which this file may be redistributed.
6 .TH EJECT 1 "12 May 2005" "Linux" "User Commands"
7 .SH NAME
8 eject \- eject removable media
9 .SH SYNOPSIS
10 eject \-h
11 .br
12 eject [\-vnrsfmqp] [<name>]
13 .br
14 eject [\-vn] \-d
15 .br
16 eject [\-vn] \-a on|off|1|0 [<name>]
17 .br
18 eject [\-vn] \-c slot [<name>]
19 .br
20 eject [\-vn] \-t [<name>]
21 .br
22 eject [\-vn] \-T [<name>]
23 .br
24 eject [\-vn] \-x <speed> [<name>]
25 .br
26 eject [\-vn] \-X [<name>]
27 .br
28 eject \-V
29
30 .SH DESCRIPTION
31
32 .B Eject
33 allows removable media (typically a CD-ROM, floppy disk, tape, or JAZ
34 or ZIP disk) to be ejected under software control. The command can
35 also control some multi-disc CD-ROM changers, the auto-eject feature
36 supported by some devices, and close the disc tray of some CD-ROM
37 drives.
38
39 The device corresponding to <name> is ejected. The name can be a
40 device file or mount point, either a full path or with the leading
41 "/dev", "/media" or "/mnt" omitted. If no name is specified, the default name
42 "cdrom" is used.
43
44 There are four different methods of ejecting, depending on whether the
45 device is a CD-ROM, SCSI device, removable floppy, or tape. By default
46 eject tries all four methods in order until it succeeds.
47
48 If the device is currently mounted, it is unmounted before ejecting.
49
50 .PP
51 .SH "COMMAND\-LINE OPTIONS"
52 .TP 0.5i
53 .B \-h
54 This option causes
55 .B eject
56 to display a brief description of the command options.
57
58 .TP 0.5i
59 .B \-v
60 This makes
61 .B eject
62 run in verbose mode; more information is displayed about what the
63 command is doing.
64
65 .TP 0.5i
66 .B \-d
67 If invoked with this option,
68 .B eject
69 lists the default device name.
70
71 .TP 0.5i
72 .B \-a on|1|off|0
73 This option controls the auto-eject mode, supported by some devices.
74 When enabled, the drive automatically ejects when the device is
75 closed.
76
77 .TP 0.5i
78 .B \-c <slot>
79 With this option a CD slot can be selected from an ATAPI/IDE CD-ROM
80 changer. Linux 2.0 or higher is required to use this feature. The
81 CD-ROM drive can not be in use (mounted data CD or playing a music CD)
82 for a change request to work. Please also note that the first slot of
83 the changer is referred to as 0, not 1.
84
85 .TP 0.5i
86 .B \-t
87 With this option the drive is given a CD-ROM tray close command. Not
88 all devices support this command.
89
90 .TP 0.5i
91 .B \-T
92 With this option the drive is given a CD-ROM tray close command if
93 it's opened, and a CD-ROM tray eject command if it's closed. Not all
94 devices support this command, because it uses the above CD-ROM tray
95 close command.
96
97 .TP 0.5i
98 .B \-x <speed>
99 With this option the drive is given a CD-ROM select speed command.
100 The speed argument is a number indicating the desired speed (e.g. 8
101 for 8X speed), or 0 for maximum data rate. Not all devices support
102 this command and you can only specify speeds that the drive is capable
103 of. Every time the media is changed this option is cleared. This
104 option can be used alone, or with the \-t and \-c options.
105
106 .TP 0.5i
107 .B \-X 
108 With this option the CD-ROM drive will be probed to detect the
109 available speeds. The output is a list of speeds which can be used as
110 an argument of the \-x option. This only works with Linux 2.6.13 or
111 higher, on previous versions solely the maximum speed will be
112 reported. Also note that some drive may not correctly report the speed
113 and therefore this option does not work with them.
114
115 .TP 0.5i
116 .B \-n
117 With this option the selected device is displayed but no action is
118 performed.
119
120 .TP 0.5i
121 .B \-r
122 This option specifies that the drive should be ejected using a
123 CDROM eject command.
124 .TP 0.5i
125
126 .B \-s
127 This option specifies that the drive should be ejected using
128 SCSI commands.
129
130 .TP 0.5i
131 .B \-f
132 This option specifies that the drive should be ejected using a
133 removable floppy disk eject command.
134
135 .TP 0.5i
136 .B \-q
137 This option specifies that the drive should be ejected using a
138 tape drive offline command.
139
140 .TP 0.5i
141 .B \-p
142 This option allow you to use /proc/mounts instead /etc/mtab. It
143 also passes the \-n option to umount(1).
144
145 .TP 0.5i
146 .B \-m
147 This option allows eject to work with device drivers which automatically
148 mount removable media and therefore must be always mount()ed.
149 The option tells eject to not try to unmount the given device,
150 even if it is mounted according to /etc/mtab or /proc/mounts.
151
152 .TP 0.5i
153 .B \-V
154 This option causes
155 .B eject
156 to display the program version and exit.
157
158 .SH LONG OPTIONS
159 All options have corresponding long names, as listed below. The long
160 names can be abbreviated as long as they are unique.
161
162 .br
163 \-h \-\-help
164 .br
165 \-v \-\-verbose
166 .br
167 \-d \-\-default
168 .br
169 \-a \-\-auto
170 .br
171 \-c \-\-changerslot
172 .br
173 \-t \-\-trayclose
174 .br
175 \-T \-\-traytoggle
176 .br
177 \-x \-\-cdspeed
178 .br
179 \-X \-\-listspeed
180 .br
181 \-n \-\-noop
182 .br
183 \-r \-\-cdrom
184 .br
185 \-s \-\-scsi
186 .br
187 \-f \-\-floppy
188 .br
189 \-q \-\-tape
190 .br
191 \-V \-\-version
192 .br
193 \-p \-\-proc
194 .br
195 \-m \-\-no-unmount
196 .br
197
198 .SH EXAMPLES
199 .PP
200 Eject the default device:
201 .IP
202 eject
203 .PP
204 Eject a device or mount point named cdrom:
205 .IP
206 eject cdrom
207 .PP
208 Eject using device name:
209 .IP
210 eject /dev/cdrom
211 .PP
212 Eject using mount point:
213 .IP
214 eject /mnt/cdrom/
215 .PP
216 Eject 4th IDE device:
217 .IP
218 eject hdd
219 .PP
220 Eject first SCSI device:
221 .IP
222 eject sda
223 .PP
224 Eject using SCSI partition name (e.g. a ZIP drive):
225 .IP
226 eject sda4
227 .PP
228 Select 5th disc on multi-disc changer:
229 .IP
230 eject \-v \-c4 /dev/cdrom
231 .PP
232 Turn on auto-eject on a SoundBlaster CD-ROM drive:
233 .IP
234 eject \-a on /dev/sbpcd
235
236 .SH EXIT STATUS
237 .PP
238
239 Returns 0 if operation was successful, 1 if operation failed or command
240 syntax was not valid.
241
242 .SH NOTES
243 .PP
244
245 .B Eject
246 only works with devices that support one or more of the four methods
247 of ejecting. This includes most CD-ROM drives (IDE, SCSI, and
248 proprietary), some SCSI tape drives, JAZ drives, ZIP drives (parallel
249 port, SCSI, and IDE versions), and LS120 removable floppies. Users
250 have also reported success with floppy drives on Sun SPARC and Apple
251 Macintosh systems. If
252 .B eject
253 does not work, it is most likely a limitation of the kernel driver
254 for the device and not the
255 .B eject
256 program itself.
257
258 The \-r, \-s, \-f, and \-q options allow controlling which methods are
259 used to eject. More than one method can be specified. If none of these
260 options are specified, it tries all four (this works fine in most
261 cases).
262
263 .B Eject
264 may not always be able to determine if the device is mounted (e.g. if
265 it has several names). If the device name is a symbolic link,
266 .B eject
267 will follow the link and use the device that it points to.
268
269 If
270 .B eject
271 determines that the device can have multiple partitions, it will
272 attempt to unmount all mounted partitions of the device before
273 ejecting. If an unmount fails, the program will not attempt to eject
274 the media.
275
276 You can eject an audio CD. Some CD-ROM drives will refuse to open the
277 tray if the drive is empty. Some devices do not support the tray close
278 command.
279
280 If the auto-eject feature is enabled, then the drive will always be
281 ejected after running this command. Not all Linux kernel CD-ROM
282 drivers support the auto-eject mode. There is no way to find out the
283 state of the auto-eject mode.
284
285 You need appropriate privileges to access the device files. Running as
286 root or setuid root is required to eject some devices (e.g. SCSI
287 devices).
288
289 The heuristic used to find a device, given a name, is as follows. If
290 the name ends in a trailing slash, it is removed (this is to support
291 filenames generated using shell file name completion). If the name
292 starts with '.' or '/', it tries to open it as a device file or mount
293 point. If that fails, it tries prepending '/dev/', '/media/' ,'/mnt/',
294 \&'/dev/cdroms', '/dev/rdsk/', '/dev/dsk/', and finally './' to the name,
295 until a
296 device file or mount point is found that can be opened. The program
297 checks /etc/mtab for mounted devices. If that fails, it also checks
298 /etc/fstab for mount points of currently unmounted devices.
299
300 Creating symbolic links such as /dev/cdrom or /dev/zip is recommended
301 so that
302 .B eject
303 can determine the appropriate devices using easily remembered names.
304
305 To save typing you can create a shell alias for the eject options that
306 work for your particular setup.
307
308 .SH AUTHOR
309 .B Eject
310 was written by Jeff Tranter (tranter@pobox.com) and is released
311 under the conditions of the GNU General Public License. See the file
312 COPYING and notes in the source code for details.
313
314 The \-x option was added by Nobuyuki Tsuchimura (tutimura@nn.iij4u.or.jp),
315 with thanks to Roland Krivanek (krivanek@fmph.uniba.sk) and his
316 cdrom_speed command.
317
318 The \-T option was added by Sybren Stuvel (sybren@thirdtower.com), with
319 big thanks to Benjamin Schwenk (benjaminschwenk@yahoo.de).
320
321 The \-X option was added by Eric Piel (Eric.Piel@tremplin-utc.net).
322
323 .SH SEE ALSO
324
325 mount(2), umount(2), mount(8), umount(8)
326 .br
327 /usr/src/linux/Documentation/cdrom/