Jump to content United States-English
HP.com Home Products and Services Support and Drivers Solutions How to Buy
» Contact HP
More options
HP.com home
HP-UX System Administrator's Guide: Overview: HP-UX 11i Version 3 > Chapter 3 Major Components of HP-UX

The HP-UX Directory Structure

» 

Technical documentation

Complete book in PDF
» Feedback
Content starts here

 » Table of Contents

 » Glossary

 » Index

HP-UX 11i, like all versions of UNIX and many other operating systems, is based on a hierarchical directory structure that contains all of the operating system directories and files, as well as all user and application files.

The directory structure can be contained entirely within a single file system, but it is usually comprised of multiple file systems that attach to the root file system at special directories known as mount points.

The top of the tree is known as the root directory and is represented by the directory path/”.

All other directories and files reside under the root directory. Each layer of the directory tree is represented in directory path names (pathnames) by adding its name to the end of the path, with each layer separated by a slash character (“/”). See the following examples:

Example 3-1 Directory Path Name Nomenclature

/

The root directory

/usr

The usr directory within the root directory

/home/guest27

The guest27 account within the home directory within the root directory

/usr/share/man/man1.Z/cat.1

cat.1 is a file within the man1.Z directory, within the man directory, within the share directory, within the usr directory, within the root directory (/). It just happens to be the source file for the cat(1) manpage.

Figure 3-1 Directory Tree Example

Directory Tree Example

Key HP-UX Directories

This section describes many of the key directories in the HP-UX directory structure and what they are used for.

/dev

Contains device special files. Though they appear in the directory tree like regular disk files, device special files are associated with physical devices or pseudodevices. They are portals to the devices and device drivers they are associated with.

Device special files are written to or read from by software applications or operating system components to access data on the devices, get status of the devices, or to control those devices in some other way.

There are two classes of device special files (based on how they are used to transfer data):

  • block special files (transfer data in blocks by means of the system’s normal buffering mechanism, and are primarily used to mount file systems)

  • character special files (transfer data in an unbuffered stream, and are used for nearly everything else)

In HP-UX 11i version 3 there are also three types of device special files (based on how they refer to their associated devices):

  • legacy device special files reference their corresponding devices by the hardware paths to those devices. Legacy device special files are the type of device special files that have always been part of HP-UX. They are still supported in HP-UX 11i version 3 and function as they always have.

  • persistent device special files reference their corresponding devices based on a world-wide unique identifier that is built into, or associated with, the device. Because persistent device special files are not dependent on specific hardware paths, they allow for multiple hardware paths to be represented by a single device special file. This opens up many new HP-UX features in the areas of I/O performance, reliability, and flexibility.

  • Device special files for pseudodevices. The majority of device special files are not directly associated with actual hardware devices but are instead used to access pseudodevices that allow HP-UX to introduce a virtualization layer between processes and disk storage (like those for LVM or VxVM), simulate hardware devices like terminals (ptys), or provide useful abstractions like /dev/null (a device file often referred to as the "bit bucket", used to receive and discard output that is not needed) There are many pseudo-devices in HP-UX, used for a variety of purposes. Most of these are described in the manpages of Section 7 of the HP-UX Reference Manual.

/etc

The /etc directory stores system-wide configuration files including files required for:

  • customizing boot and shutdown activities

  • networking configuration

  • configuring which file systems to mount

  • defining users and groups

  • defining logical volumes

The previous list is only partial. For compatibility reasons, /etc also contains a number of symbolic links to commands in other directories (commands that once resided in the /etc directory).

/etc/opt/product

Some optional products, when added to a server, create subdirectories under the directory /etc/opt to store product specific configuration information.

/home

The /home directory is the default location for the home directories for user accounts. For example: If a user “Thomas” with user name thomas is added to an HP-UX server (and if the home directory location is left at its default), the home (login) directory for Thomas will be /home/thomas.

/opt

The /opt directory contains application software and other system components of the HP-UX 11i operating system that are not considered to be part of the minimum-level installation needed for a viable system.

/sbin

Contains statically linked versions of critical programs needed at boot time or when important shared libraries have become corrupted. /sbin is available when the system is not in multiuser mode and before the /usr file system has been mounted.

/stand

The /stand directory is part of the root file system (the very first file system that is mounted during the system startup sequence). /stand is a special directory that is used by the boot loader to read the kernel file from disk and start it running.

/tmp

The /tmp directory is a temporary scratch directory, particularly used before the file system mounted at /var is available during system startup.

Some installations delete the contents of /tmp at every boot; others choose to manually maintain /tmp. Either way, do not store files in /tmp for long periods of time that would be detrimental to lose. See also /var/tmp.

/usr

Contains many HP-UX resources that are typically not needed to boot the system.

The files in the / and /usr directories are intended to be for read-only use so that these directories can, if necessary, be mounted from a network resource in read-only mode. When HP-UX components and applications need to update files, such as log files, those files should be placed in a writable file system such as /var.

/usr/bin

Contains dynamically linked non-essential commands and programs used by most users once the system is in multiuser mode. The commands and programs in /usr/bin are not needed in order to boot the system. These commands are available only when the file system that contains them is mounted.

/usr/lib

Contains shared libraries used by the binaries in /usr/bin.

/usr/sbin

Contains dynamically linked non-essential commands used to administer the system once it is in multiuser mode. These commands are available only when the file system that contains them is mounted.

/var

var” stands for variable. This directory (usually associated with a mountable file system) contains variable data; that is, files that need to change as the system is running (for example, log files that need to be written to).

/var/opt/product

Some optional products, when added to a server, create subdirectories under the directory /var/opt to store product specific information.

/var/tmp

The /var/tmp directory is a temporary scratch directory, preferred over the /tmp directory after the system has been booted (primarily because /var is the intended location for transient data and temporary data is by definition transient).

As with the /tmp directory, /var/tmp should only be used for temporary files (files that are not intended to be stored for long periods of time and files that are not essential). Unlike /tmp, /var/tmp files are not usually removed during system startup, but when (or whether) files in either of the tmp directories are removed is configurable and installation specific.

Printable version
Privacy statement Using this site means you accept its terms Feedback to webmaster
© 2008 Hewlett-Packard Development Company, L.P.