Results 1 to 9 of 9

Thread: How to remove USB from CLI without damaging usb-drive

  1. #1
    Join Date
    Mar 2013
    Location
    127.0.0.1
    Beans
    100
    Distro
    Xubuntu 12.04 Precise Pangolin

    How to remove USB from CLI without damaging usb-drive

    If I use the command
    Code:
    sudo umount /media/usbname
    would that remove my usb stick via the terminal properly without damaging it? If not, what is the proper way of removing a USB media point from the CLI? Thanks in advance.
    PsiloCybin "Bye bye windows, hello Linux" PsiloCybin


  2. #2
    Join Date
    Feb 2008
    Location
    Funky Town, AUS
    Beans
    Hidden!
    Distro
    Xubuntu

    Re: How to remove USB from CLI without damaging usb-drive

    Yes, that would unmount it and then it would be safe to remove. Any particular reason you are not simply right clicking on it in a file manager and 'Eject'?

  3. #3
    Join Date
    Sep 2005
    Beans
    1,615
    Distro
    Xubuntu 14.04 Trusty Tahr

    Re: How to remove USB from CLI without damaging usb-drive

    If you know the device name you can umount it that way as well:

    Code:
    sudo umount /dev/sdb1
    @Bucky - he asked how to do it via CLI - maybe Server? Trying to get install working? Graphics drivers? Various reasons possibly.
    Where's [slooksterpsv] been? - I had Catastrophic partition alignment failure. I lost 90%+ of my data, and just now got it back fixed and working.

  4. #4
    Join Date
    Sep 2013
    Beans
    Hidden!
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: How to remove USB from CLI without damaging usb-drive

    Just to note, issuing the command:
    Code:
    mount
    Will show you what is currently mounted to your system which would not be safe to remove, so after issuing the sudo umount command, you could run the mount command again and see that it has successfully been unmounted and safe to remove.
    "Ignorance is short-lived, and knowledge is forever."


  5. #5
    Join Date
    Mar 2013
    Location
    127.0.0.1
    Beans
    100
    Distro
    Xubuntu 12.04 Precise Pangolin

    Re: How to remove USB from CLI without damaging usb-drive

    Yes, that would unmount it and then it would be safe to remove. Any particular reason you are not simply right clicking on it in a file manager and 'Eject'?

    Thank you for your fast reply. I am just interested in learning how to use the CLI more, as I really do prefer it, I think of it this way, Linux is like a stick shift car, so I like to go through the extra work in order to learn a few things about how the operating system functions, although If I am not mistaken umount is just a script for much bigger commands, that would be a pain to execute? Correct?

    @Bucky - he asked how to do it via CLI - maybe Server? Trying to get install working? Graphics drivers? Various reasons possibly.
    Nope, not server, just for education purposes - for learning how my linux desktop functions perhaps If I am already in the terminal to remove the USB (as I like to use nano to edit files)
    hope I did not ask a silly question!

    Thanks Ubuntu community!
    Last edited by Psil0cybin; February 11th, 2014 at 08:48 AM.
    PsiloCybin "Bye bye windows, hello Linux" PsiloCybin


  6. #6
    Join Date
    Nov 2011
    Location
    /dev/root
    Beans
    Hidden!

    Re: How to remove USB from CLI without damaging usb-drive

    Welcome to running your computer 'like a stick shift car'

    When you have collected enough experience, you will be enjoy reading man and info pages. Sometimes there is more information in the corresponding info page.

    man program and info program, for example

    Code:
    man mount
    and
    Code:
    man umount
    and
    Code:
    man udisks
    Udisks is used by the file browsers in 12.04 LTS to automount partitions.

  7. #7
    Join Date
    Mar 2013
    Location
    127.0.0.1
    Beans
    100
    Distro
    Xubuntu 12.04 Precise Pangolin

    Re: How to remove USB from CLI without damaging usb-drive

    Quote Originally Posted by sudodus View Post
    Welcome to running your computer 'like a stick shift car'

    When you have collected enough experience, you will be enjoy reading man and info pages. Sometimes there is more information in the corresponding info page.

    man program and info program, for example

    Code:
    man mount
    and
    Code:
    man umount
    and
    Code:
    man udisks
    Udisks is used by the file browsers in 12.04 LTS to automount partitions.

    Thank you so much, very helpful!
    PsiloCybin "Bye bye windows, hello Linux" PsiloCybin


  8. #8
    Join Date
    Oct 2006
    Location
    Barry. South Wales. UK
    Beans
    Hidden!
    Distro
    Ubuntu Gnome 13.10 Saucy Salamander

    Re: How to remove USB from CLI without damaging usb-drive

    An alternative command you can use in your Terminal window is: lsblk

    This also shows you what drives are mounted currently on you computer - but includes a line diagram to show the device name, and the partitions and mount points that belong to that device. Might be useful to know about...

    Nothing wrong with the mount commands and instructions in the previous posts of course - just thought you might like to know about this one too

  9. #9
    Join Date
    Mar 2013
    Location
    127.0.0.1
    Beans
    100
    Distro
    Xubuntu 12.04 Precise Pangolin

    Re: How to remove USB from CLI without damaging usb-drive

    Thanks so much, everyone! very useful information
    PsiloCybin "Bye bye windows, hello Linux" PsiloCybin


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
  •