Home·Terminal commands

mount

Files and directories

Usage

sudo mount [device] [mountpoint]

Attaches a filesystem to a directory; whatever was already in the mountpoint is hidden rather than deleted and comes back when you unmount.

Common flags

FlagMeaning
-tFilesystem type, as in -t ext4
-oComma-separated options such as ro, rw, loop, remount
-aMount everything listed in /etc/fstab
-rMount read-only
--bindLinux: make an existing directory appear at a second place

Examples

sudo mount /dev/sdb1 /mnt

Attaches the partition at /mnt.

sudo mount -o remount,rw /

Makes a read-only root writable again (Linux).

mount | column -t

Lists what is mounted, lined up.

Moving, deleting and finding. Some of these do not ask twice, which is why -i becomes a habit.

How to read this

  • Square brackets [ ] mark a part you may leave out.
  • An ellipsis … means you can list more than one.
  • Flags are case-sensitive — in some commands -r and -R do different things.

Questions

Q. What does mount do?

Attaches a filesystem to a directory; whatever was already in the mountpoint is hidden rather than deleted and comes back when you unmount.

Q. How do I type it?

sudo mount [device] [mountpoint] — square brackets mark the parts you can leave out.

Q. How many flags are worth knowing?

5 are listed here; the full set is in man mount. This command sits under Files and directories.

Related commands

man page: man mount