1. Principles

Every hard disk may be divided into partitions, and each one contains a file system. While Windows® assigns a letter to each of these file systems (well, 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 for great configuration flexibility. For example if you were to configure a web server, it's fairly common to dedicate an entire partition to the directory which contains the web server's data. The directory which usually contains the data is /var/www and acts as the mounting point for the partition. Also, a big /home partition should be considered if you plan on downloading a large amount of software, store many work or personal documents and photos, music files, etc.. You can see in Figure 8.1, “A Not Yet Mounted File System” and Figure 8.2, “File System Is Now Mounted” 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[21] 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 sub-directories, these will simply be “hidden” by the newly mounted file system. The files will not be deleted, but they will not be accessible until you free the mount point.

[Tip]Tip

It's 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 would have to run:

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


[21] GNU/Linux can manage many simultaneously mounted file systems. At press time, the current Mandrakelinux kernel (2.6.10-3mdk) could handle up to 256 mounted file systems