2    Configuring the File System

AdvFS 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 path names 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 taking down the system. As your system requirements change, AdvFS allows you to easily adjust your storage up or down to meet your requirements.

2.1    Setting Up AdvFS

You can initially set up AdvFS to resemble a traditional UFS configuration with one partition (volume) per file domain and each domain containing one fileset. If you have the optional AdvFS Utilities, when space is needed you can add volumes to increase the size of existing file domains and filesets. You do not have to change anything in the existing configuration.

When planning your configuration, consider setting up the root and /usr file systems on AdvFS. Using AdvFS as the root file system enables booting from an AdvFS file domain. By having the /usr file system on AdvFS, you can significantly reduce the amount of time your system is down after a system failure.

The minimum configuration needed for an active AdvFS file system is one file domain and one mounted fileset.

See the Appendix A for a complete list of AdvFS functionality and commands. To create an active file domain:

  1. Create a file domain (see Section 2.3.5).

  2. Create a fileset (see Section 2.4.4).

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

  4. Mount a fileset (see Section 2.4.6).

You can also automatically mount a fileset at system reboot (see Section 2.4.2).

For more detailed information on AdvFS configuration, see System Configuration and Tuning. For more information on setting up file domains, see Section 2.3 and Section 6.4.1.1.

2.2    Volumes

A volume on AdvFS can be a single disk partition, an entire disk, an aggregate volume provided by Logical Storage Manager (LSM), or hardware or software redundant array of independent disks (RAID) storage.

A volume can be assigned to only one file domain. It is associated with its file domain by a file domain ID, which is automatically stored in the file domain attributes table of the volume. Each volume in a file domain is assigned a volume index number, starting with 1, when it is initialized. Numbers are reused when volumes are removed and new ones added. When a volume is removed from a file domain, the file domain ID is cleared in the file domain attributes table.

If you have the optional AdvFS Utilities, adding volumes allows you to create a multivolume file domain, increase the disk capacity of an existing file domain, increase the storage available for the filesets, and perform preventative disk maintenance. You can add volumes immediately after creating the file domain, even before creating and mounting filesets. To perform preventative disk maintenance, you can add a new volume to the file 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 file domain with the same file domain ID must remain consistent with the number of volumes identified in the file domain attributes table. In addition, each file domain is defined by an entry in the /etc/fdmns directory (see Section 2.3.2). This directory must be up-to-date; that is, the file 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 identified in the domain attributes table.

All volumes are labeled either unused or with the file system for which they were last used (for example, advfs). You can only add a volume that is labeled unused to a file domain (see Section 7.5.6).

2.2.1    Volume Structure

Each volume in an AdvFS file domain contains the following structures:

In addition to these structures, each file domain has the following structures on one volume in the file domain:

This information is provided only to show how the volume is structured for AdvFS. You cannot change the way AdvFS configures the volume.

2.2.2    Volume Attributes

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

To display or modify the current volume attributes, use the AdvFS GUI (see Chapter 6) or, from the command line, enter the chvol command:

chvol [options] device_name file_domain

This functionality is also available from the SysMan menu.

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

2.3    File Domains

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

2.3.1    Configuring File Domains

How you configure file domains on your system depends on your organization's needs. You can assign all available storage to one file domain or group specific partitions or disks into different file domains. With AdvFS Utilities, you can assign multiple volumes to a file domain and distribute the filesets and files across the volumes.

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

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

The System Configuration and Tuning guide provides detailed guidelines for planning and configuring your file system. The AdvFS Software Product Description (SPD) contains information about system limits. See Chapter 6 if you want to configure your file domains using the AdvFS GUI.

2.3.2    The /etc/fdmns Directory

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

This directory is created and maintained automatically by AdvFS when you use standard AdvFS commands. You must have a current /etc/fdmns directory in order to mount the filesets in a file domain.

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

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

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

žTranslator: changed "domain" to "accounts" in the example belowŸ

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

AdvFS provides the advscan utility to reconstruct the/etc/fdmns directory by finding the location of AdvFS file domains on volumes or LSM disk groups (see Section 7.6.1).

2.3.3    Version 5.0 File Domains

