EJECT(1)

NAME
eject - eject removable media

SYNOPSIS
eject -h
eject [-f][-u][-v]
eject [-f][-u][-v] <nickname>
eject [-f][-u][-v] <device-name>
eject -d
eject -n
eject -a on|1|off|0 [-v]
eject -c <slot> [-v]

DESCRIPTION
Eject allows removable media (typically a CD-ROM, floppy disk, or Iomega Jaz or Zip disk) to be ejected under software control. The command can also control some multi-disc CD-ROM changers and the auto-eject feature supported by some devices. If no device is specified, a default device is used. The environment variable CDROM can be used to set the default device, otherwise the compiled in default is used. Other devices can be specified either using the full device name (e.g. /dev/cdrom) or a nickname.

COMMAND-LINE OPTIONS

-h  This option causes eject to display a brief description of the command options.

-f  Normally eject will not eject a device if it has determined that the device is being used for a mounted file system. This option overrides that behaviour, and attempts to force an eject even for a mounted device.

-u  This option instructs eject to first try to unmount the device before ejecting it.

-v  This makes eject run in verbose mode; more information is displayed about what the command is doing.

-d  If invoked with this option, eject lists the default device.

-n  If this option is used, eject will list the supported nicknames and corresponding devices.

-a on|1|off|0
    This option controls the auto-eject mode, supported by some devices.

-c <slot>
    With this option a CD slot can be selected from an ATAPI/IDE CD-ROM changer. Linux 2.0 or higher is required to use this feature. The CD-ROM drive can not be in use (mounted data CD or playing a music CD) for a change request to work. Please also note that the first slot of the changer is referred to as 0, not 1.

BUGS/LIMITATIONS

Eject only works with devices that support the CDROMEJECT or FDEJECT ioctl. It also works with the Jaz and Zip drive using normal SCSI commands. Most CD-ROM drives under Linux should work. The only ejectable floppy devices that it has been tested with are Sun workstation drives running Linux on the SPARC platform. Eject may not always be able to determine if the device is mounted (e.g. if it has several names). If the device name is a symbolic link, eject will follow the link and use the device that it points to. It will also properly check if any partitions of the device you are trying to eject are mounted (which could be the case on the Jaz, Zip, or even a CD-ROM, really). If the auto-eject feature is enabled, then the drive will always be ejected after running this command, even if it is mounted and the -f option is used. Not all Linux kernel CD-ROM drivers support the auto-eject mode. The nicknames are set when eject is compiled. There is no way to find out the state of the auto-eject mode. You probably shouldn't be able to eject a mounted disc, but most kernel drivers allow it. The -u option will only succeed in unmounting if the user has privileges to run umount(8), or eject is installed setuid root, and it is not busy.

AUTHOR
Eject was written by Jeff Tranter (jeff_tranter@pobox.com) and is released under the conditions of the GNU General Public License. See the file COPYING and notes in the source code for details.

For suggestions and patches, special thanks go out to:
    Ben Galliart (bgallia@luc.edu)
    Dick Streefland
    Donnie Barnes (djb@redhat.com)
    Doug L. Hoffman (hoffman@cs.unc.edu)
    Grant Guenther (grant@torque.net)
    Mark Lord (mlord@pobox.com)
    Markus Pilzecker (markus.pilzecker@rhein-neckar.netsurf.de)

SEE ALSO
mount(2), umount(2), mount(8), umount(8)
/usr/src/linux/Documentation/cdrom/