]> git.ipfire.org Git - thirdparty/util-linux.git/blame - sys-utils/eject.1
docs: format, grammarize, and standardize the wall man page
[thirdparty/util-linux.git] / sys-utils / eject.1
CommitLineData
312111c2
KZ
1.\" Copyright (C) 1994-2005 Jeff Tranter (tranter@pobox.com)
2.\" Copyright (C) 2012 Karel Zak <kzak@redhat.com>
3.\"
539feec1
ML
4.\" It may be distributed under the GNU Public License, version 2, or
5.\" any higher version. See section COPYING of the GNU Public license
6.\" for conditions under which this file may be redistributed.
312111c2 7.TH EJECT 1 "April 2012" "Linux" "User Commands"
539feec1
ML
8.SH NAME
9eject \- eject removable media
10.SH SYNOPSIS
312111c2
KZ
11.B eject
12.RB [ options ]
13.IR device | mountpoint
539feec1 14.SH DESCRIPTION
539feec1 15.B Eject
312111c2 16allows removable media (typically a CD-ROM, floppy disk, tape, JAZ, ZIP or USB
0b66315a 17disk) to be ejected under software control. The command can also control some
312111c2
KZ
18multi-disc CD-ROM changers, the auto-eject feature supported by some devices,
19and close the disc tray of some CD-ROM drives.
0b66315a
SK
20.PP
21The device corresponding to \fIdevice\fP or \fImountpoint\fP is ejected. If no
28094b1e
KZ
22name is specified, the default name /dev/cdrom is used. The device may be
23addressed by device name (e.g. 'sda'), device path (e.g. '/dev/sda'),
24UUID=<uuid> or LABEL=<label> tags.
0b66315a 25.PP
312111c2 26There are four different methods of ejecting, depending on whether the device
0b66315a
SK
27is a CD-ROM, SCSI device, removable floppy, or tape. By default eject tries
28all four methods in order until it succeeds.
29.PP
312111c2
KZ
30If device partition is specified, the whole-disk device is used. If the device
31or a device partition is currently mounted, it is unmounted before ejecting.
312111c2
KZ
32.SH OPTIONS
33.IP "\fB\-a, \-\-auto \fIon|off\fP"
0b66315a 34This option controls the auto-eject mode, supported by some devices. When
312111c2
KZ
35enabled, the drive automatically ejects when the device is closed.
36.IP "\fB\-c, \-\-changerslot \fIslot\fP"
37With this option a CD slot can be selected from an ATAPI/IDE CD-ROM changer.
38Linux 2.0 or higher is required to use this feature. The CD-ROM drive can not
39be in use (mounted data CD or playing a music CD) for a change request to work.
40Please also note that the first slot of the changer is referred to as 0, not 1.
41.IP "\fB\-d, \-\-default\fP"
42List the default device name.
43.IP "\fB\-f, \-\-floppy\fP"
44This option specifies that the drive should be ejected using a removable floppy
45disk eject command.
46.IP "\fB\-F, \-\-force\fP"
8bb4a6cb 47Force eject, don't check device type.
312111c2
KZ
48.IP "\fB\-h, \-\-help\fP"
49Print a help text and exit.
50.IP "\fB\-i, \-\-manualeject \fIon|off\fP"
0b66315a 51This option controls locking of the hardware eject button. When enabled, the
312111c2
KZ
52drive will not be ejected when the button is pressed. This is useful when you
53are carrying a laptop in a bag or case and don't want it to eject if the button
54is inadvertently pressed.
55.IP "\fB\-p, \-\-proc\fP"
56This option allow you to use /proc/mounts instead /etc/mtab. It also passes the
8323d9fd 57\-n option to \fBumount\fR(1).
312111c2
KZ
58.IP "\fB\-q, \-\-tape\fP"
59This option specifies that the drive should be ejected using a tape drive
60offline command.
61.IP "\fB\-m, \-\-no-unmount\fP"
566cd92c
KZ
62The option tells eject to not try to unmount at all.
63.IP "\fB\-M, \-\-no-partitions-unmount\fP"
64The option tells eject to not try to unmount another partitions on partitioned
65devices. If another partition is mounted the program will not attempt to eject
66the media. It will attempt to unmount only mountpoint or mounted device given
67on eject command line.
312111c2
KZ
68.IP "\fB\-n, \-\-noop\fP"
69With this option the selected device is displayed but no action is performed.
70.IP "\fB\-t, \-\-trayclose\fP"
0b66315a 71With this option the drive is given a CD-ROM tray close command. Not all
312111c2
KZ
72devices support this command.
73.IP "\fB\-T, \-\-traytoggle\fP"
74With this option the drive is given a CD-ROM tray close command if it's opened,
0b66315a 75and a CD-ROM tray eject command if it's closed. Not all devices support this
312111c2
KZ
76command, because it uses the above CD-ROM tray close command.
77.IP "\fB\-r, \-\-cdrom\fP"
78This option specifies that the drive should be ejected using a CDROM eject
79command.
80.IP "\fB\-s, \-\-scsi\fP"
81This option specifies that the drive should be ejected using SCSI commands.
312111c2
KZ
82.IP "\fB\-v, \-\-verbose\fP"
83Run in verbose mode; more information is displayed about what the command is
84doing.
85.IP "\fB\-V, \-\-version\fP"
86Display program version and exit.
87.IP "\fB\-x, \-\-cdspeed \fI<speed>\fP"
88With this option the drive is given a CD-ROM select speed command. The speed
89argument is a number indicating the desired speed (e.g. 8 for 8X speed), or 0
0b66315a
SK
90for maximum data rate. Not all devices support this command and you can only
91specify speeds that the drive is capable of. Every time the media is changed
92this option is cleared. This option can be used alone, or with the \-t and \-c
312111c2
KZ
93options.
94.IP "\fB\-X, \-\-listspeed\fP"
95With this option the CD-ROM drive will be probed to detect the available
0b66315a
SK
96speeds. The output is a list of speeds which can be used as an argument of the
97\-x option. This only works with Linux 2.6.13 or higher, on previous versions
98solely the maximum speed will be reported. Also note that some drive may not
312111c2 99correctly report the speed and therefore this option does not work with them.
539feec1 100.SH EXIT STATUS
312111c2
KZ
101Returns 0 if operation was successful, 1 if operation failed or command syntax
102was not valid.
539feec1 103.SH NOTES
539feec1 104.B Eject
312111c2 105only works with devices that support one or more of the four methods of
0b66315a 106ejecting. This includes most CD-ROM drives (IDE, SCSI, and proprietary), some
312111c2 107SCSI tape drives, JAZ drives, ZIP drives (parallel port, SCSI, and IDE
0b66315a
SK
108versions), and LS120 removable floppies. Users have also reported success with
109floppy drives on Sun SPARC and Apple Macintosh systems. If
539feec1 110.B eject
312111c2
KZ
111does not work, it is most likely a limitation of the kernel driver for the
112device and not the
539feec1
ML
113.B eject
114program itself.
0b66315a 115.PP
312111c2 116The \-r, \-s, \-f, and \-q options allow controlling which methods are used to
0b66315a 117eject. More than one method can be specified. If none of these options are
312111c2 118specified, it tries all four (this works fine in most cases).
0b66315a 119.PP
539feec1 120.B Eject
312111c2 121may not always be able to determine if the device is mounted (e.g. if it has
0b66315a 122several names). If the device name is a symbolic link,
539feec1
ML
123.B eject
124will follow the link and use the device that it points to.
0b66315a 125.PP
539feec1
ML
126If
127.B eject
312111c2 128determines that the device can have multiple partitions, it will attempt to
566cd92c
KZ
129unmount all mounted partitions of the device before ejecting (see
130--no-partitions-unmount). If an unmount fails, the program will not attempt to
131eject the media.
0b66315a
SK
132.PP
133You can eject an audio CD. Some CD-ROM drives will refuse to open the tray if
134the drive is empty. Some devices do not support the tray close command.
135.PP
312111c2 136If the auto-eject feature is enabled, then the drive will always be ejected
0b66315a
SK
137after running this command. Not all Linux kernel CD-ROM drivers support the
138auto-eject mode. There is no way to find out the state of the auto-eject mode.
139.PP
140You need appropriate privileges to access the device files. Running as root is
312111c2 141required to eject some devices (e.g. SCSI devices).
312111c2 142.SH AUTHORS
0b66315a
SK
143.MT tranter@\:pobox.com
144Jeff Tranter
145.ME
146- original author.
147.br
148.MT kzak@\:redhat.com
149Karel Zak
150.ME
151and
152.MT mluscon@\:redhat.com
153Michal Luscon
154.ME
155- util-linux version.
539feec1 156.SH SEE ALSO
312111c2
KZ
157.BR lsblk (8),
158.BR findmnt (8),
159.BR mount (8),
160.BR umount (8)
161.SH AVAILABILITY
0b66315a
SK
162The eject command is part of the util-linux package and is available from
163.UR ftp://\:ftp.kernel.org\:/pub\:/linux\:/utils\:/util-linux/
164Linux Kernel Archive
165.UE .