There may be easier ways depending on your DE, etc, but here's a basic strategy that will work everywhere:
I. Figure out the device node.
These are in the /dev/
directory, and pretty easy to find once you get the idea. A big clue is that USB storage devices usually have at least one partition. This means there will be at least two nodes, one for the device as a whole and one for each partition. The naming scheme gives this away, because if the device is sda
, the first partition will be sda1
. If you look at ls /dev
, you'll notice there aren't that many things following that pattern. Ignore all the tty
and vcs
things.
Also, the name may follow the same pattern as your hard drive(s), using a
, b
, c
etc. in order. For example, if you have two hard drives and one is sda
and the other is sdb
, a USB device added subsequently might be sdc
. These then each have partitions (sda1
, sda2
, sdb1
, sdc1
, etc).
Note that it is possible to format a device such that it doesn't have any partitions, in which case the device and the filesystem on it are accessed by the same node with no number (e.g. sdc
). You probably haven't done that, but just in case, keep in mind it is possible.
The most sure fire way to figure this out the first time is to go ls /dev > one.txt
while the device is still plugged in but unmounted. Now pull it out, wait a few seconds, and ls /dev > two.txt
. Then: diff one.txt two.txt
. Whatever comes out is the name of your device node. It will probably be the same next time, unless you have a lot of devices you are often adding and removing, in which case the a
, b
, c
suffix may be different.
You can enforce specific device node names for specific devices using udev
, but if it's just for this, it isn't really worth bothering with. It is handy if you want things mounted specific ways at boot.
II. Mount the device/partition.
You need superuser privileges:
sudo mount /dev/sdc1 /mnt/usb
That's the partition node first, then the mount point. See man mount
.