Advertisement

A stuck CD or DVD has a strange talent for making a perfectly calm Mac user question every life decision that led to owning optical media. You click Eject in Finder. Nothing happens. You press the keyboard’s Eject key, assuming your keyboard has one. The drive makes an optimistic little mechanical noise and then apparently changes its mind.

Before reaching for a screwdriver, a paper clip, or language unsuitable for a family-friendly troubleshooting guide, try Terminal. macOS includes command-line tools that can communicate with optical drives and mounted disks more directly than the usual graphical controls. In many cases, one short command is enough to use Terminal to eject a stuck CD/DVD safely.

This guide explains the most useful Terminal commands, how to identify the correct optical drive, what to do when macOS says the disc is busy, and when a stuck disc has probably crossed the line from a software problem into a hardware problem.

Why Won’t the CD or DVD Eject?

A disc that refuses to leave an optical drive is not necessarily physically jammed. Sometimes macOS is deliberately preventing the eject operation because the media is still being used.

For example, DVD Player may still have a movie open. Music or another audio application could be accessing a CD. Finder might be copying files from the disc. A Terminal window may even have its current working directory located somewhere on the mounted media.

Another user account can also have a document or application associated with the disc. In those situations, macOS may fail to unmount the media and therefore cannot complete the physical eject sequence.

External optical drives introduce additional possibilities. A USB hub, display with built-in USB ports, questionable adapter, or weak connection can interfere with communication between the Mac and the drive. Then there is the least entertaining explanation: the tray, loading motor, belt, sensor, or disc itself may have a physical problem.

The important lesson is simple: “stuck” does not always mean “mechanically trapped.” Terminal is useful because it helps separate software resistance from hardware failure.

The Fastest Terminal Command to Eject a CD or DVD

Open Terminal from the Applications > Utilities folder, or use Spotlight to search for Terminal. At the command prompt, enter:

Press Return.

For many Mac optical-drive problems, this is the command to try first. The drutil utility is designed to interact with CD and DVD recording devices. Its available operations include getting drive information, checking media, working with trays, and ejecting discs.

When the drive accepts the command and the media can be unmounted, the disc should eject. On a tray-loading drive, the tray may slide open. With compatible slot-loading hardware, the drive begins its normal motorized ejection process.

Yes, the dramatic troubleshooting guide sometimes ends after two words. Computers enjoy keeping us humble.

Try the Tray Eject Command

If the basic command does not produce the expected result, another optical-drive-specific command is:

The tray command performs a media or tray-related action on compatible hardware. Drive capabilities vary, so not every optical drive supports the same motorized tray behavior.

Do not assume that repeated commands will eventually intimidate a physically damaged drive into cooperation. Running drutil eject 37 times is troubleshooting only for approximately the first three attempts. After that, it becomes a very boring video game.

Check Whether macOS Can See the Optical Drive

If drutil eject fails, check whether the operating system recognizes an attached optical device.

Enter:

This command lists attached optical devices recognized by drutil. You can also request general drive information with:

For information about inserted media, try:

or:

The exact output depends on the drive and whether usable media is present. Still, these commands answer an important diagnostic question: Is macOS communicating with the optical hardware at all?

If an external drive is missing from the device list, focus on its USB connection before experimenting with more forceful disk commands. Disconnect the drive, inspect the cable and adapter, and reconnect it. For an Apple USB SuperDrive that is unresponsive through a display or USB hub, connecting the drive directly to a compatible port or supported adapter arrangement is an important troubleshooting step.

Use diskutil to Identify and Eject the Disc

The second major command-line tool worth knowing is diskutil. This utility manages local disks, volumes, and removable media recognized by macOS.

Start by listing disks:

Terminal displays detected disks and their identifiers. You may see entries such as:

The actual numbers vary from one Mac to another and can change as devices or disk images are connected. Never blindly copy a disk number from an online example. Your disk2 is not necessarily someone else’s disk2.

Carefully identify the optical media. Once you are certain of the correct whole-disk identifier, an eject command can look like this:

Replace /dev/disk2 with the identifier shown on your own Mac.

The diskutil eject operation makes the media unavailable as a file-system data store and, for automatically removable media, can begin the physical eject sequence. This is why diskutil is useful when Finder’s Eject button seems to be taking an unscheduled vacation.

Why You Must Identify the Correct Disk

Command-line disk management deserves respect. The simple eject verb is not the same as an erase operation, but diskutil also contains powerful commands for partitioning, repairing, and erasing storage devices.

Read the output of diskutil list before entering a command. Do not casually experiment with verbs such as eraseDisk, eraseVolume, or other destructive options. You are trying to retrieve a DVD, not unexpectedly reinvent your backup strategy.

When uncertain, inspect a disk with:

Again, substitute the appropriate identifier. Information such as the device location, media name, mount information, and disk characteristics can help confirm that you have selected the intended media.

What Does “Couldn’t Eject Disk” Mean?

An ejection failure often means the disc could not be unmounted. In practical terms, something may still be accessing a file or directory on the CD or DVD.

