Principles

As we already mentioned in the Installation Guide, every hard disk is divided into several partitions, and each of these contains a file system. While Windows assigns a letter to each of these file systems (actually, only to those it recognizes), GNU/Linux has a unique tree structure of files, and each file system is mounted at one location in that tree structure.

Just as Windows needs a “C: drive”, GNU/Linux must be able to mount the root of its file tree (/) on a partition which contains the root file system. Once the root is mounted, you can mount other file systems in the tree structure at various mount points within the tree. Any directory below the root structure can act as a mount point, and you can mount the same file system several times on different mount points.

This allows great configuration flexibility. For example, if you were to configure a web server, it is fairly common to dedicate an entire partition to the directory that hosts the web server's data. The directory that usually contains the data is /var/www and acts as the mounting point for the partition. You can see in Figure 8.1 and Figure 8.2 how the system looks before and after mounting the file system.

Figure 8.1. A Not Yet Mounted File System

A Not Yet Mounted File System

Figure 8.2. File System Is Now Mounted

File System Is Now Mounted

As you can imagine, this offers a number of advantages: the tree structure will always be the same, whether it's on a single file system or extended over several dozen.[18] This flexibility allows you to 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:

  1. The directory which acts as a mount point must exist.

  2. 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 file system. The files have not been deleted, but they will not be accessible until you free the mount point.

Tip

It is actually possible to access the data “hidden” by the newly mounted file system. You simply need to mount the hidden directory with the --bind option. For example, if you just mounted a directory in /hidden/directory/ and want to access its original content in /new/directory, you'll have to run:

    mount --bind /hidden/directory/ /new/directory
   


[18] GNU/Linux can manage up to 64 simultaneously mounted file systems.