Linux Mount – How to Mount a Device in Linux

linuxmount

I read some resources about the mount command for mounting devices on Linux, but none of them is clear enough (at least for me).

On the whole this what most guides state:

$ mount
(lists all currently mounted devices)

$ mount -t type device directory
(mounts that device)

for example (to mount a USB drive):
$ mount -t vfat /dev/sdb1 /media/disk

What's not clear to me:

  • How do I know what to use for "device" as in $ mount -t type device directory? That is, how do I know that I should use "/dev/sdb1" in this command $ mount -t vfat /dev/sdb1 /media/disk to mount my USB drive?

  • what does the "-t" parameter define here? type?

I read the man page ($ man mount) a couple of times, but I am still probably missing something. Please clarify.

Best Answer

You can use fdisk to have an idea of what kind of partitions you have, for example:

fdisk -l

Shows:

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *          63   204796619   102398278+   7  HPFS/NTFS
/dev/sda2       204797952   205821951      512000   83  Linux
/dev/sda3       205821952   976773119   385475584   8e  Linux LVM

That way you know that you have sda1,2 and 3 partitions. The -t option is the filesystem type; it can be NTFS, FAT, EXT. In my example, sda1 is ntfs, so it should be something like:

mount -t ntfs /dev/sda1  /mnt/

USB devices are usually vfat and Linux are usually ext.

Related Question