Eject or Unmount a disk through the Terminal

Having problem unmounting your disk. Here is an alternative to restarting your computer to eject your unresponding disk.

Having problem unmounting your disk? Try using your Terminal application before restarting.

  1. Open the Terminal application.
  2. Then type ‘df’. This will display a list of all mounted disk items.
  3. Find the disk you want to eject.
  4. The disk I was looking to unmount displayed like this:
    “/dev/disk1s1s2 208484 208484 0 100% /Volumes/Alex Model Pix”.
  5. Above you see first a Unix name “/dev/disk1s1s2” followed by the CD volume name “/Volumes/Alex Model Pix”.
  6. Now type “hdiutil eject FullUnixName” to eject it.
  7. Example: “hdiutil eject /dev/disk1s1s2”.

That’s it. If this does not work. Just restart or poke a pin inside the hidden eject hole by the disk tray if there is one.

You may also like...

8 Responses

  1. matt says:

    My problem was not that the CD was busy, but that it was no longer recognized. No CD icon on my desktop, no CD icon in the Finder, the Eject command under “file” was inaccessible. A simple terminal command to eject a CD that doesn’t require as many steps, if this fails, try the above post:

    drutil tray eject

  2. Andrina says:

    These quick lil commands also do the trick….

    drutil tray open

    drutil tray close

  3. Alex says:

    Or use “drutil eject” to open tray on the Mac G5.

  4. jojo says:

    Works well, except in 10.5, the command is switched to “hdiutil detech”

    : )

  5. Skate says:

    Hey! Great instructions, only I am having a problem with Terminal. I type what you say, and it does…nothing. It’s like a word document, you type and nothing happens, you just keep typing. Is this a problem?

  6. HELP ME says:

    PLEASE! HELP! my disk has been stuck in my macbook for almost a year! i’ve tried EVERYTHING! i’ve tried at least 15 different solutions to stuck disks but none of them work. please, i really need to get this disk out my computer.

  7. Eric says:

    Select startup from network connection, after startup, eject dvd/cd

  8. jared says:

    worked great for me to unmount a stubborn fuse drive. thanks!

Leave a Reply