The best way to understand "how it works" is to look at a practical case, which is what we are going to do here. Suppose you have just bought a brand new hard disk, still with no partitions on it. Your Linux-Mandrake partition is full to bursting, and rather than starting again from scratch, you decide to move a whole section of the tree structure to your new hard disk. As this new disk is very big, you decide to move your biggest directory to it: /usr. But first, a bit of theory.
As we already mentioned in the Installation guide, every hard disk is divided into several partitions, and each of these partitions contains a filesystem. While Windows gives a letter to each of these filesystems (or actually, only to those it recognizes), GNU/Linux has a unique tree structure of files, and each filesystem is mounted at one location in the tree structure.
Just as Windows needs a "C: drive", GNU/Linux has to be able to mount the root of its file tree (/) somewhere, in fact on a partition which contains the root filesystem. Once the root is mounted, you can mount other filesystems in the tree structure, at different mount points in the tree structure. Any directory below the root structure can act as a mount point.
This allows for great flexibility in configuration. In the case of a web server, for example, it is common to dedicate a whole partition to the directory which hosts the web server data. The directory which contains them is generally /home/httpd, which will therefore act as the mounting point for the partition. You can see in figure 9-1 and figure 9-2 the situation of the system before and after mounting the filesystem.
As you can imagine, this offers a number of advantages: the tree structure will always be the same, whether it extends over a single filesystem or several dozens[1]. It is always possible to physically move a key part of the tree structure to another partition when space becomes lacking, which is what we are going to do here.
There are two things you need to know about mount points:
the directory which acts as a mount point must exist,
this directory should be empty: if a directory chosen as a mount point already contains files and subdirectories, these will simply be "hidden" by the newly mounted filesystem, but they will not be deleted.
[1] | GNU/Linux can manage up to 64 mounted filesystems simultaneously. |