Start with the obvious suspects. Quit DVD Player, Music, VLC, Finder operations, disc-burning utilities, backup software, or any application that recently opened content from the media.

Also check Terminal itself. Suppose you previously entered a directory on the DVD:

Your shell is now working from a location on that disc. Move elsewhere before trying to eject:

Then run:

This tiny detail is easy to overlook. The same Terminal window being used to rescue the disc may be one of the processes keeping it busy. That is a level of irony normally reserved for sitcoms.

Find a Process That Is Using the Disc

The lsof command can help investigate open files. Its name effectively refers to listing open files, and it is particularly useful when you suspect a process is holding media open.

First, determine the disc’s mount location. Mounted removable media commonly appears beneath /Volumes. You can inspect that directory with:

If the disc is named Archive DVD, you can investigate files below its mount directory with a command such as:

The quotation marks matter when a pathname contains spaces. The sudo command may request an administrator password. When entering a password in Terminal, characters generally are not visually displayed as you type. Enter the password carefully and press Return.

If the output identifies an application or process using files from the disc, close the relevant document or quit the application normally. Then retry:

Do not immediately terminate every process name you do not recognize. Some processes belong to macOS, and randomly killing system processes is the command-line equivalent of trying to fix a light switch with a hammer.

Should You Force Unmount a Stuck CD or DVD?

diskutil includes force options for certain unmount operations. However, a forced unmount is less considerate of open files than a normal unmount. For that reason, it should not be your first solution to an ejection problem.

With read-only commercial CDs and DVDs, the risk profile is different from disconnecting a writable external SSD during active writes. Even so, a failed normal eject is useful information. It tells you that macOS may still believe the media is in use.

The safer troubleshooting order is:

  1. Close files stored on the CD or DVD.
  2. Quit applications using the disc.
  3. Move Terminal out of the disc’s mounted directory.
  4. Run drutil eject.
  5. Identify the media with diskutil list.
  6. Run diskutil eject against the confirmed disk identifier.
  7. Log out or restart if software still prevents ejection.

This sequence solves the reason for the refusal instead of simply applying more force to the refusal.

Restart the Mac and Eject the Disc During Startup

If Terminal cannot eject the CD or DVD, restarting can release processes or user sessions that have the disc open.

Apple’s documented Mac troubleshooting guidance includes restarting while holding the mouse or trackpad button until the disc ejects. The exact experience can depend on Mac hardware and the optical-drive setup, but it remains a useful fallback when normal software ejection fails.

Before restarting, save open work. Then choose Restart from the Apple menu. During startup, hold the mouse or trackpad button and watch for the optical drive to eject the media.

If another signed-in user was accessing the disc, logging that user out may also solve the problem without requiring a full restart.

External Optical Drive Troubleshooting

When an external CD or DVD drive ignores Terminal commands, the problem may be the connection rather than the disc.

Connect the Drive More Directly

Remove unnecessary hubs and intermediate connections where practical. Reconnect the optical drive directly to the Mac using a compatible connection or supported adapter.

This is especially relevant to the Apple USB SuperDrive. Apple specifically advises a direct Mac connection when the SuperDrive does not respond while connected through an external display or USB hub.

Check the Cable and Port

A drive can receive enough power to make noises while still suffering from an unreliable data or power connection. Try another compatible port when available. Inspect detachable cables for damage and avoid loose adapter combinations.

Listen to the Drive

The sounds a drive makes can provide clues. A normal brief spin followed by an eject attempt suggests something different from repeated clicking, grinding, or endless loading cycles.

Unusual mechanical noises, a visibly damaged disc, or a tray that is physically crooked can indicate hardware trouble. At that point, additional Terminal commands are unlikely to perform mechanical therapy.

When Terminal Commands Will Not Fix a Stuck Disc

Terminal can request an eject operation. It cannot repair a broken loading belt, straighten warped media, replace a failed motor, or remove an object accidentally inserted into a drive.

Stop command-line troubleshooting and consider hardware service when:

  • The drive repeatedly grinds or clicks.
  • The tray starts to open and becomes physically stuck.
  • A disc was inserted incorrectly.
  • The media is cracked, warped, or has a peeling label.
  • The optical drive is not detected despite verified connections.
  • The same drive repeatedly traps multiple known-good discs.

A manual emergency-eject mechanism exists on some third-party optical drives, but procedures vary by manufacturer and model. Follow the drive manufacturer’s instructions rather than pushing a random piece of metal into the first interesting hole you see.

Slot-loading drives require particular caution. Forcing objects into the slot can damage the loading mechanism, the disc, or both.

A Practical Terminal Eject Cheat Sheet

For quick reference, these are the most useful commands discussed in this guide.

Try a normal optical disc eject

Request a tray/media eject

List detected optical drives

Display optical drive information

Check optical media status

List disks recognized by macOS

Inspect a specific disk

Eject a confirmed disk

Return Terminal to your home directory

View mounted volume names

Remember that device identifiers are examples. Always use diskutil list and confirm the correct disk on your Mac.

