| < Free Open Study > |
|
Perhaps the most immediately obvious idiosyncrasy of any Unix-like system (including Linux systems) is the layout of the filesystem. In Chapter 3, I discussed the Linux Filesystem Hierarchy Standard (FHS). In this section, you'll learn how closely Red Hat Linux follows the FHS. When you've finished this section, you'll be able to find anything on a Red Hat Linux system. If you haven't already done so, it would be useful to review the FHS and my discussion of it in Chapter 3 now. Generally, Red Hat closely follows the FHS. Table 4-4 summarizes the key points of Red Hat Linux's filesystem layout.
DIRECTORY | FHS CONTENTS | RED HAT COMMENTS |
---|---|---|
/etc | Configuration files | Follows FHS; general strategy is to have a separate subdirectory for each component |
/boot | Files required for the system to boot up | Follows FHS |
/dev | Files representing hardware devices on the system | Follows FHS |
/lib | Shared library files required by user programs | Follows FHS |
/bin | User application programs | Follows FHS |
/sbin | Programs used primarily for administrative tasks | Follows FHS |
/home | Home directories for users | Follows FHS |
/mnt | Contains subdirectories where temporary filesystems can be mounted | Follows FHS |
/usr | Files useful to users once the system is running | Generally follows FHS, but occasionally deviates for specific special cases |
/var | Files and directories for storing control information or data for programs and services | Generally follows FHS, but occasionally deviates for specific special cases |
/usr/local | Installation-specific files | Present per FHS, but no contents by default |
/opt | Installation-specific "optional" software | Present per FHS, but no contents by default |
/tmp | Files that are not persistent or important | Follows FHS |
Having a filesystem standard for the base installation of an operating system is all fine and well, but it's pointless if it's ignored during subsequent software installations and system maintenance. That is, it's just as important to keep track of where RPMs place files as it is to keep track of where the base installation places files. Fortunately, the convention for RPMs is to follow the FHS; most RPMs downloadable from the Internet (and all of Red Hat's own RPMs) will place their files in /usr or /, as appropriate.
Another point it is worthwhile to cover is how Red Hat Linux treats the /usr partition. The FHS standard indicates that /usr should contain only "static" files that don't need to change frequently. Any "variable" files should go into another directory, such as /var. If this rule is closely followed, then the /usr directory should never be modified, because any nonstatic files belong in another directory. Thus, if the /usr directory was placed on its own partition, it should be possible to mount this partition as read-only; this helps prevent intrusions and accidental damage. This is a feature supported by many other Unix-like systems and even some other Linux distributions. Previous versions of Red Hat Linux were not quite able to support a read-only /usr out of the box, but Red Hat 7.3 does support this technique.
As you've seen, Red Hat Linux follows the FHS fairly closely, with a few exceptions. As a user of a Red Hat Linux system, you should be aware of the conventions established by the FHS. Whenever you need to find a particular file or figure out how a piece of software is installed, you can follow this rule of thumb: First check in the place where the FHS says it should go, and then check in the place where you would expect to find it on a different Unix system. If all else fails, you can try using the locate command if you know the file name you're looking for.
| < Free Open Study > |
|