Version 5.0 operating system file domains have an improved disk structure that provides support for quota values larger than 2 terabytes and increases performance for directories containing thousands of files. All file domains that were created 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 file domain. The Version 5.0 operating system is the first for which a new file domain carries a DVN of 4. File domains created earlier carry a DVN of 3.

You can mount an older fileset on a system running Version 5.0. You cannot mount a fileset in a file domain created under Version 5 or later on a system running a Version 4 operating system except by NFS mounting from a Version 5 or later server (see Section 7.2). Therefore, if your application requires backward compatibility, it is inadvisable to upgrade your file domain to the new DVN.

2.3.3.1    Creating a File Domain with DVN 4

All file domains created under Version 5.0 automatically have a DVN of 4. Therefore, if you do a full install of Version 5.0, all the file domains created in the process will have the new structure. If you update install Version 5.0, your existing file domains will retain the DVN of 3. This means that /root, /usr, and /var will also have a DVN of 3. You will have to upgrade the DVN 3 files manually. There is no conversion utility.

2.3.3.2    Upgrading a File Domain to DVN 4

If you are running Version 5.0 and 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 file domain to a file domain with a DVN of 4.

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

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

  2. Remove the old file domain with the rmfdmn command. This will also remove the old fileset.

  3. Create a new file domain with the mkfdmn command. The new file domain has a DVN of 4. Note that you do not need to use the -x and -p options for the mkfdmn command. Version 5.0 takes care of BMT allocations.

  4. Create the new filesets with the mkfset command.

  5. Restore the filesets in the new domain with the vrestore command.

For example, to upgrade the file 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:

# 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_m fset_m
# mount domain_p#fset_p /fset_p
# mount domain_m#fset_m /fset_m
# vrestore -x -D /fset_p
# mt fsf 1
# vrestore -x -D /fset_m

It is possible to create file domains with a DVN of 3, which would be recognized by older operating systems, on a Version 5.0 system. See mkfdmn(8) for more information.

2.3.4    Displaying File Domain Information

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

showfdmn domain_name

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

# showfdmn domain_1 
      Id           Date Created      LogPgs Version Domain Name
2bb0c594.00008570 Wed Mar 24 12:33 1999 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% 

2.3.5    Creating a Single-Volume File Domain

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

Creating a single-volume file 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 2-1, use the AdvFS GUI or, from the command line, enter the mkfdmn command:

mkfdmn volume_name domain_name

This functionality is also available from the SysMan menu.

To create an active single-volume file domain:

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

  2. Create one or more filesets with the mkfset command and name each fileset the same as its mount-point directory; for example, if the mount-point directory is /tmp, name the fileset tmp. (This naming scheme is recommended but is not required.)

  3. Create the mount-point directory with the mkdir command.

  4. Mount each fileset with the mount command.

Caution

The mkfdmn command destroys the data existing on the volume named in the command. Do not name a volume that contains data that you want to keep. If you have accidentally used the mkfdmn command, you may be able to recover some of your data with the salvage utility if the volume that was destroyed was an AdvFS volume (see Section 7.5.8).

Figure 2-1:  Single-Volume File Domain

There are a number of ways to set up active, single-volume AdvFS file systems. The following example configures a file system with volume /dev/disk/dsk3c, file domain domain_1, and fileset staff with mount point /staff.

# mkfdmn /dev/disk/dsk3c domain_1
# mkfset domain_1 staff 
# mount domain_1#staff /staff
# mkdir /staff

The following example creates a single-volume file domain, domain_2, and two filesets, private and public, in the file domain. Because the file domain has only one volume, the files in both filesets physically reside on one volume (this is allowed in AdvFS):

# mkfdmn /dev/disk/dsk2c domain_2 
# mkfset domain_2 private
# mkfset domain_2 public
# mkdir /private 
# mkdir /public 
# mount domain_2#private /private
# mount domain_2#public /public

You can set up a file domain with an LSM volume by naming the volume in the mkfdmn command. See Section 2.8 for information about using AdvFS with LSM. If you have AdvFS Utilities, you can change the size of your file domain by adding more volumes. You can transform a single-volume file domain (except the root file domain) into a multivolume file domain (see Section 2.3.6 and Chapter 6).

If you try to create a file domain on a volume that is in use, you will get an error 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 file domain usr_domain, you will get the following message:

# 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>

2.3.6    Increasing the Size of a File Domain

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

