Get the App
SLTechnology News&Howtos  ›  Servers  › 

What is the mount in the Linux system

Shulou Source: shulou.com Published: 2022-06-03 03:56:31 09月22日 Update

Mount refers to connecting the top-level directory in the device file to a directory under the Linux root directory (preferably an empty directory). Accessing this directory is equivalent to accessing the device file.

To correct a misunderstanding, not any directory under the root directory can be used as the mount point, because the mount operation will make the files in the original directory hidden, so the root directory and the original directory of the system should not be used as the mount point. It will cause a system exception or even crash, and the mount point should be a newly-built empty directory.

For example, we want to access the data on a USB disk from the command line. The following figure shows the file directory structure of the USB disk and the file directory structure in the Linux system.

As you can see from the above figure, the current U disk and Linux system files belong to two file systems, and the U disk files cannot be found using the command line, so the two file systems need to be mounted.

Next, we create a new directory / sdb-u under the root directory, and mount the USB disk file system to this directory through the mount command. The mount effect is as follows:

As you can see, the USB disk file system has become part of the Linux file system directory, and accessing / sdb-u/ is equivalent to accessing the USB disk.

The / dev/ directory file in the root directory is responsible for all the hardware device files. In fact, when the U disk is inserted into Linux, the system does assign a directory file (such as sdb1) to the U disk, which is located in the / dev/ directory (/ dev/sdb1), but you cannot access the U disk data directly through / dev/sdb1/. Accessing this directory will only provide you with some basic information (such as capacity) of this device.

In short, any hardware device used by the Linux system must mount the device file with the existing directory file.

These are the details of what mounting is in linux. Please pay more attention to other related articles!

Tags: Files directories systems devices root directories commands two that is data best hardware structure next picture above figure below fact in fact example information content Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Apple OPPO Reno MySQL Xiaomi Huawei