How to Mount File Systems on Linux

Now that we’ve covered the basics let’s move on to the practical aspects of mounting file systems on Linux. Mounting can be a temporary or permanent operation, and it’s typically performed by an administrator, either by logging in as the root user or by using the sudo command.

Syntax of mount Command

mount -t type device dir

Other forms:

mount [-l|-h|-V]
mount -a [-fFnrsvw] [-t fstype] [-O optlist]
mount [-fnrsvw] [-o options] device|dir
mount [-fnrsvw] [-t fstype] [-o options] device dir

These commands tell the Kernel to attach the filesystem found at device to the dir.

Note:

  • If you leave the dir part of syntax it looks for a mount point in /etc/fstab.
  • You can use –source or –target to avoid ambivalent interpretation.
    mount --target /mountpoint
    
    
  • /etc/fstab usually contains information about which device is need to be mounted where.
  • Most of the devices are indicated by files like /dev/sda4, etc. But it can be different for certain filesystems. Please refer below for more information.
    man mount
    
    

Note: It is important to note that we are only discussing the standard form of mount command given as syntax. Different forms are somewhat discussed because it has certain limitations on different kernels.

Options Available in mount Command

Options

Description

l

Lists all the file systems mounted yet.

h

Displays options for command.

V

Displays the version information.

a

Mounts all devices described at /etc/fstab.

t

Type of filesystem device uses.

T

Describes an alternative fstab file.

r

Read-only mode mounted.

How to Mount File System in Linux | mount Command

All files in a Linux filesystem are arranged in form of a big tree rooted at ‘/‘.These files can be spread out on various devices based on your partition table, initially your parent directory is mounted(i.e attached) to this tree at ‘/‘, others can be mounted manually using GUI interface(if available) or using mount command.

mount command is used to mount the filesystem found on a device to big tree structure(Linux filesystem) rooted at ‘/‘. Conversely, another command umount can be used to detach these devices from the Tree.

Table of Content

  • Understanding File Systems Available for Linux
  • How to List Currently Mounted File Systems on Linux
  • How to Mount File Systems on Linux
  • Practical Examples of How to Mount File Systems on Linux with Available Options
  • Frequently Asked Question

Similar Reads

Understanding File Systems Available for Linux

Before we dive into the practical aspects of mounting file systems, let’s take a moment to understand what file systems are available on our Linux system. Open a terminal and use the following command to list the supported file systems:...

How to List Currently Mounted File Systems on Linux

Now, let’s see what file systems are currently mounted on our Linux system. The mount command allows us to view this information easily:...

How to Mount File Systems on Linux

Now that we’ve covered the basics let’s move on to the practical aspects of mounting file systems on Linux. Mounting can be a temporary or permanent operation, and it’s typically performed by an administrator, either by logging in as the root user or by using the sudo command....

Practical Examples of How to Mount File Systems on Linux with Available Options

1. Displays information about file systems mounted...

Frequently Asked Question

1. What is the purpose of mounting a file system in Linux?...

Conclusion

In this article we discussed how to mount file system in linux using mount command in linux in which we learned that all your files are organized like a tree starting from the root ‘/’. Sometimes, your files are on different devices, and to access them, you use a command called ‘mount.’ This command connects those devices to specific folders in the tree. The mount command is like plugging in a USB drive or connecting to a network location. It can be temporary, for one session, or permanent, set up to connect every time you start your computer. Understanding and using the mount command helps you easily access your files. The FAQs at the end answer common questions, making it simpler for beginners to grasp....