Figure 2-2:  Enlarging a File Domain

There may be performance benefits if you upgrade a file domain created before Version 5.0 to the new file structure (see Section 2.3.3) when you increase its size.

Caution

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

A newly created file domain consists of one volume, which can be a disk, disk partition, or logical volume. To add volumes, use the AdvFS GUI (see Chapter 6) or, from the command line, enter the addvol command:

addvol device_name domain_name

This functionality is also available from the SysMan menu.

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

# addvol /dev/disk/dsk3c resources

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

You cannot add a volume to the root file domain unless you are running a cluster (see Cluster Administration). If you are running a cluster configuration, adding another root volume is the same procedure as adding any volume.

Caution

Existing data on the volume you add is destroyed during the addvol procedure. Do not add a volume containing data that you want to keep. If you have accidentally used the addvol command, you may be able to recover some of your data with the salvage utility if the volume that was destroyed was an AdvFS volume (see Section 7.5.8).

If you do not have AdvFS Utilities and want to increase the size of your file domain, you must move the domain to a different volume with the vdump and vrestore commands process (see Section 5.2.4).

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

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

  2. Add the new volume to the file domain.

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

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

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

# showfdmn domain_1
    Id              Date Created     LogPgs Version Domain Name
2bb0c594.00008570 Wed Mar 24 12:33 1999 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 

2.3.6.1    Adding Overlapping Partitions on Mounted File Systems

AdvFS will not add a volume that would overlap a mounted file system. If you try to add a volume that would cause partitions to overlap with another volume that is mounted for another file system, a swap area, or a reserved partition (by a database, for example), the system displays an error message and does not permit the addvol procedure to complete:

# addvol /dev/disk/dsk3b big_dom 
Error: /dev/rdisk/dsk3b or an overlapping partition is open.
addvol: Can't add volume '/dev/disk/dsk3b' to domain 'big_dom'

2.3.6.2    Adding Overlapping Partitions on Unmounted File Systems

You cannot add a volume with partitions that overlap with an unmounted partition that has a disk label for a file system, a swap area, or a reserved partition. If you attempt to add a volume that would overlap, you will get an error message.

# addvol /dev/disk/dsk2c domain_1
Error: Partition(s) that overlap /dev/rdisk/dsk2c are marked 
   in use.
To edit an incorrect disklabel, use the -e flag with disklabel;
  for more information see the disklabel(8) reference page.
addvol: Can't add volume '/dev/disk/dsk2c' to domain 'domain_1'

If you want to overwrite partitions that are labeled in use, use the addvol -F command. Using the -F option allows the volume to be added and overwrites any partition that has a disk label but is not mounted.

2.3.7    Reducing the Size of an Existing File Domain

When there is sufficient free space on the remaining volumes, you can remove volumes from a file domain at any time without interrupting users or affecting the logical structure of the filesets in the file domain. When you use the rmvol utility, the file system automatically migrates the contents of the selected volume to other volumes in the file domain. Before you can remove a volume from a file domain, all filesets in the file domain must be mounted. An error will occur if you try to remove a volume from a file domain with unmounted filesets.

Caution

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

To remove a volume, use the AdvFS GUI (see Chapter 6) or, from the command line, enter the rmvol command:

rmvol device_name domain_name

This functionality is also available from the SysMan menu.

For example, to remove dsk3c from the file domain inventory:

# rmvol /dev/disk/dsk3c inventory

If there is not enough free space on other volumes in the file domain to accept the files 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 file domain is not damaged.

You can interrupt the rmvol process (see rmvol(8)) with Ctrl/c or with the kill -term command without damaging your file domain. Do not use the kill -KILL command. When you interrupt the process, AdvFS will stop removing files from the volume. Files already removed will remain in their new location.

Under some circumstances unterrupting an rmvol command with the kill command can leave the volume in an inaccessible state. If a volume does not allow writes after an aborted rmvol operation, use the chvol command with the -A option to reactivate the volume.

To reduce the size of a file domain:

  1. Use the showfdmn command to display the contents of the file 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.

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

#showfdmn domain_2 
  Id              Date Created     LogPgs Version Domain Name
