How to mount a device in Linux?

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.


I was really rusty on this, and then it started coming back.. if this doesn't answer your question, maybe I misread it...

Alibi: this is on an Ubuntu 14 release. Your mileage may vary.

I use lsblk to get my mount points, which is different from mount For me lsblk is easier to read than mount

Make sure that you have a directory created before you go to mount your device.

sudo mkdir /{your directory name here}
sudo mount /dev/{specific device id} /{your directory name here that is already created}

You should be good to go, however check security permissions on that new directory to make sure it's what you want.


These days, you can use the verbose paths to mount a specific device.

For example:

mount /dev/disk/by-id/ata-ST31500341AS_9VS2AM04-part1 /some/dir
mount /dev/disk/by-id/usb-HTC_Android_Phone_SH0BTRX01208-0\:0 /some/dir

Tags:

Linux

Mount