EJECT(1) General Commands Manual EJECT(1)
eject - eject media device from drive
eject [ -dfnq ] [ device | nickname ]
This command is not available on Sun 386i systems.
eject is used for those removable media devices that do not have a man-
ual eject button. The device may be specified by its name or by a
nickname; if no device is specified the default device is used.
Only devices that support eject under program control respond to this
It is not recommended to physically eject media from a device which
contains mounted filesystems. eject automatically searches for any
mounted filesystems which reside on the device and attempts to umount
them prior to ejecting the media (see mount(8)). If the unmount opera-
tion fails, eject prints a warning message and exits. The -f flag may
be used to specify an eject even if the device contains mounted parti-
eject can also display its default device and a list of nicknames.
-d Display the name of the default device to be ejected.
-f Force the device to eject even if it is busy.
-n Display the nickname to device name translation table.
-q Query to see if the media is present.
device Specify which device to eject, by the name as it appears in
the directory /dev.
nickname Specify which device to eject, by its nickname as known to
/dev/rsr0 raw files
/dev/sr0 block files
fd(4S), sr(4S), mount(8)
eject returns the following exit codes:
0 If the operation was successful or, with the -q option,
if the media is in the drive.
1 If the operation was unsuccessful or, with the -q option,
if the media is not in the drive.
2 If invalid flags were specified.
3 If an ioctl() request failed.
A short help message is printed if an unknown flag is specified. A
diagnostic is printed if the device name cannot be opened or does not
Device Busy: An attempt was made to eject a device that has a mounted
filesystem. A warning message is printed when doing a forced eject of
a mounted device. However, if a device is doing a format, "eject -f"
will not have any effect.
There should be a way to change the default on a per-user basis.
29 May 1992 EJECT(1)