2bb0c594.00008570 Wed Jun 9 10:23 1999 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 file domain, a confirmation is required before removing the volume. If you allow the removal process to continue, more than one stripe segment will be placed on the remaining volumes. See Section 5.2.5 for details on file striping.

2.3.8    Removing a File Domain

You can remove a file domain after all filesets in the domain are unmounted. When you remove a file domain, the entry in the /etc/fdmns directory that defined the file domain is removed and you cannot mount the filesets. Volumes that were assigned to the removed file domains are relabeled as unused and can be reused. However, removing the file domain instead of using the rmfset command to remove each fileset may present a security hole since no data on the volumes is changed. Thus it may be possible to access the data with the salvage command (see Section 7.5.8).

To remove a file domain, use the AdvFS GUI (see Chapter 6) or, from the command line, unmount all filesets and clone filesets. Then, enter the rmfdmn command:

rmfdmn domain_name

This functionality is also available from the SysMan menu.

You will be prompted to verify the removal. Responding y will complete the removal. A confirmation message will be displayed when the procedure is complete.

For example, to remove the file domain promotions:

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

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

2.3.9    Renaming a File Domain

An existing file domain can be assigned a new name. File domains are known to the system by their file domain identifier, a set of numbers that identify the file domain. When you rename a file domain, the file domain identifier is not changed.

When you rename a file domain, entries for all filesets in the domain must be updated in the /etc/fstab file. To rename a file domain, use the AdvFS GUI, which updates the /etc/fstab file (see Chapter 6), or, from the command line:

  1. Unmount all the filesets and any related clones.

  2. In the /etc/fdmns directory, change the old file 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 file domain.

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

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

Change the line

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

to

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

and mount the fileset

# mount /fset

This functionality is also available from the SysMan menu.

2.4    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. Like traditional file systems, you mount AdvFS filesets. Similarly, 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 may be associated with their file domain names as in filedomain#fileset. Here the pound sign (#) is part of the naming syntax and does not represent a comment. Fileset names must be unique within a file domain.

AdvFS also supports clone filesets. A clone fileset is a read-only copy of an existing fileset that you create to capture your data at one instant in time (see Section 2.5).

2.4.1    Configuring Filesets

The number of filesets on your system depends on your organization's needs. To share storage, you can create multiple filesets in one file domain but manage the filesets separately. Or, you can set up AdvFS in a standard UNIX file system configuration by creating one fileset per file domain.

Because filesets are managed independently of their physical storage, each fileset can be backed up independently (see Chapter 4) and can be assigned its own quota limits (see Chapter 3). Consequently, you can group files by their management requirements. For example, you could create a fileset for developer files that will be backed up twice a day and you could create another fileset with quotas imposed to limit the amount of disk space available to the marketing department.

There is one transaction log per file domain that is shared by all filesets in the file domain. When there are many filesets with a large amount of I/O, the transaction log can become a bottleneck because all transactions are written to the transaction log (see Section 1.3.2). Balance the management gains of having multiple filesets in a file domain against the potential performance reduction caused by having all of the log data for all filesets going to one transaction log (see Section 5.1.3).

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

The System Configuration and Tuning guide provides detailed guidelines and suggestions for file system configuration. Many configuration operations can be accomplished with the AdvFS GUI (see Chapter 6).

2.4.2    The /etc/fstab File

AdvFS filesets are added 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 file domain name, fileset name, mount point, file system type, and the mount point options. The user quota and group quota options (see Section 3.2) should be included along with the pass field numbers if quotas are used. If they are not desired, the user quota and group quota options can be omitted. An AdvFS /etc/fstab entry with user and group quotas enforced should include:

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

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

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

2.4.3    Displaying Fileset Information

Any system user can use the showfsets command to display detailed information about mounted filesets and clones. Root user privilege is required only if the file domain is inactive (filesets unmounted).

showfsets domain_name

The following example displays the file 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
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
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
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 

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

# 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
Clone_test
 Id           : 3003f44f.0008ac95.5.8001
 Clone of	     : test_fs
 Revision	     : 2 

You can use the AdvFS GUI (see Chapter 6) to obtain similar information.

2.4.4    Creating a Fileset

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

Each fileset can be mounted and unmounted independently of the other filesets in the file domain. You can limit fileset growth within a file domain by assigning fileset quotas.

