System and processes
The mount command
Attaches a device to a folder so you can reach its files.
Most useful options
-a, --allMounts what /etc/fstab lists that is not mounted yet. Skips entries marked noauto-t, --types fstypeSpecifies the file system type, such as ext4, vfat or xfs. Without -t, mount tries to detect it-o, --options optsOptions separated by commas, for example ro,noexec. If options conflict, the last one wins-r, --read-onlyMounts read-only. It is the same as -o ro-w, --read-writeMounts with write access. It is the same as -o rw-l, --show-labelsAdds disk labels to the list of mountsCopy-ready examples
$ mountsee the current mounts, with their device, folder and type.Example output
/dev/sdb1 on /mnt type vfat (rw,relatime)
$ sudo mount /dev/sdb1 /mntmounts the partition at /mnt. It needs sudo.$ sudo mount -t vfat -o ro /dev/sdb1 /mntmounts a vfat USB stick read-only, so nothing is modified.$ sudo mount -o noexec,nosuid /dev/sdb1 /mntmounts without allowing programs on the disk to run or SUID bits to apply.$ sudo mount /dev/sdb1 /mnt && sudo umount /mntmounts and unmounts in one step, to check that it works.You can try them in the browser terminal: it does not touch your computer.
Typical mistakes
- Mounting almost always needs sudo: without root permissions, mount will not mount normal devices.
- Unmount before removing the USB stick so you do not lose data. Pulling it out with pending writes can damage the file system.
- The mount point must be a folder that already exists. Create it with mkdir before mounting.
Differences from similar commands
- umount: does the opposite: detaches the file system from the folder.
- lsblk: shows disks and partitions and where they are mounted, without mounting anything.
/etc/fstab: is the file that defines what to mount and with which options. mount -a mounts everything it lists; mount /mnt looks that folder up there.
FAQ
What is the mount point?
The folder, for example /mnt, where the device contents appear. While it is mounted, that folder shows the disk's files.
Why use a UUID instead of /dev/sdb1?
Because device names can change when disks are reconnected. Look up the UUID with blkid and use it as UUID=... in /etc/fstab.
Can I mount without being root?
Only if fstab has the user option on that line. Otherwise you need root, according to the manual.
Learn to actually use it
The basic Linux course takes you from zero to console fluency with 24 self-grading lessons.
Start the free course