Experiences From Troubleshooting Stuck CDs and DVDs

One of the most useful lessons from dealing with stubborn optical media is that the simplest command often works precisely when the graphical interface does not. I have seen situations where Finder’s Eject icon was clicked several times, the keyboard command appeared useless, and the drive remained silent. Opening Terminal and running drutil eject immediately triggered the familiar mechanical sound of a disc being released.

The reaction is usually a mixture of relief and mild offense. Why did a two-word command work when five minutes of clicking failed? The answer is not that Terminal possesses mystical powers. It is simply another way of asking macOS and its storage or optical-disc frameworks to perform an operation. Still, when the disc slides out, Terminal feels a little like a wizard’s staff.

Another memorable troubleshooting pattern involves a mounted data DVD. The user opens Terminal, changes into a folder on the disc to examine a few files, and later attempts to eject the media. macOS refuses. Several commands are tried. Finder is blamed. The DVD is blamed. The ancient concept of optical storage itself is briefly placed on trial.

Then someone notices the Terminal prompt. The shell is still sitting inside /Volumes/Project DVD. Running cd ~ moves the shell back to the home directory. The next eject attempt succeeds.

This is why troubleshooting should be observational rather than aggressive. A failed eject command is not merely a failure; it is a clue. When drutil cannot complete an eject because media cannot be unmounted, the right question becomes, “What is still using this disc?” That question is much more productive than, “How hard can I force it?”

I have also learned to distrust complicated USB setups when troubleshooting external optical drives. A desk may contain a laptop, monitor, dock, keyboard, card reader, charger, storage drive, and one heroic USB hub attempting to negotiate peace among all of them. Add a disc drive and suddenly the DVD spins, pauses, vanishes from Finder, returns, and refuses to eject.

Reducing the setup is often revealing. Disconnect the optical drive, simplify the connection, and attach it more directly using compatible hardware. If drutil list now sees the drive consistently and drutil eject works, the “stuck DVD” may never have been stuck at all. The connection was unreliable.

Device identification is another lesson worth repeating. The first time someone uses diskutil list, the output can resemble a small wall of technical hieroglyphics. The temptation is to spot disk2 in a tutorial and type exactly the same identifier. Do not do that.

Disk identifiers belong to the current system state. Attaching storage or mounting disk images can affect what appears in the disk list. I prefer checking diskutil list, reading the media details, and using diskutil info when there is any doubt. Five extra seconds of verification is considerably more comfortable than experimenting on the wrong storage device.

There is also value in knowing when to stop. A software-related stuck disc tends to produce logical clues: an app is using media, a volume will not unmount, or an eject request fails cleanly. A physically unhappy drive can produce a different personality. Clicking, repeated loading attempts, grinding, or a tray that visibly catches deserves caution.

During one type of troubleshooting session, users often become increasingly determined because each failed software attempt feels like a challenge. That is exactly when bad ideas appear. Tweezers arrive. Screwdrivers emerge. Someone searches a desk drawer for a paper clip despite having no idea whether the drive includes a documented emergency-release hole.

The better experience comes from using a fixed escalation path. First, close files and applications. Second, try drutil eject. Third, inspect the drive and media with drutil and diskutil. Fourth, investigate processes that may be holding the disc open. Fifth, log out or restart and use the startup eject method. Finally, if the drive remains undetected or sounds mechanically damaged, treat it as a hardware issue.

This process is less exciting than attacking a computer with improvised tools, which is precisely why it is better.

The broader lesson extends beyond CDs and DVDs. Terminal troubleshooting works best when commands are used to gather information before making changes. Run drutil list to see whether the optical drive exists. Run diskutil list to find media identifiers. Check mounted volumes. Look for open files. Only then issue the appropriate eject request.

Optical drives may be far less common than they once were, but archives, old software, music collections, DVD libraries, and legacy business data ensure they have not disappeared completely. When one of those discs refuses to leave a Mac, knowing a few Terminal commands can turn an annoying hardware mystery into a manageable diagnostic task.

Conclusion: Use Terminal Before Assuming the Drive Is Broken

When a CD or DVD refuses to eject from a Mac, start with drutil eject. It is direct, easy to remember, and specifically relevant to optical drives. If the disc remains stuck, use drutil list and diskutil list to confirm that macOS recognizes the hardware and media. After identifying the correct disk, diskutil eject provides another controlled ejection method.

When an unmount fails, close applications, documents, and Terminal sessions that may still be accessing the disc. For an external drive, simplify the USB connection. If software methods fail, logging out or restarting while using the documented startup eject technique may release the media.

Most importantly, distinguish a software refusal from a mechanical failure. Terminal can send excellent instructions. It cannot negotiate with a cracked DVD or repair a broken eject motor. Know when the command line has done its job and hardware service needs to take over.

Note: Terminal commands and available options can vary with macOS and optical-drive hardware. Confirm device identifiers on your own Mac before running disk commands, and follow the drive manufacturer’s instructions for any physical emergency-eject procedure.

By admin