To create a fileset in a file domain, use the AdvFS GUI (see Chapter 6) or, from the command line, enter the mkfset command:

mkfset domain_name fileset_name

This functionality is also available from the SysMan menu.

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

# mkfset advertising coupons

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

2.4.5    Upgrading a Fileset

Filesets that are part of file domains that were created prior to Version 5.0 do not have the structure that enables them to support large quota values and better performance for very large directories. To upgrade filesets to the new version, you must upgrade the file domain (that is, create a new one) and restore the filesets to it. Then the restored filesets will have the new structure (see Section 2.3.3).

You cannot mount filesets with the new DVN on operating systems earlier than Version 5.0 unless you NFS mount them from a Version 5.0 or later server (see Section 7.2).

2.4.6    Mounting a Fileset

As with traditional UNIX file systems, AdvFS filesets must be mounted in order to access them. Filesets to be mounted must be compatible with the operating system on which they were created (see Section 7.2).

To mount a fileset, use the AdvFS GUI (see Chapter 6) or, from the command line, enter the mount command, where mnt_point is the path to the mount point:

mount domain_name#fileset_name mnt_point

This functionality is also available from the SysMan menu.

For example, to mount the fileset coupons in the file domain advertising:

# mount advertising#coupons /coupons

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

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

You will get an error message if you attempt to mount a fileset created under Version 5.0 on a system running Version 4 or earlier (see Section 7.2).

2.4.7    Unmounting a Fileset

To unmount an AdvFS fileset, use the AdvFS GUI (see Chapter 6) or, from the command line, enter the umount command:

umount mnt_point

This functionality is also available from the SysMan menu.

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

# umount /coupons

2.4.8    Removing a Fileset

Filesets can be deleted from a file domain when they are no longer needed. Only unmounted filesets can be removed. A fileset's clone must be removed before the fileset is removed. Once filesets are removed, they cannot be remounted. If you have set up a trashcan directory (see Section 5.3) for the fileset, it is also removed.

You can use the AdvFS GUI (see Chapter 6) to remove a fileset or, from the command line, enter the rmfset command:

rmfset domain_name fileset_name

This functionality is also available from the SysMan menu.

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 in a file domain is with the rmfdmn command. However, the salvage command (see Section 7.5.8) may be able to access some of the data. 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. Filesets removed with the rmfset commmand are not recoverable with the salvage utility because the utility destroys pointers to the fileset data (metadata) and all the files in the fileset.

2.4.9    Renaming a Fileset

An existing fileset can be assigned a new name. Filesets are known to the system by their fileset identifier, which is a combination of the file domain identifier and an additional set of numbers that identify the fileset within the file domain. 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 identifier is not altered. Filesets must be unmounted to be renamed.

You can use the AdvFS GUI, which updates the /etc/fstab file (see Chapter 6) to rename a fileset or, from the command line, enter the renamefset command:

renamefset domain_name old_fileset_name new_fileset_name

This functionality is also available from the SysMan menu.

For example, to rename the marketing fileset to the advertising fileset:

# renamefset domain_1 marketing advertising

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

Note

If you rename a fileset, its clone can no longer track it. You cannot rename the clone. You must delete the old clone and create a new one.

2.5    Clone Filesets

If you have the optional AdvFS Utilities, you can back up your files using a clone fileset, a read-only snapshot of fileset data structures (metadata). When you clone a fileset (create a clone fileset), the utility copies only the structure of the original fileset, not the actual data. Only when a file is modified does the file system copy the original, unchanged data to the clone fileset. (This is called copy-on-write.) Because the only data contained in the clone fileset is a copy of original data that was modified, the clone fileset usually consumes less disk space than the original fileset. Figure 2-3 illustrates the relationship between parent and clone filesets.

Figure 2-3:  Cloning a Fileset

Clone filesets increase the availability of data because they:

See Section 4.2 for command line instructions on using cloning for online backup and Section 6.4.3 for an explanation of cloning with the AdvFS GUI.

2.5.1    How Cloning Works

When you create a clone fileset, only pointers to the file metadata (file structure) are stored in the clone fileset. Data files are not copied. When you modify your data in the original fileset, AdvFS saves the pages that existed when the clone fileset was created. As you update data in a file, the original pages associated with the change are copied to the clone fileset. The original pages are then rewritten with the new data. The clone fileset retains the originals of all data that has changed since the clone was created. Therefore, the clone will get larger over time as the files are changed.

