1    Planning the File System

The Advanced File System (AdvFS) is the default file system for the HP Tru64 UNIX operating system. This chapter discusses the following topics:

1.1    What is AdvFS?

The AdvFS file system differs from the traditional UNIX File System (UFS). With AdvFS you can modify your system configuration at any time without shutting down the system. Because AdvFS with AdvFS Utilities supports a multivolume file system, you can easily add or remove storage as your system requirements change. In addition, Logical Storage Manager (LSM) volumes and storage area networks (SANs) can be used for AdvFS storage.

In contrast, the UFS model is rigid. Each disk (or disk partition) contains a single file system. The directory hierarchy layer of UFS is bound tightly to the physical storage layer. When a file system becomes full, this tight binding makes it impossible to move selected files onto another disk without changing the full pathnames of those files. The task of dividing a logical directory into directory subtrees and mapping the subtrees onto separate disks requires careful consideration. Even with extensive planning, adjustments to the directory structure are limited with the UFS model.

From a user's perspective, AdvFS looks like any other UNIX file system. End users can use the mkdir command to create new directories, the cd command to change directories, and the ls command to list directory contents. AdvFS logical structures, quota controls, and backup capabilities are based on traditional file system design. AdvFS replaces or eliminates several standard commands, such as newfs, dump, restore and fsck. AdvFS commands and utilities, and a comparison of AdvFS and UFS commands are detailed in Appendix B.

Without taking an AdvFS system off line, system administrators can backup, reconfigure, and tune file systems. End users can retrieve their own unintentionally deleted files from predefined trashcan directories or from AdvFS fileset clones without assistance from system administrators.

1.2    License Registration

AdvFS is the file system default on the operating system. AdvFS Utilities is a separately licensed product that provides additional processing capabilities. Before you can use the file system utilities, you must register a license product authorization key (PAK) for AdvFS Utilities. Contact your software support organization for additional information.

1.3    File System Design

The AdvFS file system consists of two distinct layers: the directory hierarchy layer and the physical storage layer. The directory hierarchy layer implements the file-naming scheme and POSIX-compliant functions such as creating and opening files, or reading and writing files. The physical storage layer implements write-ahead logging, caching, file allocation, and physical disk I/O functions.

This decoupled file system structure enables you to manage the physical storage layer apart from the directory hierarchy layer. You can move files between a defined group of disk volumes without changing pathnames for your files. Because the pathnames remain the same, the action on the physical level is completely transparent to end users.

AdvFS is the file system for the cluster configuration. Cluster operation is likewise transparent. AdvFS running on a cluster, with very few exceptions, looks no different from AdvFS running on a single node.

AdvFS implements two unique file system concepts: filesets and domains. Filesets and domains enable the two-layer file system structure. Figure 1-1 is a representation of this structure.

Figure 1-1:  AdvFS File System Design

For the types of storage that AdvFS can use, see Section 1.5.

1.3.1    Filesets, Domains, and Volumes

A fileset follows the logical structure of a traditional UNIX file system. It is a hierarchy of directory names and file names, and it is what you mount on your system. AdvFS goes beyond the traditional file system by allowing you to create multiple filesets that share a common pool of storage called a domain. See Section 1.4.1 for information about configuring an AdvFS file system and Section 2.4 for information about fileset operation.

A domain represents the physical storage layer. It is managed separately from the directory structure. You can add or remove volumes without affecting the directory structure. See Section 2.3 for information about domain management.

A volume is any mechanism that behaves like a UNIX block device. (See Section 1.4.2.) When first created, all domains consist of a single volume. If you have the optional AdvFS Utilities, you can transform a single-volume domain into a multivolume domain by adding one or more volumes to it.

1.3.2    Transaction Log File

The AdvFS file system is a log-based file system that employs write-ahead logging to ensure the integrity of the file system. Modifications to the metadata (file system structures) are completely written to a transaction log file before the actual changes are written to disk. The contents of the transaction log file are written to disk at regular intervals.

When you create a domain, AdvFS creates a transaction log file for it. During crash recovery, AdvFS reads the transaction log file to confirm file system transactions. All completed transactions are committed to disk and uncompleted transactions are undone. The number of uncommitted records in the log, not the amount of data in the file system, dictates the speed of recovery. Recovery usually takes only a few seconds. Traditional UNIX file systems rely on the fsck utility to recover from a system failure. The fsck utility can take hours to check and repair a large file system.

By default, only file system structures are logged, but you can choose to log file data and change the way your system writes to storage. (See Section 5.5.) A file that has data logging turned on remains internally consistent in the event of a system crash. However, enabling data logging can slow system performance.

