Skip to content

Mounting devices manually

Jason Charney edited this page Jan 29, 2015 · 3 revisions

On most Linux systems that use KDE, GNOME, LXDE, or MATE, when you plug a device into your computer, mounting automatically happens. However, if it doesn't happen, or if you like to rock the command line either to keep it old-school or to keep your mind keen, mounting a device manually is for you.

All Linux users should know this anyway. In fact, part of this article will also be dedicated into doing the exact opposite.

Most of the terminology described in this article explained in [SD Card formatting and image mounting](SD Card formatting and image mounting). As much as I should repost how to do it all, [I really would rather not](Don't Repeat Yourself).

Mounting

These instructions apply for SD cards. I'd go into the whole "Optical Media" thing for CDs, DVDs, maybe LaserDisc, but lately all I seem to use are SD cards or micro SD cards or thumbdrives, which are very easy to mount and dismount.

First thing we want to do, before pluggin in our device, is list what storage devices the computer may be familiar with.

$ ls -l /dev/sd*
brw-rw---- 1 root disk 8,  0 Jan 19 22:25 /dev/sda
brw-rw---- 1 root disk 8,  1 Jan 19 22:25 /dev/sda1
brw-rw---- 1 root disk 8,  2 Jan 19 22:25 /dev/sda2
brw-rw---- 1 root disk 8,  3 Jan 19 22:25 /dev/sda3
brw-rw---- 1 root disk 8, 16 Jan 19 22:25 /dev/sdb
brw-rw---- 1 root disk 8, 32 Jan 19 22:25 /dev/sdc
brw-rw---- 1 root disk 8, 48 Jan 21 19:00 /dev/sdd
brw-rw---- 1 root disk 8, 64 Jan 19 22:25 /dev/sde

Some of these devices are mounted. Some of them are not. But what you do see is that some devices have parition numbers. Let's see what happens when we plug in a device.

$ ls -l /dev/sd*
brw-rw---- 1 root disk 8,  0 Jan 19 22:25 /dev/sda
brw-rw---- 1 root disk 8,  1 Jan 19 22:25 /dev/sda1
brw-rw---- 1 root disk 8,  2 Jan 19 22:25 /dev/sda2
brw-rw---- 1 root disk 8,  3 Jan 19 22:25 /dev/sda3
brw-rw---- 1 root disk 8, 16 Jan 19 22:25 /dev/sdb
brw-rw---- 1 root disk 8, 32 Jan 19 22:25 /dev/sdc
brw-rw---- 1 root disk 8, 48 Jan 21 21:25 /dev/sdd
brw-rw---- 1 root disk 8, 49 Jan 21 21:25 /dev/sdd1
brw-rw---- 1 root disk 8, 64 Jan 19 22:25 /dev/sde

Notice that /dev/sdd1 now appears. We can mount it. If that doesn't happen, that's OK, we can at least try to mount /dev/sdd,

sudo mkdir /media/jrcharney/sdcard sudo mount /dev/sdd1 /media/jrcharney/sdcard

Unmounting

sudo umount /media/jrcharney/sdcard `sudo rmdir /media/jrcharney/sdcard

To unmount all partitions of that

sudo umount /dev/sdd*

This will unmount all partitions on /dev/sdd and/or the device itself. Take note that umount is spelled with only one "n" in it. Generally there should be no error messages when this happens. If there are, the most common ones would be related to the device being busy because something is still using it. If that is the case, you should close whatever is still using it then unmount.

From there you can just unplug the device.

See Also

  • [SD Card formatting and image mounting](SD Card formatting and image mounting)

External Links

Clone this wiki locally