To create a clone fileset, AdvFS:

  1. Creates a read-only fileset to be the clone.

  2. Copies only the original fileset tag directory to the clone.

  3. Creates a link between the two filesets.

  4. Sets up bookkeeping to track whether a given page has been updated.

Once a page has been added to the clone, it is marked. If the same page is updated again, the clone does not change. It already contains the information that existed when the clone was created.

AdvFS allocates clone fileset space by pages (8 kilobytes). If you modify one page in a large file, then only one additional page is allocated by the clone. Note that if a file is modified so that pages are appended, these pages will not appear in the clone because they were created after the clone was created.

Unless you modify every page of every file in the original fileset during the life of the clone, the clone fileset occupies less disk space than the original fileset.

Note

Changing text files with an editor may 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 clone fileset may 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 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 the clone fileset 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 clone fileset because it constantly changes as files are updated.

Caution

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

2.5.2    Creating a Clone Fileset

Cloning is transparent to the user and has little impact on system performance. You do not have to be root user to create a clone. To create a clone fileset, use the AdvFS GUI (see Chapter 6) or, from the command line, enter the clonefset command:

clonefset domain_name fileset_name clone_name

This functionality is also available from the SysMan menu.

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

# clonefset transactions day300 clone_day300

2.5.3    Mounting a Clone

An AdvFS fileset clone must be mounted in order to access it. To mount a clone, use the AdvFS GUI (see Chapter 6) or, from the command line, enter the mount command. Identify the clone and mount point:

mount domain_name#clone_name mnt_point

This functionality is also available from the SysMan menu.

For example, to mount the clone clone_day300 created above:

# mount transactions#clone_day300 /day_of_year

To unmount a clone, enter the standard umount command:

umount mnt_point

For example, to unmount the clone clone_day300 created and mounted above:

# umount /day_of_year

2.5.4    Removing a Clone

A clone can be deleted from a file domain when it is no longer needed. Once clones are removed, they cannot be remounted. Note that a fileset's clone must be removed before the fileset can be removed.

To remove a clone, use the AdvFS GUI (see Chapter 6) or, from the command line, unmount the clone, and then enter the rmfset command:

rmfset domain_name clone_name

This functionality is also available from the SysMan menu.

For example, to remove the tmp_clone clone in domain_1:

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

2.5.5    Renaming a Clone

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

If you have renamed a fileset that has a clone, you must delete the clone associated with the old name before you can create a clone for the newly named fileset.

2.6    Configuring an AdvFS root File System

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

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

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

If you construct your own root file system, you can configure it on the a or c partition. See Section B.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.

2.6.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 with 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.

2.6.2    Changing the Name of the root File Domain

You can change the name of the root domain (or any domain). 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.

To change the name of the root file domain:

  1. Use the mv command to rename the root file domain.

  2. Use an editor to rename the root file domain entry in the /etc/fstab file.

For example, to change root_domain to root_dmn:

# mv /etc/fdmns/root_domain /etc/fdmns/root_dmn

Use an editor to change the entry in the /etc/fstab file that mounts the root file domain:

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

to

root_dmn#root / advfs rw,userquota,groupquota 0 2

2.6.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 2.4.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 example changes the name of the root fileset from root_fs to new_root. Assume that the root fileset is in the root_domain file 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 to update the associated fstab file:

    # mount tmp_root_domain#new_root /mnt
    

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

    # cd /mnt/etc 
    # vi fstab 
    

    Change the line:

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

    to:

    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 file domain and fileset names and forget to change the /etc/fstab entries, you will not be able to boot past single-user mode. You will have to fix /etc/fstab from single-user mode using an editor before you can proceed.

2.7    Data Logging by the Transaction Log

Normally write requests are asynchronously written to disk. The write system returns a success value once the data has been cached. If the system crashes before the write occurs, inconsistencies can occur. You can decrease the likelihood of inconsistent data if you modify the way your system writes to storage. There are two ways to do this:

The chfile command can be used on AdvFS files that are NFS mounted.

Both forced synchronous writes and atomic write data logging can slow system performance. In addition, files that use atomic write data logging cannot be memory mapped through the mmap system call to determine the I/O. See Section 7.3 for information on improving transaction log performance.

2.8    Using AdvFS with LSM

LSM is a disk-management tool that allows you to create arbitrary-sized volumes independent of disk sizes and partition boundaries. You can create mirrored and striped 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 volume such as a disk or a disk partition. You can use LSM to create and manage the volumes that you use in AdvFS file domains.

LSM and AdvFS together provide some performance enhancements:

Use AdvFS with or without LSM volumes to manage file systems and file-level activities:

You can operate on LSM volumes running AdvFS either through the command line or the AdvFS GUI (see Chapter 6). There is also an LSM GUI that manipulates LSM volumes. See Logical Storage Manager for further information.

2.8.1    Setting Up AdvFS with LSM Volumes

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 file domain with the mkfdmn command and identify the LSM volume as the initial volume.

  3. To create a multivolume file domain, use the addvol command with either an LSM or non-LSM volume.

Caution

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

You will get an error message if you try to create an AdvFS file 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 file domain, you can encapsulate the domain into LSM using the encapsulation tools.

If mirrored or striped LSM volumes are part of an AdvFS file domain that also includes non-LSM volumes, you do not have control over which files go to the mirrored or striped LSM volumes. To place specific data on mirrored or striped volumes, create an AdvFS file domain that contains only LSM volumes with the attributes that you want. Then, put the files you want mirrored or striped in that file domain.

The showfdmn command and the AdvFS GUI (see Chapter 6) include LSM volumes in the file domain information display. In addition, you can use the advscan command to locate AdvFS volumes in LSM disk groups.

It is better to add multiple small LSM volumes rather than a single, large, striped or concatenated volume to an AdvFS file domain. This enables AdvFS to balance and stripe I/O across volumes if necessary.

Note that you must use the full LSM path name when referencing an LSM volume.

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

# mkfdmn /dev/vol/rootdg/vol01 domain_rs

You can also add volumes to an existing file domain:

# addvol /dev/vol/rootdg/vol02 domain_rs

The following example creates a 1-gigabyte file domain with two LSM volumes:

# volassist make vol01 500m 
# volassist make vol02 500m 
# mkfdmn /dev/vol/rootdg/vol01 onegb_domain
# addvol /dev/vol/rootdg/vol02 onegb_domain 
# mkfset onegb_domain onegb_fset1
# mkdir /fset1
# mount onegb_domain#onegb_fset1 /fset1 

2.8.2    Mirroring LSM Volumes Under AdvFS

You can place two (or more) LSM volumes in a mirror configuration for AdvFS file domains. This configuration provides distributed processing and fail-over protection; since both disks contain the same information, either one can be accessed.

The following example creates a 500-megabyte mirrored LSM volume, creates a file domain using the LSM volume, creates a new fileset, and then mounts the fileset:

# volassist make v2_mirr 500m nmirror=2 
# mkfdmn /dev/vol/rootdg/v2_mirr domain1 
# mkfset domain1 fset_1 
# mount domain1#fset_1 /mnt9 

Once a mirror is created, you would not ordinarily split it. If you wish to back up a mirrored volume (see Logical Storage Manager), you can mount a mirror that has been split using the mount command with the dual option. If you do not use the dual option, you will get the error message:

E_DOMAIN_ALREADY_EXISTS

The following example assumes that volume1 is the split mirror volume. To remount the data from domain1#fset1 on the same system in domain2 after a mirror has been split:

# mkdir /fileset2
# mkdir /etc/fdmns/domain2
# ln -s /dev/vol/rootdg/volume1 /etc/fdmns/domain2/volume1
# mount -o dual domain2#fset1 /fileset2

2.8.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 preconfigure your volumes for file striping; then all files located on the volumes configured for striping will be striped. You can do this from the command line or from the LSM GUI (see Logical Storage Manager).

You can stripe an AdvFS file at any time (see Section 5.2.5). 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 may degrade system performance.

The following example creates a striped LSM volume and then creates an AdvFS file domain using that striped LSM volume. All files created in this AdvFS file domain will be striped across LSM volumes:

# volassist make vol06 600m layout=stripe nstripe=3
# mkfdmn /dev/vol/rootdg/vol06 striped_domain