1eject(1)                         User Commands                        eject(1)
2
3
4

NAME

6       eject - eject media such as CD-ROM and floppy from drive
7

SYNOPSIS

9       eject [-dflqt] [ [device | nickname]]
10
11

DESCRIPTION

13       The eject utility is used for those removable media devices that do not
14       have a manual eject button, or for those that might be locked  due  to,
15       for instance, being mounted. The device may be specified by its name or
16       by a nickname. If no device is specified, the default device is used.
17
18
19       Only devices that support eject under program control respond  to  this
20       command.
21
22
23       When  eject is used on media that can only be ejected manually, it does
24       everything except remove the media, including unmounting the file  sys‐
25       tem  if  it is mounted. In this case, eject displays a message that the
26       media can now be manually ejected.
27
28
29       Do not physically eject media from a device that contains mounted  file
30       systems. eject automatically searches for any mounted file systems that
31       reside on the device, and attempts to umount them prior to ejecting the
32       media.  See  mount(1M).  If the unmount operation fails, eject prints a
33       warning message and exits. The -f option can  be  used  to  specify  an
34       eject even if the device contains mounted partitions.
35
36
37       If  you  have  inserted  a  floppy  diskette,  you  might  need  to use
38       volcheck(1) before ejecting the media to inform the system the floppy's
39       presence.
40
41
42       Pressing  the physical media eject button located on some drives' front
43       panel has the same effect as invoking eject for the  respective  drive.
44       Not all drives have this capability.
45

OPTIONS

47       The following options are supported:
48
49       -d    Display the name of the default device to be ejected.
50
51
52       -f    Force the device to eject even if it is busy.
53
54
55       -l    Display paths and nicknames of ejectable devices.
56
57
58       -q    Query to see if the media is present.
59
60
61       -t    Issues the drive a CD-ROM tray close command.
62
63             Not all devices support this command.
64
65

OPERANDS

67       The following operands are supported:
68
69       device      Specifies  which device to eject, by the name it appears in
70                   the directory /dev.
71
72
73       nickname    Specifies which device to eject, by its nickname  as  known
74                   to this command.
75
76                   Volume label or device type (for example, cdrom or floppy0)
77                   can be used as a nickname.
78
79

EXAMPLES

81       Example 1 Ejecting Media
82
83
84       The following example ejects media by its volume label:
85
86
87         example> eject 'My Pictures'
88
89
90
91       Example 2 Ejecting a Floppy Disk
92
93
94       The following example ejects a floppy disk from the first floppy drive:
95
96
97         example> eject floppy0
98
99
100

EXIT STATUS

102       The following exit codes are returned:
103
104       0    The operation was successful or, with the -q option, the media  is
105            in the drive.
106
107
108       1    The  operation  was unsuccessful or, with the -q option, the media
109            is not in the drive.
110
111
112       2    Invalid options were specified.
113
114
115       3    An ioctl() request failed.
116
117
118       4    Manually ejectable media is now okay to remove.
119
120

FILES

122       /dev/diskette0    default diskette file
123
124
125       /dev/sr0          default CD-ROM file (deprecated)
126
127

ATTRIBUTES

129       See attributes(5) for descriptions of the following attributes:
130
131
132
133
134       ┌─────────────────────────────┬─────────────────────────────┐
135       │      ATTRIBUTE TYPE         │      ATTRIBUTE VALUE        │
136       ├─────────────────────────────┼─────────────────────────────┤
137       │Availability                 │SUNWcsu                      │
138       └─────────────────────────────┴─────────────────────────────┘
139

SEE ALSO

141       volcheck(1), mount(1M), rmmount(1M), ioctl(2), attributes(5)
142
143
144
145SunOS 5.11                        8 Sep 2009                          eject(1)
Impressum