A well-known difference between Linux and Windows is that it allows users to transparently control the mounting of disk partitions. In turn, this gives the right to control the flexibility to customize the directory structure, to use multiple file systems, where each will fulfill its own purpose.
Thanks to this feature, the user can reinstall the operating system without losing user files, access kernel parameters using the /proc
and /sys
directories, and block devices using the /dev
directory. In this article, we will talk about mount points and also look at them in Linux.
To understand the term mount point, it is enough to familiarize yourself with an analogy. Let's imagine a large field on which you want to plant vegetables. But there is a need for not one but several varieties, for example, potatoes. To realize the task, the field should be divided into plots, and on each of them to plant the desired variety. When the time comes to harvest, regardless of the variety, the potatoes should be dug up and transported, and there is only one road to the field and all the potatoes will be transported along this road. That is also irrespective of the plot from which the crop was harvested.
Now let's get to the point. Let's assume that you have one large hard disk on which you need to write data. In fact, this is our field. But you need a file system without journaling for the /boot directory, a separate file system for the root and for /home
. That's why the hard disk is partitioned. These partitions are then formatted into the desired file system. Like the example of different varieties of potatoes. The mounting process is the way the potatoes are taken out of the plot. Whichever partition the data is on, it can only be accessed from the root / directory. All partitions are mounted here, if not to the root itself, then to one of the folders. This folder is called a mount point and its contents are replaced with the contents of the partition during mounting.
To view mount points, use the following command:
$ mount
With the advent of snap and flatpack, Linux mount points are littered with mounting various snap packages and their contents to the file system. However, mounted hard disks can be parsed here as well. To filter out only hard disks use the grep
program:
$ mount | grep ^/dev
This way you can not only see, but you can also configure mount points using the /etc/fstab
file.
This lists all disk partitions that are mounted to the system.