Unable to eject/safely unmount USB drive

21,427

So, the problem has been solved thanks to Douggro, who helped me in the comments. I'm just reposting his answer here to close the question.

Try ls /media and see if the drive shows there. If it does, sudo umount /media/drivename – douggro

Share:
21,427

Related videos on Youtube

Gus
Author by

Gus

Updated on September 18, 2022

Comments

  • Gus
    Gus over 1 year

    So I'm trying to safely remove this USB drive, because when I don't it does not work properly. When I go on Nautilus and try to eject it, I get this error message:

    Error ejecting: eject exited with exit code 1: eject: unable to eject, last error: Invalid argument
    

    And when I try to safely remove it via Nautilus or Disk Utility:

    Error detaching: helper exited with exit code 1: Detaching device /dev/sdb
    USB device: /sys/devices/pci0000:00/0000:00:12.0/usb3/3-1)
    SYNCHRONIZE CACHE: FAILED: No such file or directory
    (Continuing despite SYNCHRONIZE CACHE failure.)
    STOP UNIT: FAILED: No such file or directory
    

    Doing a file system check on Disk Utility returns File system is clean.. Trying to unmount it via terminal returns this:

    ~sudo eject /dev/sdb
    eject: unable to eject, last error: Invalid argument
    

    I've tried to unmount it on Windows (dual boot system), but I simply got an error message saying that it was unable to eject it. No programs running or anything.

    • douggro
      douggro over 10 years
      Have you tried sudo umount /dev/sdb ?
    • Gus
      Gus over 10 years
      Weird, I get umount: /dev/sdb: not mounted as result. And I'm sure the device is mounted.
    • douggro
      douggro over 10 years
      Try ls /media and see if the drive shows there. If it does, sudo umount /media/drivename
    • Gus
      Gus over 10 years
      That worked! But it can be removed without problems just by unmounting? Safely removing still does not work.
    • douggro
      douggro over 10 years
      Once it's unmounted from /media you should be able to disconnect it from the computer without problem: the filesystem is unmounted at that point.
    • Gus
      Gus over 10 years
      I see. The problem I'm having is with an USB drive, because it seems to be corrupting the files every time I place them. I thought it was because of removing it incorrectly, but the problem continues. Should I make a new question for it (since the unmount problem has been solved already) or should I edit this question?
    • douggro
      douggro over 10 years
      If you haven't already, start a new question regarding the corruption - but include this question as a link for background reference.
    • David Tonhofer
      David Tonhofer about 7 years
      @douggro Better run sync; sync before ripping out the cable to flush any buffers to disk in any case. Even if the disk is unmounted, the kernel may still have data to write out to said disk.
  • d a i s y
    d a i s y about 8 years
    what to do if it does not ?
  • David
    David about 2 years
    Should not need to eject as root.
  • Concurrent EDA
    Concurrent EDA about 2 years
    Edited to use sudo, not sudo su.