I want to know how to
umount my USB drive via command line. I am using Ubuntu 12.04 LTS 32-bit.
Suppose your usb drive is mounted to
/media/usb then it would be sufficient to do
sudo umount /media/usb
Suppose the your usb is
/dev/sdb1 then you could also do
sudo umount /dev/sdb1
You may also have a look at the anwers of one of my questions, how to umount all attached usb devices with a single command: Umount all attached usb disks with a single command
You can also use
udisks --unmount /dev/sdb1
which does not require root.
Better than using
sudo to unmount as root, just install the pmount package and do:
man pumount says:
NAME pumount - umount arbitrary hotpluggable devices as normal user SYNOPSIS pumount [ options ] device DESCRIPTION pumount is a wrapper around the standard umount program which permits normal users to umount removable devices without a matching /etc/fstab entry.