The mount and umount commands in Linux: mounting and unmounting drives

Introduction

On Unix-like systems, the kernel treats disks and partitions as special files that must be made visible within the directory tree before they can be read from or written to. This process is known as mounting and its inverse, the removal of that link, is called unmounting. The mount and umount commands are the most commonly used command‑line interface for performing these operations in Linux. Understanding how they work allows you to manage USB drives, external hard disks, network partitions, and temporary filesystems safely and efficiently.

What does the mount command do?

The mount command takes a block device (for example, /dev/sdb1) or a remote location and associates it with a mount point, which is an existing directory in the filesystem. Once mounted, the device’s contents appear under that directory and can be accessed like any other file or folder. Additionally, mount lets you specify the filesystem type, access options, and permissions via flags that modify its behavior.

Basic mount syntax

The simplest form is:

mount device mount_point

If either argument is omitted, mount consults the file /etc/fstab to obtain the missing information. When you need to explicitly specify the filesystem type, use the -t option followed by the name (for example, ext4, ntfs or vfat).

  • -t type: specifies the filesystem.
  • -o options: allows passing a comma‑separated list of options (such as ro for read‑only or rw for read‑write).
  • -a: mounts all filesystems listed in /etc/fstab that have the auto option

    This post is also available in ESPAÑOL.

Leave a Reply

Your email address will not be published. Required fields are marked *

Esta obra está bajo una Licencia Creative Commons Atribución 4.0 Internacional para Francesc Roig francesc@vivaldi.net .