Disks and file system

Command mount

Mount file system

Linux · Bash examples · commands run on the selected server

When to use mount

Use mount to inspect current mounts or attach a verified filesystem at a prepared directory. Understand whether a mount is temporary and whether it will hide existing directory contents until unmounted.

Syntax

mount [OPTIONS] [SOURCE DIRECTORY]

Square brackets mark optional arguments; an ellipsis means repetition. Replace example file names, user names and server addresses with your own values.

Common options and arguments

-o ro
Mount the file system read-only.
-t TYPE
Specify the file system type.
--bind
Bind an existing path to another location.

Usage examples

View current mounts

mount

Current mount information is displayed without creating a new mount.

Prepare a separate mount point

sudo mkdir -p /mnt/terminalus-demo

An empty mountpoint directory is prepared separately.

Mount dedicated test partition read-only

sudo mount -o ro /dev/vdb1 /mnt/terminalus-demo

The verified partition is requested read-only at the mountpoint; filesystem-specific recovery semantics still matter.

Notes and limitations

  • Device names are examples. Check lsblk -f first and verify both the mount directory and partition contents.
  • Mounting over a non-empty directory temporarily hides its existing contents.

Common questions and troubleshooting

Why did files disappear under the mountpoint?

A mounted filesystem covers the underlying directory view; it does not automatically delete those original files. Unmounting restores the underlying view.

Does a manual mount survive reboot?

Not ordinarily by itself. Persistent mounting is configured separately and should use verified identifiers and suitable dependencies.

Further help

Options vary by version and distribution. Check the installed documentation with this command: man mount.