Results 1 to 3 of 3

Thread: unable to eject/unmount pendrive

  1. #1
    Join Date
    Aug 2012
    Beans
    623

    unable to eject/unmount pendrive

    Hello,
    How do I eject(unmount) my pendrive from the command line?

    I tried doing the following, see output below
    Code:
    $ sudo umount /media/Transcend
    umount: /media/Transcend: device is busy.
            (In some cases useful info about processes that use
    
             the device is found by lsof(8) or fuser(1))
    Code:
    $ sudo udisks --unmount /media/Transcend/
    Device file /media/Transcend/ is not a block device: Resource temporarily unavailable
    Thanks.

  2. #2
    Join Date
    Aug 2011
    Location
    47°9′S 126°43W
    Beans
    2,172
    Distro
    Ubuntu 16.04 Xenial Xerus

    Re: unable to eject/unmount pendrive

    "umount" is the way to go. But it is complaining that one or more files on it is opened by some process. What often happens it that it is the working directory for some process (could be your script). If it's your script, then make it work with a different working directory. If it's some other process independtn of your script (file explorer, etc...) you have to handle the case manually. You can also try "umount -f"
    Warning: unless noted otherwise, code in my posts should be understood as "coding suggestions", and its use may require more neurones than the two necessary for Ctrl-C/Ctrl-V.

  3. #3
    Join Date
    Aug 2012
    Beans
    623

    Re: unable to eject/unmount pendrive

    Quote Originally Posted by ofnuts View Post
    it is the working directory for some process (could be your script)
    ofnuts, I was indeed running it from the same directory as the pendrive.
    Ran it from another directory and worked just fine.

    Marking the thread as solved.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •