SUNWcsu
eject is used for those removable media devices that do not have a manual eject button, or for those that do, but are managed by Volume Management. The device may be specified by its name or by a nickname; if Volume Management is running and no device is specified, the default device is used.
Only devices that support eject under program control respond to this command. eject responds differently, depending on whether or not Volume Management is running.
Volume Management has the concept of a default device, which eject uses if no pathname or nickname is specified. Use the -d parameter to check what default device will be used.
Nickname Path |
fd /dev/rdiskette |
fd0 /dev/rdiskette |
fd1 /dev/rdiskette1 |
diskette /dev/rdiskette |
diskette0 /dev/rdiskette0 |
diskette1 /dev/rdiskette1 |
rdiskette /dev/rdiskette |
rdiskette0 /dev/rdiskette0 |
rdiskette1 /dev/rdiskette1 |
floppy /dev/rdiskette |
floppy0 /dev/rdiskette0 |
floppy1 /dev/rdiskette1 |
Nickname Path |
cd /dev/rdsk/c0t6d0s2 |
cdrom /dev/rdsk/c0t6d0s2 |
cd0 /dev/rdsk/c0t6d0s2 |
sr /dev/rdsk/c0t6d0s2 |
sr0 /dev/rdsk/c0t6d0s2 |
/dev/sr0 /dev/rdsk/c0t6d0s2 |
/dev/rsr0 /dev/rdsk/c0t6d0s2 |
c0t6d0s2 /dev/rdsk/c0t6d0s2 |
The lists above can be reproduced using the -n option to eject.
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(1M) ). 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.
If you have inserted a floppy diskette, you must use volcheck(1) before ejecting the media to inform Volume Management of the floppy’s presence.
volcancel(1) , volcheck(1) , volmissing(1) , mount(1M) , rmmount(1M) , vold(1M) , rmmount.conf(4) , vold.conf(4) , volfs(7FS)
example> eject cdrom0
To eject a floppy disk (whether or not Volume Management is running):
example> eject floppy0
To eject a CD-ROM drive with pathname /dev/dsk/c0t3d0s2, without Volume Management running:
example> eject /dev/dsk/c0t3d0s2
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.
There should be a way to change the default on a per-user basis.
If Volume Management is not running, it is possible to eject a volume that is currently mounted (see mount(1M) ). For example, if you have a CD-ROM drive at /dev/dsk/c0t3d0s2 mounted on /mnt, the following command (withough Volume Management runnning) will work:
example> eject /dev/dsk/c0t3d0s0
since both slices s0 and s2 reference the whole CD-ROM drive.