1.3.3    File Storage Allocation

Files are not static; their space requirements change over time. To maintain contiguous file placement without overallocating space on the disk, AdvFS uses a unique file storage allocation scheme.

Key features of file storage allocation are as follows:

1.4    Setting Up an AdvFS File System

When planning your configuration, consider setting up the root (/), /usr and /var file systems on AdvFS. By using AdvFS for root and /usr, you increase configuration flexibility and significantly reduce system down time in the event of a system failure.

You can set up AdvFS to resemble a traditional UFS configuration with one partition (volume) per domain and one fileset in each domain. If you have the optional AdvFS Utilities, when you need space, you can add volumes (except to the local root file system, which is restricted to one volume) to increase the size of the domain without changing anything in the existing configuration.

1.4.1    Configuring Domains and Filesets

You can create one domain that contains numerous filesets or you can create a domain for each fileset; you can also structure your system anywhere between these two extremes. If you have AdvFS Utilities, you can distribute your domains on more than one volume.

If you have enough drives, use an entire disk for a domain. Add one partition (typically, partition c) to a domain rather than several partitions on one disk (such as a, b, g, h).

Do not place partitions in different domains, for example, partition a in one domain and partition b in another domain.

Assuming the disks are the same type and speed, it is generally more efficient to spread your domain over several disks. For example, a domain with three volumes on separate disks is more efficient than one with three partitions on a single disk because the latter has only one I/O path.

Establishing multiple domains allows greater control over your physical resources. You can create domains for use by specific projects, groups of users, departments, or any division that makes sense for your organization. For example, you can create domains for each of your organization's departments, such as engineering, finance, and personnel.

A data management applications programming interface (DMAPI)-enabled domain (Appendix D) can have only one fileset.

Table 1-1 illustrates the advantages and disadvantages of choosing different configurations.

Table 1-1:  Domain and Fileset Configuration Tradeoffs

Configuration Advantage Disadvantage
Entire disk used for a domain, not small partitions on several physical devices Efficiency; device's I/O stream is not shared Waste of space if small domains are on large volumes
Domain configured on multiple volumes (requires Advanced Utilities) rather than on a single volume Distributes I/O load; increases throughput Failure of a single volume makes the domain inaccessible
Many smaller domains instead of one large domain (assuming the number of volumes stays the same) Faster recovery; improved throughput; might decrease some administrative tasks Might increase administrative overhead
Many filesets in a domain instead of one large one Can set quota limits on each fileset for finer-grained control of resources Administrative overhead; all filesets must be mounted to run some utilities
Transaction log on fast or uncongested volume Prevents log from becoming I/O bottleneck Cost of hardware
Root fileset configured as AdvFS Fast recovery after system crash None

You can examine your file system in the following ways:

Chapter 5 details ways to optimize a file system. The System Configuration and Tuning guide provides detailed guidelines for planning and configuring your file system. See Appendix E if you want to configure your domains using a graphical user interface.

1.4.2    Organizing Volumes

A volume is the entity that is a block special device (such as a single disk partition, an entire disk, an aggregate volume provided by LSM, hardware RAID, or a SAN). Each volume can be assigned to only one domain. It is associated with its domain by a domain ID, which is automatically stored in the in the AdvFS metadata on the volume. If you have the optional AdvFS Utilities, you can add more than one volume to a domain.

Each volume in an AdvFS domain contains a bitfile metadata table (BMT), which stores file structure information (metadata), and a storage bitmap, which tracks free and allocated disk space. In addition, one volume of each domain contains a transaction log file, which stores all metadata changes until the changes are written to disk.

The following table describes the tradeoffs for how you configure domains on AdvFS volumes.

Table 1-2:  AdvFS Volume Configuration Tradeoffs

Configuration Advantage Disadvantage
Volume is a disk partition Uses small portion of disk Limited size; I/O contention with other partitions
Volume is a single disk More efficient than using single partitions Limited size
Volume is a RAID volume (LSM or hardware) or SAN Improve performance and reliability; increased capacity Cost: requires LSM license or additional hardware

1.5    Choosing Storage for AdvFS

When you create a domain, AdvFS recognizes storage through the block special device name that is associated with the domain. Storage can include directly connected disks, software RAID volumes, hardware RAID, and storage area networks.

By using LSM, hardware RAID and SAN volumes, you can take advantage of their features that allow for advanced backup strategies and dynamic volume expansion. For more information on LSM see the Logical Storage Manager manual. For information on hardware RAID and SAN products see http://www.tru64unix.compaq.com/storage/index.html.