Commands · Command

CommandLinuxmacOS

mount

mount [device] [mountpoint] (no args: list currently mounted filesystems)

Attaches a filesystem — a disk, partition, or network share — to a directory in the filesystem tree, making its contents accessible.

// FLAGS

-tspecify filesystem type
-omount options, e.g. ro for read-only
-amount everything listed in /etc/fstab

// EXAMPLE

mount -t ext4 /dev/sdb1 /mnt/data — mounts a partition at /mnt/data so its files become accessible there.

// GOTCHA

A mount only lasts until reboot unless it's also added to /etc/fstab — a very common "it worked yesterday" ticket after a restart.

// RELATED COMMANDS