Home  >  Article  >  Operation and Maintenance  >  What does linux mount mean?

What does linux mount mean?

藏色散人
藏色散人Original
2019-12-25 11:12:384400browse

What does linux mount mean?

#What does it mean to mount Linux?

In the Linux system, "everything is a file", and all files are placed in a tree directory structure with the root directory as the root. From Linux's perspective, any hardware device is also a file, and each of them has its own file system (file directory structure).

Recommended: "linux tutorial"

The problem that arises is that when using these hardware devices in a Linux system, Only by combining the file directory of Linux itself and the file directory of the hardware device can the hardware device be used by us. The process of combining the two into one is called "mounting".

If it is not mounted, the hardware device can be found through the graphical interface system in the Linux system, but it cannot be found through the command line.

Mounting 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 a mount point. Since the mounting operation will hide the files in the original directory, neither the root directory nor the original directory of the system can be used as a mount point. The mount point will cause system abnormalities or even crashes. It is best to use a newly created empty directory as the mount point.

For example, we want to access the data in a U disk through the command line. Figure 1 shows the file directory structure of the U disk and the file directory structure in the Linux system.

What does linux mount mean?

Figure 1 U disk and Linux system file directory structure

As you can see in Figure 1, currently the U disk and Linux system files belong to two files. system, the U disk file cannot be found using the command line, and the two file systems need to be mounted.

Next, we create a new directory /sdb-u in the root directory and mount the U disk file system to this directory through the mount command. The mounting effect is shown in Figure 2.

What does linux mount mean?

Figure 2 File system mounting

You can see that the U disk file system has become part of the Linux file system directory. At this time, access /sdb- u/ is equivalent to accessing a USB flash drive.

As mentioned before, the /dev/ directory file in the root directory is responsible for all hardware device files. In fact, when the U disk is inserted into Linux, the system will indeed allocate a directory file (such as sdb1) to the U disk. ), located in the /dev/ directory (/dev/sdb1), but the U disk data cannot be directly accessed through /dev/sdb1/. Accessing this directory will only provide you with some basic information about the device (such as capacity).

In short, when using any hardware device in the Linux system, the device file must be mounted with the existing directory file.

The above is the detailed content of What does linux mount mean?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn