1    Configuring the File System

The Advanced File System (AdvFS) is the default file system for the Compaq Tru64 UNIX operating system. This chapter introduces the file system and explains how to configure and AdvFS root file system:

1.1    What is AdvFS?

The AdvFS file system differs from the traditional UNIX File System (UFS). The UFS model is rigid. Each disk (or disk partition) contains one separate file system; you mount the file system into the logical name space using mount points.

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.

In contrast, with AdvFS you can modify your system configuration at any time without shutting down the system. As your system requirements change, AdvFS allows you to easily add or remove storage to meet your requirements.

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.

AdvFS supports multivolume file systems, which enables file-level striping (spreading data to more than one volume) to improve file transfer rates for applications that require intensive I/O. Logical Storage Manager (LSM), which allows volume-level striping, can be incorporated into AdvFS configurations.

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 to files. The physical storage layer implements write-ahead logging, caching, file allocation, and physical disk I/O functions.

The decoupled file system structure enables you to manage the physical storage layer apart from the directory hierarchy layer. This means that 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 is completely transparent to end users.

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

AdvFS can incorporate Logical Storage Manager (LSM) volumes into the file system structure. When AdvFS is configured with LSM, file system reliability and availability improve because AdvFS can take advantage of LSM features (see Section 1.10).

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.7 for more information about filesets.

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 1.6 for more information about domains.

A volume is any mechanism that behaves like a UNIX block device: an entire disk, a disk partition, or an aggregate volume provided by a logical storage manager (see Section 1.5). When first created, all domains consist of a single volume. If you have the optional AdvFS Utilities (see Section 1.2), you can transform a single-volume domain into a multivolume domain by adding one or more volumes.

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. This means that 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 4.4). 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:

1.4    Setting Up an AdvFS File System

When planning your configuration, consider setting up the / (root) and /usr 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 which is restricted to one volume) to increase the size of the domain without changing anything in the existing configuration.

An active AdvFS file system requires one domain and one mounted fileset.

To create an active domain:

  1. Create a domain and assign a volume to it (see Section 1.6.5).

  2. Create a fileset (see Section 1.7.4).

  3. Create a mount-point directory (see Section 1.7.6).

  4. Mount a fileset (see Section 1.7.6).

You can create one fileset per domain or you can create many. See Section 1.6.1 and Section 1.7.1 for guidelines.

AdvFS is fully supported in the /etc/fstab file to automatically mount a fileset at system boot (see Section 1.7.2). Alternately, you can use a graphical interface or the SysMan Menu to perform this activity.

See Appendix B for a complete list of AdvFS commands. For more detailed information on AdvFS configuration, see System Configuration and Tuning.

1.5    Volumes

An AdvFS volume can be a raw disk partition, an entire disk, an aggregate volume provided by LSM, or a hardware or software redundant array of independent disks (RAID) storage.

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

A volume can be assigned to only one domain. It is associated with its domain by a domain ID, which is automatically stored in the domain-attributes record on the volume.

If you have the optional AdvFS Utilities, you can add volumes to create a multivolume domain. Multivolume domains increase the storage available for the filesets and allow for preventative disk maintenance. You can add volumes immediately after creating the domain, even before creating and mounting filesets. To perform preventative disk maintenance, you can add a new volume to the domain, migrate your files to the new volume, and then remove the old volume.

For AdvFS to function properly, the number of volumes in a domain with the same domain ID must remain consistent with the number of volumes stored in the domain-attributes record. In addition, each domain is defined by an entry in the /etc/fdmns directory (see Section 1.6.2). This directory must be up to date; that is, the domain entries must correctly reference the volumes associated with the domains. The number of links to the volumes in the /etc/fdmns directory must equal the number of volumes.

To reuse a volume see Section 5.8.1.

1.5.1    Volume Attributes

You can configure AdvFS volumes with attributes that determine how data is read, cached, written, and consolidated. When an AdvFS volume is incorporated into a domain, either by creating the initial domain or by adding a volume, the default volume attributes are set. Modifying these default attributes might improve performance in some system configurations.

You can run the chvol command Manage AdvFS Domains at any time to change the attributes of a volume in an active domain; the system does not have to be quiescent.

To display or modify the current volume attributes, use the SysMan Manage an AdvFS Domain utility, or enter the chvol command from the command line:

chvol device_name file_domain

See Chapter 4 and System Configuration and Tuning for more complete information on modifying attributes to improve system performance.

1.6    Domains

A domain is the physical storage layer of the AdvFS file system. It is a defined pool of physical storage that can contain one or more volumes. Because this storage is managed separately from the directory structure (see Section 1.6.2), you can expand and contract the size of the domain by adding or removing volumes. You can move files between volumes in the domain without changing file pathnames. Changing the name of the domain does not affect the domain ID.

The domain name is defined by a directory entry in the /etc/fdmns directory. This entry contains the links to the volumes that comprise the domain.

