Unless you are used to Linux (or Linux-like) operating systems, the concept of a mount point will at first seem strange. However, it is one of the most powerful and flexible methods of managing file systems developed. With many other operating systems, a full file specification includes the file name, some means of identifying the specific directory in which the file resides, and a means of identifying the physical device on which the file can be found.
With Red Hat Enterprise Linux, a slightly different approach is used. As with other operating systems, a full file specification includes the file's name and the directory in which it resides. However, there is no explicit device specifier.
The reason for this apparent shortcoming is the mount point. On other operating systems, there is one directory hierarchy for each partition. However, on Linux-like systems, there is only one directory hierarchy system-wide and this single hierarchy can span multiple partitions. The key is the mount point. When a file system is mounted, that file system is made available as a set of subdirectories under the specified mount point.
This apparent shortcoming is actually a strength. It means that seamless expansion of a Linux file system is possible, with every directory capable of acting as a mount point for additional disk space.
As an example, assume a Red Hat Enterprise Linux system contained a directory
foo in its root directory; the full path to the directory would be
/foo/. Next, assume that this system has a partition that is to be mounted, and that the partition's mount point is to be
/foo/. If that partition had a file by the name of
bar.txt in its top-level directory, after the partition was mounted you could access the file with the following full file specification:
In other words, once this partition has been mounted, any file that is read or written anywhere under the
/foo/ directory will be read from or written to that partition.
A commonly-used mount point on many Red Hat Enterprise Linux systems is
/home/ -- that is because the login directories for all user accounts are normally located under
/home/ is used as a mount point, all users' files are written to a dedicated partition and will not fill up the operating system's file system.
Since a mount point is just an ordinary directory, it is possible to write files into a directory that is later used as a mount point. If this happens, what happens to the files that were in the directory originally?
For as long as a partition is mounted on the directory, the files are not accessible (the mounted file system appears in place of the directory's contents). However, the files will not be harmed and can be accessed after the partition is unmounted.