0
0
Linux-cliHow-ToBeginner · 3 min read

How to Mount a Drive in Linux: Simple Steps and Examples

To mount a drive in Linux, use the mount command followed by the device name and the directory where you want to access it. For example, mount /dev/sdb1 /mnt mounts the drive at /mnt. Make sure the mount point directory exists before mounting.
📐

Syntax

The basic syntax of the mount command is:

  • mount [options] <device> <mount_point>

device: The drive or partition you want to mount, like /dev/sdb1.

mount_point: The directory where you want to access the drive's files, like /mnt.

options: Optional flags to control mounting behavior, such as filesystem type.

bash
mount /dev/sdb1 /mnt
💻

Example

This example shows how to mount a USB drive partition /dev/sdb1 to the directory /mnt/usb. First, create the mount point directory if it doesn't exist, then mount the drive.

bash
sudo mkdir -p /mnt/usb
sudo mount /dev/sdb1 /mnt/usb
ls /mnt/usb
Output
Documents Pictures Videos
⚠️

Common Pitfalls

Common mistakes when mounting drives include:

  • Trying to mount without creating the mount point directory first.
  • Using the wrong device name or partition.
  • Not having proper permissions (use sudo if needed).
  • Forgetting to unmount the drive before removing it (umount command).

Always check the device name with lsblk or fdisk -l before mounting.

bash
sudo mount /dev/sdb1 /mnt/usb  # Wrong if /mnt/usb does not exist

# Correct way:
sudo mkdir -p /mnt/usb
sudo mount /dev/sdb1 /mnt/usb
📊

Quick Reference

CommandDescription
mount /dev/sdb1 /mnt/usbMount device /dev/sdb1 to /mnt/usb
umount /mnt/usbUnmount the mounted drive from /mnt/usb
lsblkList all block devices and partitions
sudo mkdir -p /mnt/usbCreate mount point directory if missing

Key Takeaways

Always create the mount point directory before mounting a drive.
Use the correct device name found via tools like lsblk or fdisk.
Run mount commands with sudo if you get permission errors.
Unmount drives with umount before physically disconnecting them.
Check mounted drives with the mount command or lsblk after mounting.