Domain names must be unique. You cannot use slash (/), number (#), colon (:), asterisk (*), question mark (?), tab, newline, form feed, return, vertical tab, and space characters in a domain name.

1.6.1    Configuring Domains

How you configure domains depends on your organization's needs. You can assign all available storage to a few domains or you can group specific partitions or disks into many domains. You must also take into account how you configure your filesets (see Section 1.7.1). With AdvFS Utilities, you can assign multiple volumes to a domain and distribute the filesets and files across the volumes.

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 could create domains for each of your organization's departments, such as engineering, finance, and personnel.

There are a number of factors to consider when configuring domains:

The System Configuration and Tuning guide provides detailed guidelines for planning and configuring your file system. System Limits lists the limits for the AdvFS file system. The SysMan Manage an AdvFS Domain utility allows you to create and configure domains. See Appendix D to configure your domains using a graphical user interface.

1.6.2    The /etc/fdmns Directory

The /etc/fdmns directory defines domains by providing a subdirectory for each domain you create. The subdirectories contain a symbolic link to every volume in the domain.

AdvFS automatically creates and maintains this directory when you use standard AdvFS commands. You must have a current /etc/fdmns directory in order to mount the filesets in a domain.

When you create a domain, a soft link is created from the domain entry in the /etc/fdmns directory to the block device. You cannot create a domain by creating a link in the directory.

Back up the /etc/fdmns directory regularly. If the contents of the directory become corrupt or if the directory is deleted, restore the directory from your most recent backup. A damaged directory prevents access to the domain because the information matching the domain to the physical volume containing the filesets is incorrect; the filesets are not affected.

If you attempt to mount a fileset from a domain with a damaged directory, a message similar to the following for the domain accounts is displayed:

Volume count mismatch for domain accounts.
accounts expects 2 volumes, /etc/fdmns/accounts has 1 links.

If the /etc/fdmns directory is damaged or if the volumes of a domain are moved to a different system, use the advscan utility to locate the volumes and reconstruct the directory (see Section 5.9).

1.6.3    Version 5.0 Domains

Domains in Version 5.0 and later of the operating system have an improved disk structure that provides support for quota values larger than 2 terabytes and increases performance for directories containing thousands of files. You do not need to adjust bitfile metadata table (BMT) allocations. All domains that were created in operating systems prior to Version 5.0 are recognized by later versions but are not automatically upgraded to the new structure.

A domain version number (DVN) is associated with a domain. The Version 5.0 operating system is the first for which a new domain carries a DVN of 4. Domains created earlier carry a DVN of 3.

You can mount a DVN3 fileset on a system running Version 5.0 or later. You cannot locally mount a fileset in a DVN4 domain created under Version 5.0 or later on a system running a Version 4 operating system. If you need to access a DVN4 fileset while running an earlier version of the operating system, NFS mount it from a server running Version 5 or later software (see Section 5.4). Therefore, if your application requires backward compatibility, you should not upgrade your domain to the new DVN.

See Section 5.4.1 for a discussion of utility incompatibility.

1.6.3.1    Creating a Domain with DVN4

All domains created on Version 5.0 and higher operating systems have a DVN of 4. Therefore, if you do a full installation, all the domains created in the process have the new structure.

If you perform an update installation from a system running a Version 4 operating system, all existing domains retain the DVN of 3. This means that /root, /usr, and /var also have a DVN of 3. There is no conversion utility. To move your data to a DVN4 domain, back up your data, create a new DVN4 domain, and restore it to the new domain.

1.6.3.2    Upgrading a Domain to DVN4

If you are running an application that requires quota limits larger than 2 terabytes or that uses directories containing thousands of files, you can improve performance by upgrading your old domain to a DVN4 domain. DVN4 domains automatically have an index created when the directory grows beyond a page, that is, about 200 files. Use the showfile command to determine if a directory is indexed. Use the -i option to display information about the index. See showfile(8) for more information.

To upgrade a domain, create a new domain on a system running Version 5.0 or later software and copy all the information from the old domain to it. If you are unfamiliar with creating domains, read Section 1.6.5 first. To upgrade a domain:

  1. Back up the filesets in the domain to tape by using the vdump command. It is a good idea to use the -x option for additional protection from saveset errors. You lose all the data in your domain if you cannot restore it after creating a new domain.

  2. Remove the old domain by using the rmfdmn command.

  3. Create a new domain by using the mkfdmn command. The new domain has a DVN of 4. You do not need to use the -x and -p options for the mkfdmn command. DVN4 domains do not require additional of BMT allocations.

  4. Create the new filesets by using the mkfset command.

  5. Restore the filesets in the new domain by using the vrestore command.

For example, to upgrade the domain domain_p on /dev/disk/dsk1c containing filesets fset_p and fset_m and put them back on the same volume with the same names, enter the following commands:

# vdump -0 -N -x 8 /fset_p
# vdump -0 -N -x 8 /fset_m
# umount /fset_p
# umount /fset_m
# rmfdmn domain_p
# mkfdmn /dev/disk/dsk1c domain_p
# mkfset domain_p fset_p
# mkfset domain_p fset_m
# mount domain_p#fset_p /fset_p
# mount domain_p#fset_m /fset_m
# vrestore -x -D /fset_p
# mt fsf 1
# vrestore -x -D /fset_m

You can create DVN3 domains on a Version 5 system. They are recognized by earlier versions of the operating system. See mkfdmn(8) for more information.

1.6.4    Displaying Domain Information

If a domain is active (at least one fileset is mounted), you can display detailed information about the domain and the volumes included in it by using the showfdmn command:

showfdmn domain_name

For example, to display domain information for the domain_1 domain:

# showfdmn domain_1 
      Id           Date Created      LogPgs Version Domain Name
2bb0c594.00008570 Fri Mar 24 12:33 2000 512       4 domain_1
Vol  512-Blks  Free % Used Cmode Rblks Wblks Vol Name
 
  1L     8325 79210    90%    on   128   128 /dev/disk/dsk1c
  2    832527  1684    98%    on   128   128 /dev/disk/dsk2c
      -------------------------
       1665054 80894   94% 

1.6.5    Creating a Domain

The first step in setting up an AdvFS file system is creating a domain and assigning an initial volume to it. However, a domain is not a complete file system that you can mount. In order to mount an AdvFS file system, the domain must contain one or more filesets. You can access files as soon as you mount one or more filesets (see Section 1.7).

Figure 1-2:  Single-Volume Domain

Creating a single-volume domain with a single fileset is equivalent to creating a traditional UFS file system. To set up an active, single-volume file system, as illustrated in Figure 1-2, use the SysMan Create a New AdvFS Domain utility, a graphical user interface (see Appendix D), or enter the mkfdmn command from the command line:

mkfdmn volume_name domain_name

To create an active single-volume DVN4 domain:

  1. Create a single-volume domain associated with a volume by using the mkfdmn command.

  2. Create one or more filesets by using the mkfset command.

  3. Create the mount-point directory by using the mkdir command. It is convention to name the directory the same as the fileset. For example, if the fileset is tmp, name the mount-point directory /tmp.

  4. Mount each fileset by using the mount command.

For information about creating a DVN3 domain, see mkfdmn(8).

Caution

Do not use the mkfdmn command on a volume containing data that you want to keep. Doing so destroys the data. If you have accidentally used the mkfdmn command, you might recover some of your data by using the salvage utility if the volume is an AdvFS volume (see Section 5.8.4).

The following example creates a single-volume DVN4 domain, domain_2, and two filesets, fset_a and fset_b, in the domain. Because the domain has only one volume, the files in both filesets physically reside on one volume. This is allowed in AdvFS. The number sign (#) between the domain and fileset names is part of the naming syntax and does not represent a comment.

# mkfdmn /dev/disk/dsk2c domain_2 
# mkfset domain_2 fset_a
# mkfset domain_2 fset_b
# mkdir /fset_a 
# mkdir /fset_b 
# mount domain_2#fset_a /fset_a
# mount domain_2#fset_b /fset_b

You can set up a domain with an LSM storage by specifying an LSM volume. See Section 1.10 for information about using AdvFS with LSM. If you have AdvFS Utilities, you can change the size of your domain by adding more volumes. You can transform a single-volume domain (except the root domain) into a multivolume domain (see the Sysman Manage an AdvFS Domain utility, Section 1.6.6 and Appendix D).

If you try to create a domain on a volume that is marked on the disk as in use in the disk label, the mkfdmn command fails if the volume is mounted or if it is a current swap partition. If the volume is unmounted, you get an warning message. You can override the message and create the domain. For example, if /dev/disk/dsk3g is in use and you try to create the domain usr_domain, the following message is displayed:

# mkfdmn /dev/disk/dsk3g usr_domain
Warning: /dev/rdisk/dsk3g is marked in use for 4.2BSD.
If you continue with the operation you can 
possibly destroy existing data.
CONTINUE? [y/n] <y>

1.6.6    Increasing the Size of a Domain

You can expand a domain by replacing one of the volumes in the domain with a larger storage device or, if you have AdvFS Utilities, by adding another volume to the domain. Figure 1-3 shows a graphic illustration of adding volumes to a domain. Neither adding nor removing volumes affects the directory hierarchy layer; all pathnames for the files remain the same. Also, the file system can remain active during the disk exchange.

Figure 1-3:  Enlarging a Domain

There might be performance benefits if, instead of increasing the size of a DVN3 domain, you upgrade to the new file structure (see Section 1.6.3) and then increase its size.

Caution

If your domain is located on an LSM volume, do not use the LSM grow option to increase its size.

A newly created domain consists of one volume, which can be a disk, disk partition, or logical volume. To add volumes, use the SysMan Manage an AdvFS Domain utility, a graphical user interface (see Appendix D), or enter the addvol command from the command line:

addvol device_name domain_name

For example, to add volume dsk3c to the domain resources:

# addvol /dev/disk/dsk3c resources

You can add volumes immediately after creating a domain, or you can wait until the domain requires additional space. You can add a volume to an active domain while its filesets are mounted and in use.

You cannot add a volume to the root domain unless you are running a cluster (see Cluster Administration). If you are running a cluster configuration, you add another root volume the same way that you add any volume. If you are not running a cluster and need to increase the size of the root domain, follow the procedure for recovering from a failure of the root domain (see Section 5.11) and attach a larger volume.

Caution

Do not use the addvol command to add a volume containing data that you want to keep. Doing so destroys the data. If you have accidentally used the addvol command, you might recover some of your data by using the salvage utility (see Section 5.8.4).

If you do not have AdvFS Utilities and want to increase the size of your domain:

  1. Make a new domain on the new larger device. Do not use the same name for the domain.

  2. Create filesets with the same name as the old filesets.

  3. Create a temporary mount-point directory for each fileset.

  4. Mount each new fileset on its temporary mount point.

  5. Use a utility (for example vdump/vrestore, cpio, cp -R, or tar) to copy each fileset from the old device to the newly mounted fileset.

  6. Unmount the old and new filesets.

  7. Rename the new domain to the old name if you want. If you do not change the domain and fileset names, you do not need to to edit the /etc/fstab file. If you do change the names, change them in the /etc/fstab file.

  8. Mount each new fileset using the mount point of the old fileset. The directory tree is then unchanged. Delete all temporary mount-point directories.

To increase the size of a domain if you have AdvFS Utilities:

  1. Optionally, use the showfdmn command to display the contents of the domain and the current disk capacity of each volume.

  2. Add the new volume to the domain.

  3. Remove the old volume if you do not want it.

  4. Optionally, run the balance utility to even the file distribution between the volumes.

The following example replaces one disk, the volume /dev/disk/dsk2c, of the domain_1 domain with a larger disk, the volume /dev/disk/dsk3c:

# showfdmn domain_1
    Id              Date Created     LogPgs Version Domain Name
2bb0c594.00008570 Fri Mar 24 12:33 2000 512       4 domain_1
 
Vol  512-Blks  Free % Used Cmode Rblks Wblks Vol Name
  1L   832527 79210    90%    on   128   128 /dev/disk/dsk1c
  2    832527  1684    98%    on   128   128 /dev/disk/dsk2c
     -------------------------
      1665054 80894    94% 
# addvol /dev/disk/dsk3c domain_1
# rmvol /dev/disk/dsk2c domain_1
# balance domain_1 

AdvFS does not add a volume that causes partitions to overlap with a volume that is mounted for another file system, a swap area, or a reserved partition. To add an overlapping partition, unmount all filesets and use the addvol -F command.

Caution

Disabling the overlap check can result in extensive data loss and should be used with extreme caution (see addvol(8)).

1.6.7    Reducing the Size of a Domain

When there is sufficient free space on the remaining volumes, you can remove volumes from a domain without interrupting users or affecting the logical structure of the filesets in the domain. The file system automatically migrates the contents of the selected volume to other volumes in the domain. Before you can remove a volume from a domain, all filesets in the domain must be mounted. You get an error if you try to remove a volume from a domain with unmounted filesets.

If there is not enough free space on other volumes in the domain to accept the files that are offloaded from the departing volume, as many files as possible are moved to available free space on other volumes. Then, a message is sent indicating that there is insufficient space. The domain is not damaged.

Caution

If your domain is located on an LSM volume, do not use the LSM shrink option to reduce its size.

To remove a volume, use the SysMan Manage an AdvFS Domain utility, a graphical user interface (see Appendix D), or enter the rmvol command from the command line:

rmvol device_name domain_name

For example, to remove dsk3c from the domain inventory:

# rmvol /dev/disk/dsk3c inventory

You can interrupt the rmvol process (see rmvol(8)) with Ctrl/c or by using the kill -term command without damaging your domain. Files already removed remain in their new location. Do not use the kill -KILL command.

Under some circumstances interrupting an rmvol command by using the kill command can leave the volume in an inaccessible state; that is, it cannot be written to. Volumes in this condition are marked as "data unavailable" in the output of the showfdmn command. If a volume does not allow writes after an aborted rmvol operation, use the chvol -A command to reactivate the volume.

To reduce the size of a domain:

  1. Use the showfdmn command to display the contents of the domain and the current disk capacity of each volume. This step is optional.

  2. Remove the volume.

  3. Run the balance utility to even the file distribution between the remaining volumes. This step is not required.

You cannot remove a volume from a domain that you are balancing or defragmenting.

The following example illustrates how to remove one disk of the domain_2 domain, /dev/disk/dsk2c:

# showfdmn domain_2 
  Id              Date Created     LogPgs Version Domain Name
2bb0c594.00008570 Fri Jun 9 10:23 2000 512      4 domain_2
 Vol 512-Blks   Free % Used Cmode Rblks Wblks  Vol Name
 
 1L   832527  386984    54%    on   128   128 /dev/disk/dsk1c
 2    832527  647681    22%    on   128   128 /dev/disk/dsk2c
 3    832527  568894    32%    on   128   128 /dev/disk/dsk3c
      ---------------------- 	
      249758 1603559    36%
# rmvol /dev/disk/dsk2c domain_2
# balance domain_2 

If you remove an AdvFS volume that contains a stripe segment, the rmvol utility moves the segment to another volume that does not already contain a stripe segment of the same file. When a file is striped across all volumes in the domain, a confirmation is required before removing the volume. If you allow the removal process to continue, more than one stripe segment is placed on the remaining volumes. See Section 4.13 for details on file striping.

1.6.8    Removing a Domain

You can remove a domain after all filesets in the domain are unmounted. When you remove a domain, the entry in the /etc/fdmns directory that defined the domain is removed and you cannot mount the filesets. Volumes that were assigned to the removed domains are relabeled as unused and can be reused.

Removing the domain to inactivate filesets instead of using the rmfset command to remove each fileset might present a security hole because no data on the volumes is changed. You might be able to access your data by using the salvage command (see Section 5.8.4).

To remove a domain, use a graphical user interface (see Appendix D), or unmount all filesets and fileset clones from the command line. Then, enter the rmfdmn command:

rmfdmn domain_name

For example, to remove the domain promotions:

# rmfdmn promotions 
rmfdmn: remove domain promotions? [y/n]y
rmfdmn: domain promotions removed 

If you use this command when there are mounted filesets, the system displays an error message. AdvFS does not remove an active domain.

1.6.9    Renaming a Domain

You can assign a new name to an existing domain without altering its domain ID. When you rename a domain, entries for all filesets in the domain must be updated in the /etc/fstab file (see Section 1.7.2). To rename a domain, use a graphical user interface (see Appendix D) or, from the command line:

  1. Unmount all the filesets and any related clones.

  2. In the /etc/fdmns directory, change the old domain name to the new one:

    #mv /etc/fdmns/old_dom_name /etc/fdmns/new_dom_name
    

  3. Edit the /etc/fstab file to enter the new domain name and remove the old.

  4. Mount the filesets in the renamed domain.

For example, to rename the domain marketing to advertising, assuming one fileset, fset, is mounted at /fset using the vi editor:

# umount /fset 
# mv /etc/fdmns/marketing /etc/fdmns/advertising 
# vi /etc/fstab 

Locate the following in the /etc/fstab file:

marketing#fset /fset advfs rw,userquota,groupquota 0 2

Edit this line as follows:

advertising#fset /fset advfs rw,userquota,groupquota 0 2

Mount the fileset:

# mount /fset

1.7    Filesets

A fileset represents a mountable portion of the directory hierarchy of a file system. Filesets and traditional UNIX file systems are equivalent in many ways. You mount AdvFS filesets. Filesets contain files, are units on which you enable quotas, and are units for backing up data.

In contrast with traditional file systems, the directory hierarchy of AdvFS is independent of the storage. Therefore, you can change file placement without affecting the logical structure of the filesets.

Fileset names can be associated with their domain names, as in domain#fileset. Here the number sign (#) is part of the naming syntax and does not represent a comment.

Fileset names must be unique within a domain. Each fileset has a unique fileset ID composed of the domain ID and a fileset tag. Each domain has its own series of fileset tags.

AdvFS also supports fileset clones. An AdvFS fileset clone is a read-only copy of an existing fileset created to capture data at one instant in time.

Fileset names must be unique. You cannot use slash (/), number (#), colon (:), asterisk (*), question mark (?), tab, newline, form feed, return, vertical tab, and space characters. Filesets that are not in the same domain can have the same name.

1.7.1    Configuring Filesets

The filesets in a domain share the available space on the volumes in the domain and use the same domain transaction log file. Each fileset has its own directory structure, root tag directory, quota files, and frag file. The optimal number of AdvFS filesets in a domain depends primarily on the requirements of the applications that use the filesets.

It is generally a good idea to have multiple filesets rather than one large fileset. Whether you place these filesets in a number of domains rather than in one large domain depends on your application. If a fileset has critical access requirements, place it in its own domain. For applications that perform many file create and remove operations, configure multiple domains, each on its own volume. This reduces contention related to I/O.

Create multiple smaller filesets rather than a few large filesets if you do not want to share space between filesets. You can then set fileset quotas to limit resource use for each fileset.

Create filesets containing files having similar requirements in the same domain. For example, do not place small temporary mail news server files in the same domain as the database.

Because filesets are managed independently of their physical storage, each fileset can be backed up independently (see Chapter 2) and can be assigned its own quota limits (see Chapter 2). Multiple small filesets can be backed up and restored more quickly than a single large fileset. You can run the vdump or vrestore commands on several filesets simultaneously.

You can group files in filesets by their management requirements. For example, you can create a fileset for developers' files that is backed up twice a day and you can create another fileset with quotas imposed to limit the amount of disk space available to the marketing department.

All filesets share the transaction log file in a domain, so filesets with a large amount of I/O can cause the transaction log file to become a bottleneck (see Section 1.3.2). Balance the management gains of having multiple filesets in a domain against the potential performance reduction you might incur by having all of the log data for all filesets going to one transaction log file (see Section 4.3).

You can create and mount filesets until the system runs out of system resources (such as memory or disk space). System Limits contains information about this and other system limits.

System Configuration and Tuning provides detailed guidelines and suggestions for file system configuration. The SysMan Manage an AdvFS Domain utility allows you to create and configure filesets. You can use a graphical user interface to accomplish many configuration operations (see Appendix D).

1.7.2    Designating Filesets in the /etc/fstab File

Add AdvFS filesets to the /etc/fstab file by listing them with an advfs designation (see fstab(4)). This is similar to the way that you add any other file system. AdvFS filesets listed in the /etc/fstab file are mounted each time you reboot the system.

The fileset entry includes the domain name, fileset name, mount point, file system type, and the mount-point options. If you want to enable quotas, include the userquota and groupquota options (see Section 2.2) and the pass field numbers:

file_dmn#fileset /mount_point advfs rw,userquota,groupquota 0 2

For example, to automatically mount the credit fileset (assuming the fileset's mount point exists), add the following line to the /etc/fstab file:

acct_domain#credit /credit advfs rw,userquota,groupquota 0 2 

The userquota and groupquota options identify the mounted file systems that can be processed by quota-related commands. Many quota commands have a -a (all) option that directs the command to operate only on file systems specified in this way.

1.7.3    Displaying Fileset Information

Any system user can display detailed information about mounted filesets and clones. Root user privilege is required only if the domain is inactive (filesets unmounted). To examine fileset information enter:

showfsets domain_name

The following example displays the domain big_domain, which has four filesets:

# showfsets big_domain
staff1_fs 	
    Id           :  2cb9d009.000419f4.1.8001
    Files        :   18554,  SLim= 0, HLim= 0
    Blocks(512)  :  712230,  SLim= 0, HLim= 0
    Quota Status :  user=on group=on
    Object Safety: off
    Fragging     : on
    DMAPI        : off
 guest_fs
    Id           :  2cb9d009.000419f4.2.8001
    Files        :    4765,  SLim= 0, HLim= 0
    Blocks(512)  :  388698,  SLim= 0, HLim= 0
    Quota Status :  user=on group=on
    Object Safety: off
    Fragging     : on
    DMAPI        : off
 staff2_fs
    Id           :  2cb9d009.000419f4.3.8001
    Files        :   12987,  SLim= 0, HLim= 0
    Blocks(512)  :  842862,  SLim= 0, HLim= 0
    Quota Status :  user=on group=on
    Object Safety: off
    Fragging:      on
    DMAPI        : off
 staff3_fs
    Id           :  2cb9d009.000419f4.4.8001
    Files        :   48202,  SLim= 0, HLim= 0
    Blocks(512)  : 1341436,  SLim= 0, HLim= 0
    Quota Status :  user=on group=on
    Object Safety: off
    Fragging     : on
    DMAPI        : off 

The following example displays domain_2, which contains one fileset and one fileset clone:

# showfsets domain_2
test_fs
    Id           :  3003f44f.0008ac95.4.8001
    Clone is     : clone_test
    Files        :    7456,  SLim= 0, HLim= 0
    Blocks (512) :  388698,  SLim= 0, HLim= 0
    Quota Status : user=on group=on
    Object Safety: off
    Fragging     : on
    DMAPI        : off
 Clone_test
    Id           : 3003f44f.0008ac95.5.8001
    Clone of	   : test_fs
    Revision	   : 2 

You can use a graphical user interface (see Appendix D) to obtain similar information.

1.7.4    Creating a Fileset

A domain must contain at least one mounted fileset to be active (see Section 1.3.1). Within a domain you can create multiple filesets that share the storage pool established for the domain. Any fileset can consume all of the storage available in the domain.

Each fileset can be mounted and unmounted independently of the other filesets in the domain. You can limit fileset growth within a domain by assigning fileset quotas (see Chapter 2). You can control the creation of frags for files that waste more than 5% of their allocated storage (see Section 4.2). You can set the characteristics of the fileset at creation by using the mkfset command or change them by using the chfsets command (see Section 1.7.10).

To create a fileset in a domain, use the SysMan Create a New AdvFS Fileset utility, a graphical user interface (see Appendix D), or enter the mkfset command from the command line:

mkfset domain_name fileset_name

To mount a fileset, you must create a mount-point directory for it (see Section 1.7.6).

For example, to create the fileset coupons in the domain advertising:

# mkfset advertising coupons 

See also Section 1.6.5, which contains examples for configuring an active (filesets mounted) domain.

1.7.5    Upgrading a Fileset

Filesets that are part of domains created for operating system software Version 5.0 and later (DVN4) support large quota values and have better performance for very large directories. Filesets in domains created earlier (DVN3) do not have these improvements. To upgrade a fileset to the new version, you must upgrade its domain (that is, create a new one) and restore the fileset to it. Then the restored fileset has the new quota limits and performance improvements (see Section 1.6.3).

You cannot mount filesets with the new DVN on operating system versions earlier than Version 5.0 unless you NFS mount them from a server running Version 5.0 or later of the operating system software (see Section 5.4).

1.7.6    Mounting a Fileset

As with traditional UNIX file systems, AdvFS filesets must be mounted in order to access them. You must create a mount-point directory if it does not exist. Filesets to be mounted must be compatible with the operating system on which they were created (see Section 5.4).

To mount a fileset, use the SysMan General File System Utilities - Mount File Systems utility, a graphical user interface (see Appendix D), or enter the mount command from the command line:

mount domain_name#fileset_name mnt_point

For example, to create a mount-point directory and mount the fileset coupons in the domain advertising:

# mkdir /coupons 
# mount advertising#coupons /coupons 

Before a fileset is mounted, AdvFS verifies that all data in all volumes in a domain can be accessed. If there are problems, the mount might fail or the fileset might be mounted as read-only (see Section 5.8.7).

If you attempt to mount a fileset with an incorrect number of volumes, the mount operation fails. See Section 5.9.2 and advscan(8) for further information.

You can specify temporary atomic write data logging in your mount operation (see Section 4.4).

An error message is displayed if you attempt to mount a fileset created under operating system software Version 5.0 or later on a system running Version 4 or earlier operating system software (see Section 5.4).

1.7.7    Unmounting a Fileset

If you unmount a fileset, the fileset remains in the domain but it is not accessible. Mount the fileset to make it available again.

To unmount an AdvFS fileset, use the SysMan General File System Utilities - Dismount a File System utility, a graphical user interface (see Appendix D), or enter the umount command from the command line:

umount mnt_point

For example, to unmount the fileset coupons in the domain advertising that was mounted in Section 1.7.6:

# umount /coupons

1.7.8    Removing a Fileset

If you remove a fileset, it cannot be remounted. It is no longer part of the domain.

You must unmount a fileset and remove the fileset clone before you can remove it. If you have set up a trashcan directory (see Section 1.8) for the fileset, it is also removed.

To remove a fileset, use the SysMan Manage an AdvFS Domain utility, a graphical user interface (see Appendix D) or, from the command line, enter the rmfset command:

rmfset domain_name fileset_name

For example, to remove the tmp_1 fileset in domain_1:

# rmfset domain_1 tmp_1
rmfset: remove fileset tmp_1? [Y/N]y

The fastest way to remove all filesets is to remove the domain by using the rmfdmn command. However, you might be able to access some of the data by using the salvage utility (see Section 5.8.4). The rmfdmn command removes the definition of the domain in the /etc/fdmns directory and relabels the volumes, but it does not touch any data on the volume. If you remove filesets by using the rmfset command, you cannot recover them by using the salvage utility because the utility destroys pointers to the metadata for all the files in the fileset.

1.7.9    Renaming a Fileset

An unmounted fileset can be renamed. The fileset name is kept within the domain and is an attribute that you assign. When you rename a fileset, only this assignment is changed. The fileset ID is not altered.

To rename a fileset, unmount it and unmount its clone if it has one. You can use the SysMan Manage an AdvFS Domain utility, a graphical user interface (see Appendix D) or, from the command line, enter:

renamefset domain_name old_fileset_name new_fileset_name

After renaming the fileset, you must update the corresponding entries in the /etc/fstab file (see Section 1.7.2). If you do not do this, AdvFS does not mount the fileset when the system is booted.

For example, to rename the sad fileset that is mounted at /mntpt to happy using the vi editor:

# umount /mntpt 
# renamefset dmn_1 sad happy
# vi /etc/fstab 

Locate the following line in the /etc/fstab file:

dmn_1#sad /mntpt advfs rw,userquota,groupquota 0 2

Edit this line as follows:

dmn_1#happy /mntpt advfs rw,userquota,groupquota 0 2

Mount the fileset:

# mount /mntpt

Note

You cannot rename an AdvFS fileset clone. You must delete the old clone and create a new one.

1.7.10    Changing the Characteristics of a Fileset

With the chfsets command you can change the quota limits for a fileset by using the -F, -f, -B, and -b options (see Section 2.2.2) and by using the -o option you can turn fragment files on and off (see Section 4.2), and enable or disable object safety. From chfsets command has the following syntax:

chfsets [-F limit] [-f limit] [-B limit] [-b limit] [-o <frag|nofrag> <objectsafety|noobjectsafety> <dmapi|nodmapi>] domain_name [fileset_name]

For example, to enable object safety in the xyz3 fileset in the xyz_domain:

# chfsets -o objectsafety xyz_domain xyz3

When the object safety option is enabled, the pages on disk belonging to the fileset are zero-filled and forced to disk before they are available to the file. This prevents old data from being visible if a system crash occurs while the file is being written.

Files that allocated storage just prior to enabling object safety initiate object safety once the buffers associated with the allocation are flushed to disk.

Because object safety degrades performance (the pages on disk are zero-filled then the zeroes are overwritten with data) the administrator must decide if the performance impact is worth the improved security.

1.7.11    AdvFS Fileset Clones

If you have the optional AdvFS Utilities license, you can back up your files using an AdvFS fileset clone. A fileset clone is a read-only snapshot of fileset data structures (metadata). When you clone a fileset (create a fileset clone), the utility copies only the structure of the original fileset, not the actual data. When a file is modified, the file system copies the original, unchanged data to the AdvFS fileset clone. (This is called copy-on-write.) Because the only data in the fileset clone is a copy of data that has been modified, the fileset clone is usually smaller than the original fileset. Figure 1-4 illustrates the relationship between parent and fileset clones.

Figure 1-4:  Cloning a Fileset

Fileset clones increase the availability of data because they:

A clone cannot be cloned.

See Section 3.3 for command-line instructions on using cloning for online backup. See Section D.4.3 for an explanation of cloning with the AdvFS GUI.

Note

Changing text files with an editor can cause the entire original file to be copied to the clone. Many editors rewrite the entire file regardless of what has changed. When this happens, your AdvFS fileset clone might grow very large. There is no way for AdvFS to alter this process.

When you delete a file that existed when the clone was created, it remains available (but not visible in the original fileset) for the life of the clone. The file is not copied to the clone, but the actual delete operation is delayed until the clone is deleted. The version of the file that is retained is the one that existed when the clone was created. Later updates are lost.

The size of an AdvFS fileset clone depends upon the number of updates that occur during the life of the clone. The df command, which displays statistics on free disk space, does not accurately reflect the size of the fileset clone because it constantly changes as files are updated.

Caution

When a domain runs out of disk space, the file system loses its ability to maintain the consistency of files within AdvFS fileset clones. The original fileset is usable, but the fileset clone is not accurate and is no longer used. A warning message is displayed on both the user's terminal and the system console.

To clone a system disk and boot it on another system, see Best Practices. This not the same as creating an AdvFS fileset clone.

1.7.11.1    Creating an AdvFS Fileset Clone

AdvFS fileset cloning is transparent to the user and has little impact on system performance. You must be root user to create a clone. To create a fileset clone, use the SysMan Manage an AdvFS Domain utility, a graphical user interface (see Appendix D), or enter the clonefset command from the command line:

clonefset domain_name fileset_name clone_name

For example, to create a clone called clone_day300 for the fileset day300 in the domain transactions:

# clonefset transactions day300 clone_day300

1.7.11.2    Mounting and Unmounting an AdvFS Fileset Clone

Clones are mounted and unmounted in the same manner as any other fileset (see Section 1.7.6 and Section 1.7.7).

1.7.11.3    Removing an AdvFS Fileset Clone

Clones are removed in the same manner as any other fileset (see Section 1.7.8).

1.7.11.4    Renaming an AdvFS Fileset Clone

A fileset clone cannot be renamed. To assign a new name, remove the old clone and create a new clone for the fileset. (Note that this new clone is a snapshot of the fileset at a later point in time than the deleted clone.)

1.8    Setting Up Trashcans

If you have the optional AdvFS Utilities, end users can configure their systems to retain a copy of files they have deleted. They can attach trashcan directories to one or more directories within the same fileset. Once attached, any file deleted from an attached directory is automatically moved to the trashcan directory. The last version of a file that was deleted from a directory with a trashcan attached can be returned to the original directory by using the mv command.

Trashcan directories are a trade off, however. The convenience of recovering files without accessing backup comes at the cost of the additional writes to disk that are required when files are deleted.

Root user privilege is not required to use this command. However, the following restrictions apply:

Table 1-1 lists and defines the commands for setting up and managing a trashcan.

Table 1-1:  Trashcan Commands

Command Description
mktrashcan Creates the trashcan
shtrashcan Shows the contents of the trashcan
rmtrashcan Removes the trashcan directory

For example, to attach the trashcan directory keeper to the directory booklist:

# mkdir keeper
# mktrashcan keeper /booklist
   'keeper' attached to '/booklist'

To remove a file, and look for it in the trashcan directory:

# rm old_titles
# shtrashcan /booklist
   '//keeper' attached to '/booklist'
# cd keeper
# ls
   old_titles

To remove the connection between the trashcan and the directory:

# rmtrashcan /booklist
   '/booklist' detached

1.9    Configuring an AdvFS root File System

There are several advantages to configuring AdvFS for the root file system. You can:

The following restrictions on the AdvFS root file systems are currently enforced:

The root domain should contain only the root fileset. It is not advisable to include the /usr and /var filesets in the root domain. If you have only one storage device on your system, put other domains on different partitions.

You can put the root file system on an AdvFS volume during the initial base system installation or you can convert your existing root file system after installation. Note that when you install AdvFS as the root file system during the initial installation, root defaults to the a partition.

If you construct your own root file system, you must configure it on the a or c partition. See Section C.2 for instructions on converting an existing UFS root file system to AdvFS. See the Installation Guide for instructions on installing AdvFS as the root file system during the initial installation.

1.9.1    Mounting the root File System in Single-User Mode

The root file system is automatically mounted as read-only when the system is booted in single-user mode. You can change the root fileset mount from read-only to read-write by using the mount -u command:

# mount -u /

Use this procedure when you need to make modifications to the root configuration. For example, use it if you need to modify your /etc/fstab file.

1.9.2    Changing the Name of the root Domain

You can change the name of the root domain the same as any other domain (see Section 1.6.9). The name of a root domain is stored as the directory name in the /etc/fdmns directory and in the entry for root in the /etc/fstab file.

1.9.3    Changing the Name of the root Fileset

Changing the name of the root fileset is similar to changing the name of any other fileset (see Section 1.7.9). There are, however, two complications:

Therefore, you must use an alternate bootable partition and manipulate the root fileset you are changing as you would an ordinary fileset, make the changes, then reboot the changed fileset as root.

To rename the root fileset:

  1. Boot a partition other than the one you want to change. (It can be UFS.)

  2. Make a new entry in the /etc/fdmns directory of the booted partition for the fileset whose name you want to change.

  3. Change to the new directory and make a symbolic link to the device holding the original fileset.

  4. Use the renamefset command to rename the root fileset.

  5. Mount the newly named root fileset at a temporary location in order to update its /etc/fstab file.

  6. Change the fstab entry to correspond to the new root fileset name.

  7. Shut down the alternate system.

  8. Reboot the original AdvFS system.

The following procedure changes the name of the root fileset from root_fs to new_root. Assume that the root fileset is in the root_domain domain on /dev/disk/dsk2a.

  1. Boot a device other than the one you want to change.

  2. Make an entry for tmp_root_domain in the /etc/fdmns directory:

    #mkdir /etc/fdmns/tmp_root_domain
    

  3. Change to the new directory and make a symbolic link for tmp_root_domain:

    # cd /etc/fdmns/tmp_root_domain 
    # ln -s /dev/disk/dsk2a 
    

  4. Rename the fileset from root_fs to new_root:

    # renamefset tmp_root_domain root_fs new_root 
    

  5. Mount the changed root fileset to update the associated /etc/fstab file:

    #mount tmp_root_domain#new_root /mnt
    

  6. Edit the /mnt/etc/fstab entry for tmp_root_domain using the vi editor:

    # cd /mnt/etc 
    # vi fstab 
    

    Locate the following line in the /etc/fstab file:

    root_domain#root_fs / advfs rw,userquota,groupquota 0 2 
    

    Edit this line as follows:

    root_domain#new_root / advfs rw,userquota,groupquota 0 2
    

  7. Shut down the alternate system.

    # shutdown -h now
    

  8. Reboot the AdvFS system.

Note

If you change the root domain and fileset names and do not change the /etc/fstab entries, you cannot boot past single-user mode. Edit /etc/fstab file in single-user mode using an editor to proceed.

1.10    Using AdvFS with LSM

Logical Storage Manager (LSM) allows you to manage all of your storage devices, such as disks, partitions, or RAID sets as a flexible pool of storage from which you create LSM volumes. You can create mirrored and striped LSM volumes and change their attributes as performance and availability needs dictate. For more information see Logical Storage Manager.

AdvFS treats LSM volumes just like any other storage. You can use LSM to create and manage the volumes that you use in AdvFS domains.

Structuring domains with LSM storage provides some performance and reliability benefits:

Caution

LSM volumes are not backward compatible. Do not move an LSM volume that you added to a domain on a Version 5 operating system to a system running a Version 4 operating system.

See Logical Storage Manager for further information.

1.10.1    Setting Up AdvFS Using LSM Volumes

Use AdvFS commands for AdvFS activities. To manage LSM storage that is part of an AdvFS domain, use LSM commands. If you want to create an LSM volume or place and existing domain under LSM control, see Logical Storage Manager.

To use LSM with AdvFS from the command line:

  1. Create the LSM volumes with the desired attributes.

    You can specify mirrored volumes, striped volumes, mirrored and striped volumes, volume location, and volume size.

  2. Create a domain by using the mkfdmn command and identify the LSM volume as the initial volume.

  3. If desired, and if you have AdvFS Utilities, create a multivolume domain by using the addvol command adding either LSM or non-LSM volumes.

See Logical Storage Manager for further information.

Caution

Do not use the grow or shrink LSM options to change the size of AdvFS domains. Use the addvol and rmvol commands instead.

You will get an error message if you try to create an AdvFS domain on an LSM volume that is already opened or on a volume that is already labeled as in use by either UFS or AdvFS.

If you already have an AdvFS domain, you can encapsulate the domain into LSM by using the LSM encapsulation tools.

If mirrored or striped LSM volumes are part of an AdvFS domain that also includes non-LSM volumes, you cannot control which files go to the mirrored or striped LSM volumes. To place specific data on mirrored or striped volumes, create an AdvFS domain that contains only LSM volumes that are mirrored or striped. Then, migrate the files you want mirrored or striped in that domain.

The showfdmn command output, the LSM Storage Administrator (LSMSA), and the AdvFS GUI (see Appendix D) include LSM storage in the domain information display.

Note

You must use the full LSM pathname when referencing an LSM volume.

The following example creates a domain on an existing LSM volume:

# mkfdmn /dev/vol/rootdg/vol01 domain_rs

You can also add volumes to an existing domain:

# addvol /dev/vol/rootdg/vol02 domain_rs

1.10.2    Using LSM for Data Redundancy

You can configure domains with LSM mirrored volumes. This configuration provides failover protection. Because the multiple copies of the volumes contain the same information, either one can be accessed.

See Logical Storage Manager for detailed instructions for creating LSM mirrors. Mirrored volumes are added to AdvFS domains with AdvFS commands.

1.10.3    Striping LSM Volumes and Striping AdvFS Files

You can distribute I/O across multiple volumes by striping. AdvFS and LSM striping both work well on a busy system. LSM is better suited for general striping, while AdvFS striping allows the administrator finer-grained control for positioning individual files.

When you choose LSM striping, you configure your LSM volumes for striping before you add them to the domain. With LSM striping all files located on the volumes are striped. You can do this from the command line or from LSMSA (see Logical Storage Manager).

You can perform AdvFS striping at any time (see Section 4.13). Therefore, if you find that a file has become large or has heavy I/O requirements, you can use the AdvFS stripe command to stripe it.

It is not advisable to do both LSM and AdvFS striping because this might degrade system performance.