up | Inhaltsverzeichniss | Kommentar

Manual page for 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 manual 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 command.

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 operation fails, eject prints a warning message and exits. The -f flag may be used to specify an eject even if the device contains mounted partitions.

eject can also display its default device and a list of nicknames.


Display the name of the default device to be ejected.
Force the device to eject even if it is busy.
Display the nickname to device name translation table.
Query to see if the media is present.
Specify which device to eject, by the name it appears in the directory /dev.
Specify which device to eject, by its nickname as known to this command.


raw files
block files


fd.4s sr.4s mount.8


eject returns the following exit codes:

If the operation was successful or, with the -q option, the media is in the drive.
If the operation was unsuccessful or, with the -q option, the media is not in the drive.
If invalid flags were specified.
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 support eject.

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.


There should be a way to change the default on a per-user basis.

index | Inhaltsverzeichniss | Kommentar

Created by unroff & hp-tools. © by Hans-Peter Bischof. All Rights Reserved (1997).

Last modified 21/April/97