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 just bought a brand new hard disk with no partitions on it. Your Mandrake Linux 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 on 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 contains a filesystem. While Windows assigns a letter to each of these filesystems (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 must 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. Note that you can also mount the same filesystem several times.
This allows great configuration flexibility. 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. Generally, the directory which contains it is /var/www. Hence, it acts as the mounting point for the partition. You can see in figure 7-1 and figure 7-2 the system's situation 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 scarce, 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;
and this directory should preferably 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 accessible anymore until you free the mount point.
[1] | GNU/Linux can manage up to 64 mounted filesystems simultaneously. |