EJECT(1)
โจ EJECT โจ (like, the eject(1) girlies' manual)
okay bestie, so this is the eject page from the User Commands corner of the manual, and yes she's a whole vibe. sit down, grab a strawberry, let's go ๐๐
๐ NAME ๐
eject โ eject removable media. that's it, that's the girl. she pops the disc out. ๐
๐ธ SYNOPSIS ๐ธ
eject [options] device|mountpoint
๐ DESCRIPTION ๐
so eject lets removable media pop out under software control โ think CD-ROM, floppy disk, tape, JAZ, ZIP, or USB disk. no manual poking, no paperclip moment, we're classy here. ๐ง
and the way that it's ALSO got range: it can control some multi-disc CD-ROM changers, the auto-eject feature that some devices support, and it can even close the disc tray of some CD-ROM drives. main character behavior honestly ๐
so like, the device corresponding to device or mountpoint gets ejected. if you don't name anything, the default name is /dev/cdrom. periodt. and you can address the device in any of these ways:
- by device name (e.g.,
sda) - by device path (e.g.,
/dev/sda) - by
UUID=uuidtag - by
LABEL=labeltag
there are four different methods of ejecting, depending on whether the device is a CD-ROM, SCSI device, removable floppy, or tape. by default eject just tries all four in order until one of them slays. no cap.
if you specify a device partition, the whole-disk device is used. ikykyk ๐ฆ
and if the device (or a device partition) is currently mounted, it gets unmounted before ejecting. the eject is processed on an exclusive open block device file descriptor if --no-unmount or --force are not specified. yes queen, exclusive open, she doesn't share ๐ซถ
โญ OPTIONS โญ
-a,--auto on|offโ controls the auto-eject mode, supported by some devices. when it's enabled, the drive automatically ejects when the device is closed. set it and forget it bestie.-c,--changerslot slotโ with this one you can select a CD slot from an ATAPI/IDE CD-ROM changer. heads up tho: the CD-ROM drive cannot be in use (mounted data CD or playing a music CD) for a change request to work. and also โ the first slot of the changer is referred to as0, not1. not me getting confused by that ๐-d,--defaultโ list the default device name. just tells you, no drama.-F,--forceโ force eject. don't check device type, don't open device with exclusive lock. > careful bestie: the successful result may be a false positive on non hot-pluggable devices. she's lying to you sometimes ๐-f,--floppyโ specifies that the drive should be ejected using a removable floppy disk eject command.-i,--manualeject on|offโ controls the locking of the hardware eject button. when enabled, the drive will not eject when the button is pressed. super useful when you're carrying a laptop in a bag or case and you do NOT want it ejecting because someone bumped the button. protecting your peace fr fr โจ-M,--no-partitions-unmountโ tellsejectto not try to unmount other partitions on partitioned devices. if another partition is still mounted, the program will not attempt to eject the media. it will attempt to unmount only the device or mountpoint given on the command line. mind your business, basically ๐-m,--no-unmountโ tellsejectto not try to unmount at all. if this option is not specified thenejectopens the device with theO_EXCLflag to be sure the device is not used (since v2.35). so like, that's the default behavior, don't come for her.-n,--noopโ the selected device is displayed but no action is performed. she's just looking. window shopping. ๐-p,--procโ lets you use/proc/mountsinstead of/etc/mtab. it also passes the-noption toumount(8). sharing the love ๐ซถ-q,--tapeโ specifies that the drive should be ejected using a tape drive offline command.-r,--cdromโ specifies that the drive should be ejected using a CDROM eject command.-s,--scsiโ specifies that the drive should be ejected using SCSI commands.-T,--traytoggleโ the drive gets a CD-ROM tray close command if it's opened, and a CD-ROM tray eject command if it's closed. it's giving indecisive, it's giving toggle. not all devices support this command, because it uses the above CD-ROM tray close command.-t,--traycloseโ the drive is given a CD-ROM tray close command. not all devices support this command. sad but true ๐ญ-v,--verboseโ run in verbose mode; more information is displayed about what the command is doing. she's a talker. we love that for her ๐-X,--listspeedโ the CD-ROM drive gets probed to detect the available speeds. the output is a list of speeds which can be used as an argument of the-xoption. this only works with Linux 2.6.13 or higher โ on previous versions solely the maximum speed will be reported. also note that some drives may not correctly report the speed and therefore this option does not work with them. picky little drives ๐-x,--cdspeed speedโ the drive is given a CD-ROM select speed command. the speed argument is a number indicating the desired speed (e.g.,8for 8X speed), or0for maximum data rate. not all devices support this command and you can only specify speeds that the drive is capable of. every time the media is changed this option is cleared. this option can be used alone, or with the-tand-coptions. teamwork makes the dream work โจ-h,--helpโ display help text and exit. classic.-V,--versionโ display version and exit. also classic. ๐
๐ฆ EXIT STATUS ๐ฆ
- returns
0if the operation was successful ๐ - returns
1if the operation failed or the command syntax was not valid ๐ญ
๐ NOTES ๐
eject only works with devices that support one or more of the four methods of ejecting. that includes most CD-ROM drives (IDE, SCSI, and proprietary), some SCSI tape drives, JAZ drives, ZIP drives (parallel port, SCSI, and IDE versions), and LS120 removable floppies. users have also reported success with floppy drives on Sun SPARC and Apple Macintosh systems. if eject does not work, it is most likely a limitation of the kernel driver for the device and not the eject program itself. don't blame her, blame the kernel bestie ๐
the -r, -s, -f, and -q options allow controlling which methods are used to eject. more than one method can be specified. if none of these options are specified, it tries all four (this works fine in most cases). she's versatile like that ๐
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. she's a follower (affectionate) ๐ง
if eject determines that the device can have multiple partitions, it will attempt to unmount all mounted partitions of the device before ejecting (see also --no-partitions-unmount). if an unmount fails, the program will not attempt to eject the media. no half measures.
you can eject an audio CD ๐ต some CD-ROM drives will refuse to open the tray if the drive is empty. some devices do not support the tray close command. rude of them, honestly.
if the auto-eject feature is enabled, then the drive will always be ejected after running this command. not all Linux kernel CD-ROM drivers support the auto-eject mode. and there is no way to find out the state of the auto-eject mode. mystery girl energy ๐ฅ
you need appropriate privileges to access the device files. running as root is required to eject some devices (e.g., SCSI devices). so yeah, sudo or nothing ๐ซถ
๐ AUTHORS ๐
- Jeff Tranter
<tranter@pobox.com>โ original author - Karel Zak
<kzak@redhat.com>and Michal Luscon<mluscon@redhat.com>โ util-linux version
iconic collab, no notes ๐
๐ธ SEE ALSO ๐ธ
findmnt(8), lsblk(8), mount(8), umount(8)
the whole friend group, they all link up ๐ซถ
๐ REPORTING BUGS ๐
for bug reports, use the issue tracker at <https://github.com/util-linux/util-linux/issues>. tell them everything, they'll handle it ๐
โญ AVAILABILITY โญ
the eject command is part of the util-linux package, which can be downloaded from the Linux Kernel Archive at <https://www.kernel.org/pub/linux/utils/util-linux/>. go get her ๐
okay and for the cute sign-off bestie โ this whole thing is util-linux 2.42.4, dated 2026-09-21, and that's the eject(1) page, done and dusted ๐
โจ bye, love you, don't forget to unmount first ๐
๐ฆ where this page comes from
- arch rolling: util-linux 2.42.4-1 ยท BSD-2-Clause AND BSD-3-Clause AND BSD-4-Clause-UC AND GPL-2.0-only AND GPL-2.0-or-later AND GPL-3.0-or-later AND ISC AND LGPL-2.1-or-later AND LicenseRef-PublicDomain
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms