Mounting and unmounting devices from the command line

As it may happen sometimes you either work inside a terminal client or you find yourself using a Linux system or a filemanager which does not automatically mount volumes (meaning, for example, usb sticks or external hard drives). The next solution will help you on your mounting efforts.

Mounting devices

First you need to find out what is the address of the device you are trying to mount. Attach your  device to your computer and run, for example, gparted to see the device’s address (should be something like /dev/sdb1).

Once you have figured out the device’s address open a terminal. Inside the terminal client(xterm, gnome-terminal,rox-term…)  type the following to create a mount directory:

mkdir usb

Note: you can of course choose any folder name you want.

Once you have created the usb folder it is time to mount our  device in it. The following command must be typed as a  root user or putting  sudo in front of the command  if your system uses it:

mount /dev/sdb1 usb

After this your volume should be mounted. However do keep in mind that you might need to give a more detailed path description than our examples usb. A more detailed path description will be needed if you move out from the parent directory which has a folder called usb in it.

Unmounting devices

Once you are done with your usb device and you wish to unmount become  a root user or use sudo while typing the following comand inside the terminal client:

umount usb