-->
Previous | Table of Contents | Next |
The /proc directory is actually a virtual file system. Its used to read process information from memory.
The /tmp directory is used to store temporary files that programs create when running. If you have a program that creates a lot of large temporary files, you may want to mount the /tmp directory as a separate file system rather than just have it as a directory on the root file system. If /tmp is left as a directory on the root file system and has lots of large files written to it, the root file system can fill up.
The /home directory is the base directory for user home directories. Its common to mount this as a separate file system so that users can have plenty of room for their files. In fact, if you have many users on your system, you may need to separate /home into several file systems. To do so, you could create subdirectories such as /home/staff and /home/admin for staff members and administrators, respectively. Mount each of these as different file systems and then create the users home directories under them.
The /var directory holds files that tend to change in size over time. Typically, various system log files are located below this directory. The /var/spool directory and its subdirectories are used to hold data thats of a transitory nature, such as mail and news thats recently received from or queued for transmission to another site.
TIP: You can create other mount points under the / directory if you want. You might want to create a mount point named /cdrom if you routinely mount CD-ROMs on your system.
The /usr directory and its subdirectories are very important to the operation of your Linux system. It contains several directories with some of the most important programs on your system. Typically, subdirectories of /usr contain the large software packages that you install. Table 14.2 discusses some of the /usr subdirectories. The /usr directory is almost always mounted as a separate file system.
Subdirectory | Description |
---|---|
/usr/bin | This directory holds many of the executable programs found on your Linux system. |
/usr/etc | This directory contains many miscellaneous system configuration files. |
/usr/include | Here and in the subdirectories of /usr/include is where you find all the include files for the C compiler. These header files define constants and functions and are critical for C programming. |
/usr/g++-include | This directory contains the include files for the C++ compiler. |
/usr/lib | This directory contains various libraries for programs to use during linking. |
/usr/man | This directory contains the various manual pages for programs on your Linux system. Below /usr/man are several directories that correspond to the different sections of the man pages. |
/usr/src | This directory contains directories that hold the source code for different programs on your system. If you get a package that you want to install, /usr/src/packagename is a good place to put the source before you install it. |
/usr/local | This directory is designed for local customizations to your system. In general, much of your local software is installed in this directorys subdirectories. The format of this directory varies on almost every UNIX system you look at. One way to set it up is to have a /usr/local/bin for binaries, a /usr/local/etc for configuration files, a /usr/local/lib for libraries, and a /usr/local/src for source code. The entire /usr/local directory tree can be mounted as a separate file system if you need a lot of room for it. |
By now, you should have a good feel for what a file system is. So how do you set up a directory as a separate file system?
To mount a file system in the Linux directory tree, you must have a physical disk partition, CD-ROM, or floppy disk that you want to mount. You also must make sure that the directory to which you want to attach the file system, known as the mount point, actually exists.
Mounting a file system doesnt create the mount point directory. The mount point must exist before you try to mount the file system. Suppose that you want to mount the CD-ROM in drive /dev/sr0 under the mount point /mnt. A directory named /mnt must exist, or the mount fails. After you mount the file system under that directory, all the files and subdirectories on the file system appear under the /mnt directory. Otherwise, the /mnt directory is empty.
TIP: Use the command df . if you need to know which file system the current directory is located on. The commands output shows the file system as well as the free space available.
As you may have guessed by now, Linux uses the mount command to mount a file system. The syntax of the mount command is as follows:
mount device mountpoint
Previous | Table of Contents | Next |