Chapter 2: Configuring the File System


Home - - Previous Chapter - Next Chapter

Configuring AdvFS requires less planning than it does for a traditional file system. With AdvFS you can modify your system configuration at any time without taking down the system. As your system needs change, AdvFS allows you to easily adjust your storage needs up or down to meet your requirements.

To achieve this flexibility, AdvFS implements two new file-system concepts: filesets and file domains. Filesets and file domains enable a two-layer file-system structure that decouples the physical storage layer of the file system from its directory hierarchy. With this unique architecture, you can manage the logical structure of your file systems independently of the storage volumes that contain them.

This chapter includes the following sections:

File Domains Filesets Volumes Setting Up AdvFS Using Trashcans

Using AdvFS with LSM


File Domains


Top of Page - Next Section

A file 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. A volume on AdvFS can be a single disk partition, an entire disk, or an aggregate volume provided by a logical volume manager. Because this storage is managed separately from the directory structure, you can expand and contract the size of the file domain and move files between disks in the file domain without changing file path names.


Creating a File Domain


Top of Page - Previous Section - Next Section

The first step in setting up an AdvFS file system is creating a file domain. When you create a file domain, you assign an initial volume to the file domain. You can transform a single-volume file domain into a multivolume file domain by adding one or more volumes (with the exception of the root file domain).

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 Filesets for details.

To create a file domain on the initial volume issue the mkfdmn command using the following format, where volume_name is the name of a block special device of the initial volume for the domain and domain_name is the name of the file domain to be created:

mkfdmn volume_name domain_name

Each file domain must have a unique name of up to 31 characters except the slash (/), pound (#), asterisk (*), question mark (?) and space characters. If you want a multivolume file domain, use the addvol command to add volumes to the file domain.


Determining the Number of File Domains


Top of Page - Previous Section - Next Section

The number of file domains you configure on your system depends on your organization's needs. With AdvFS, you can assign all available storage to one file domain or group specific partitions or disks into different file domains.

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.

Combining multiple volumes within a single file domain reduces the overall management effort because fewer file domains require less administration. However, a single volume failure within a file domain renders the entire file domain inaccessible. Thus, the more volumes that you have in your file domain the greater the risk that a file domain will fail.


Planning and Configuring File Domains


Top of Page - Previous Section - Next Section

The following are guidelines to follow when planning and configuring your file domains:

To maintain high performance, avoid splitting a disk between two file domains. For example, do not add partition g to one file domain and partition h of the same disk to another file domain.


The /etc/fdmns Directory


Top of Page - Previous Section - Next Section

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

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. In addition, AdvFS provides the advscan command that finds the location of AdvFS file domains on volumes or LSM disk groups and can reconstruct the /etc/fdmns directory. See Restoring Data for details on restoring.


Displaying File-Domain Information


Top of Page - Previous Section - Next Section

If a file domain is active; that is, if at least one fileset is mounted, you can display detailed information about the file domain and the volumes included in it.

Table 2 defines the information displayed by the showfdmn command.

Table 2 Definitions of showfdmn Information

Field Title

Definition

Id

A unique number, in hexadecimal format, that identifies a file domain.

Date Created

The day, month, and time that a file domain was created.

LogPgs

The number of 8-kilobyte pages in the transaction log of the specified file domain.

Domain Name

The name of the file domain.

Vol

The volume number within the file domain. An "L" next to the number indicates that the volume contains the transaction log.

512-Blks

The size of the volume in 512-byte blocks.

1K-Blks

The size of the volume in 1-kilobyte blocks.

Free

The number of blocks in a volume that are available for use.

% Used

The percent of volume space that is currently allocated to files or metadata.

Cmode

The I/O consolidation mode. The default mode is on.

Rblks

The maximum number of 512-byte blocks read from the volume at one time.

Wblks

The maximum number of 512-byte blocks written to the volume at one time.

Vol Name

The name of the special device file for the volume.


Table 3 defines the additional information included in the showfdmn command display for multivolume file domains.

Table 3 Definitions of showfdmn Information for Multivolume Domains

Totals

Definition

Total Volume Size

The total size of all volumes in the file domain.

Total Number of Free Blocks

The total number of free blocks on all of the volumes in the file domain.

Total Percent of Volume Space

The percent of total volume space currently allocated in the file domain.


The following example displays file-domain information for the domain_1 file domain:

# showfdmn domain_1

Id Date Created LogPgs Domain Name
2bb0c594.00008570 Wed Mar 24 12:33 1995 512 domain_1
Vol 512-Blks Free % Used Cmode Rblks Wblks Vol Name
1L 832527 79210 90% on 128 128 /dev/rz1c
2 832527 1684 98% on 128 128 /dev/rz2c
--------- ------ -------
1665054 80894 94%

Renaming a File Domain


Top of Page - Previous Section - Next Section

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

To rename a file domain, follow these steps:

  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, using the following mv command format:
    mv/etc/fdmns/old_domain_name /etc/fdmns/new_domain_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 mkting_dmn file domain as the advting_dmn file domain, assuming one fileset, adv_fs, is mounted at /adv_fs, issue the following commands:

# umount mkting_dmn#adv_fs
# mv /etc/fdmns/mkting_dmn /etc/fdmns/advting_dmn
# vi /etc/fstab
Change the line: mkting_dmn#adv_fs to: advting_dmn#adv_fs
# mount /adv_fs


Removing a File Domain


Top of Page - Previous Section - Next Section

You can remove a file domain after all filesets in the file domain are unmounted. Removing a file domain destroys the file domain and its filesets. The directory entry in /etc/fdmns 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.

To remove a file domain, unmount all filesets and clone filesets. Then, issue the rmfdmn command using the following format, where domain_name is the name of the file domain to be removed:

rmfdmn domain_name

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

rmfdmn: remove domain domain_name? [y/n]y
rmfdmn: domain domain_name 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.

Caution After removing a file domain, you cannot recover any file data from any fileset in the removed file domain.


Filesets


Top of Page - Previous Section - Next Section

A fileset represents a mountable portion of the directory hierarchy of a file system. Each is a collection of directories and files that form a subtree structure.

Filesets and traditional UNIX file systems are equivalent in many ways. Like traditional file systems, you mount AdvFS filesets. Similarly, filesets 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.

AdvFS filesets also support a new feature: 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. You can back up the contents of the clone fileset while the original fileset remains available to users. See Cloning for Online Backup for additional information on cloning.


Creating a Fileset


Top of Page - Previous Section - Next Section

A file domain must contain at least one fileset to be mounted. The single 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, issue the mkfset command using the following format, where fileset_name is the name of the fileset to be created:

mkfset domain_name fileset_name

Each fileset in the file domain must have a unique name of up to 31 characters. All white space characters and the / # : * ? characters are invalid for fileset names. The same fileset name can be repeated in different file domains but every fileset must have a unique mount point.


Determining the Number of Filesets


Top of Page - Previous Section - Next Section

The number of filesets you configure 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.

Remember that filesets are managed independently of their physical storage. Each fileset can be backed up separately and at different times, or can be assigned quota limits. 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.


Planning and Configuring Filesets


Top of Page - Previous Section - Next Section

The following are guidelines to follow when planning and configuring AdvFS filesets:


Mounting a Fileset


Top of Page - Previous Section - Next Section

As with traditional UNIX file systems, AdvFS filesets must be mounted in order to access them. To mount a fileset, use the mount command. Identify the file domain, fileset, and mount point using the following format where mnt_point is the path to the mount point:

mount domain_name#fileset_name mnt_point

To unmount AdvFS filesets, use the standard umount command with the following format:

umount mnt_point


The /etc/fstab File


Top of Page - Previous Section - Next Section

AdvFS filesets are added to the /etc/fstab file in the same manner 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 should be included along with the pass field numbers if quotas are used. An AdvFS /etc/fstab entry with user and group quotas enforced should include:

advfs rw,userquota,groupquota 0 2

For example, to automatically mount the credit_fs fileset with user and group quotas, add the following line to your /etc/fstab file:

account_domain#credit_fs /mnt/credit advfs rw,userquota,groupquota 0 2

Displaying Fileset Information


Top of Page - Previous Section - Next Section

Any system user can display detailed information about all filesets and clones in a specified file domain. Root user privilege is required only if the file domain is inactive (filesets unmounted).

Table 4 defines the information displayed by the showfsets command.

Table 4 Definitions of showfsets Command Information

Field Title

Definition

Id

A fileset identifier is a combination of the file domain identifier and an additional set of numbers that identify the fileset within the file domain.

Clone Status

The status of a clone fileset varies, depending on the fileset. Status items can include: Clone is, which specifies the name of a clone fileset; Clone of, which specifies the name of the parent fileset; or Revision, which specifies the number of times you revised a clone fileset.

Files

Specifies the number of files in the fileset and the current file usage limit (quota).

Slim

The soft limit of the fileset quota. This limit can be exceeded for a period of time specified by the grace period.

Hlim

The hard limit of the fileset quota. This limit cannot be exceeded.

Blocks

The number of blocks that are in use by a mounted fileset and the current block usage limit (quota). For filesets that are not mounted, zero blocks will display. For an accurate display, the fileset must be mounted.

Quota Status

Specifies which quota types (user, group, or fileset) are enabled.


The following is an example of the showfsets command display of 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.1.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.3.8001
Files : 48202, SLim= 0, HLim= 0
Blocks (512) : 1341436, SLim= 0, HLim= 0
Quota Status : user=on group=on

The following is a showfsets command display of 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

Renaming a Fileset


Top of Page - Previous Section - Next Section

An existing fileset can be assigned a new name. Filesets are actually 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 only a fileset attribute that you assign. When you rename a fileset, the fileset identifier is not changed.

Before renaming a fileset, unmount the fileset. You can then rename a fileset by issuing the renamefset command using the following format:

renamefset domain_name old_fileset_name new_fileset_name

For example, to rename the mkting fileset to the advting fileset, issue the following command:

# renamefset domain_1 mkting_fs advting_fs

After renaming a fileset, update the corresponding entries in the /etc/fstab file to automatically mount the renamed fileset.

Note Clones of the fileset are not renamed when you rename the fileset.


Removing a Fileset


Top of Page - Previous Section - Next Section

Filesets can be deleted from a file domain when they are no longer needed. Once filesets are removed, they cannot be remounted. All files in the fileset are destroyed and the data cannot be accessed.

Filesets must be unmounted before they can be removed and cannot have any existing clones. You can then remove a fileset by issuing the rmfset command using the following format:

rmfset domain_name fileset_name

For example, to remove the tmp_1 fileset in domain_1, issue the following commands:

# rmfset domain_1 tmp_1

rmfset: remove fileset fileset_name? [Y/N]y

Note If you are removing an entire file domain, you do not need to remove the filesets first. Removing the file domain will destroy all filesets in the process.


Cloning a Fileset


Top of Page - Previous Section - Next Section

A clone fileset is a read-only snapshot of fileset data structures (metadata). When you clone a fileset, the utility copies only the structure of the original fileset, not the actual data. When a file is modified or removed, the file system copies the original, unchanged data to the clone fileset. Pages that are not modified are not copied to the clone. (This concept 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.

Clone filesets are useful for the following:

Figure 2 Cloning a Fileset

Cloning a Fileset

Creating a Clone Fileset


Top of Page - Previous Section - Next Section

To create a clone fileset, issue the clonefset command using the following format, where the clone_name is the name of the clone to be created:

clonefset domain_name fileset_name clone_name

Each clone must have a unique name of up to 31 characters. All white space characters are invalid, as are the slash (/), pound (#), colon (:), asterisk (*), and question mark (?). The same clone name can be repeated in different file domains, but every fileset must have a unique mount point.


Mounting a Clone


Top of Page - Previous Section - Next Section

AdvFS fileset clones must be mounted in order to access them. To mount a clone, use the mount command. Identify the clone and mount point using the following format:

mount domain_name#clone_name mnt_point

To unmount a clone, use the standard umount command using the following format:

umount mnt_point

Renaming a Clone


Top of Page - Previous Section - Next Section

Clone filesets cannot be renamed. To assign a different name to a clone, delete 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.)


Removing a Clone


Top of Page - Previous Section - Next Section

Clones can be deleted from a file domain when they are no longer needed. Once clones are removed, they cannot be remounted. All files in the clone are destroyed and the data cannot be accessed.

Clones must be unmounted before they can be removed. You can then remove a clone by issuing the rmfset command using the following format:

rmfset domain_name clone_name

For example, to remove the tmp_clone clone in domain_1, issue the following command:

# rmfset domain_1 tmp_clone

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

Volumes


Top of Page - Previous Section - Next Section

In AdvFS, 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. When initially created, all file domains consist of a single volume. If you have the optional AdvFS Utilities, you can transform a single-volume file domain into a multivolume file domain by adding one or more volumes.

A volume can be assigned to only one file domain. It is associated with its file domain by the file domain ID 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.

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. Also, the number of links to the volumes in the /etc/fdmns file must equal the number of volumes identified in the domain attributes table.

Inconsistencies in these numbers can occur in a number of ways and for a nnumber of reasons. The advscan command can be used to attempt to correct these inconsistencies for a file domain if you set the -f flag. If you attempt to mount a fileset from an inconsistent file domain, a message similar to the following will be displayed:

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

Volume Structure


Top of Page - Previous Section - Next Section

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

In addition to these structures, each file domain also 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.


Volume Attributes


Top of Page - Previous Section - Next Section

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 as follows:

You can display or modify the current volume attributes by issuing the chvol command using the following format:

chvol [options] device_name file_domain

Modifying these default attributes can improve performance in some system configurations. Possible modifications include the following:


Adding Volumes


Top of Page - Previous Section - Next Section

You can create a multivolume file domain to increase the disk capacity of an existing file domain and to perform preventative disk maintenance. Adding volumes to a file domain does not affect the logical structure of the filesets within the file domain. You can add volumes to a file domain without reconfiguring the directory hierarchy layer of the file system.

A newly created file domain consists of one volume, which can be a disk, disk partition, or logical volume. The addvol utility enables you to increase the number of volumes within an existing file domain. Use the following format to add a volume to a file domain:

addvol device_name domain_name

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.

Adding one partition (typically, partition c) to a file domain is preferable to adding several partitions (such as a, b, g, h). 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. While up to 250 volumes per file domain are allowed, limiting the number of volumes to three decreases the risk of disk errors that can cause the entire file domain to become inaccessible.


Overlapping Partitions on Mounted File Systems


Top of Page - Previous Section - Next Section

You cannot add a volume that would overlap a mounted file system. If you try to add a volume that would cause partitions to overlap with any other 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. The following example shows the error message:

# addvol /dev/rz3b big_domain

New file system would overlap mounted filesystem(s),
swap area or reserved partition(s)
Unmount/relabeling required before creating /dev/rrz3b (start 131072 end 393215)
/dev/rz3b in use as swap (start 131072 end 393215)
addvol: Can't add volume '/dev/rz3b' to file domain 'big_domain'

Overlapping Partitions on Unmounted File Systems


Top of Page - Previous Section - Next Section

You can 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, AdvFS prompts you to confirm the action. If you confirm, the disk label will be overwritten and the new volume added to the AdvFS file domain. The following example shows the confirmation message:

# addvol /dev/rz2c domain_1
Partition(s) which overlap /dev/rz2c are marked in use.

If you continue with the operation you can possibly destroy existing data.
CONTINUE? [y/n]y

If you want to overwrite partitions that already have a disk label but do not want to be prompted to continue each time, use the addvol -F command. Using the -F flag allows the volume to be added and overwrites any partition that has a disk label but is not mounted. (AdvFS will not overwrite mounted file systems.)


Removing a Volume


Top of Page - Previous Section - Next Section

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.

To remove a volume, issue the rmvol command using the following format:

rmvol device_name domain_name

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 without damaging your file domain. AdvFS will stop removing files from the volume. Files already removed from the volume will remain in their new location.

Note If a volume does not allow writes after an aborted rmvol operation, use the chvol command with the -A flag to reactivate the volume.

If you remove a 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 Creating Striped Files for details on file striping.


Locating AdvFS Partitions


Top of Page - Previous Section - Next Section

The advscan command locates parts of AdvFS file domains on disk partitions and in LSM disk groups. This command is useful:

The advscan command accepts a list of devices or disk groups and searches all partitions and volumes in each. To determine if a partition is part of an AdvFS file domain, the advscan command performs the following functions:

The advscan command displays the date the file domain was created, the on-disk structure version, and the last known or current state of the volume.

Options for the advscan command allow you to recreate missing file domains from the /etc/fdmns directory, missing links, or the entire /etc/fdmns directory. Or you can rebuild the /etc/fdmns directory manually by supplying the names of the partitions in each file domain. See the advscan(8) reference page for details on all options.

To locate AdvFS partitions, issue the advscan command using the following format:

advscan [options] disks

In the following example, the command scans devices rz3 and LSM disk group rootdg for AdvFS partitions:

# advscan rz3 rootdg
Scanning devices /dev/rrz3 /dev/rvol/rootdg
Found domains:
usr_domain
domain Id 2e09be37.0002eb40
Created Thu Jun 23 09:54:15 1994
domain volumes 2
/etc/fdmns links 2
Actual partitions found:
rz3g
rootdg.vol03

Moving Files to Different Devices


Top of Page - Previous Section - Next Section

Two methods are available for moving files from one device to another. The method you use depends on whether you have the optional AdvFS Utilities product.

If you do not have the optional AdvFS Utilities product, use the following steps to move files to a new file domain created on a different device. Because files that are being modified at the time of the copy may not copy correctly, consider mounting the filesets to be moved as read-only or keeping users from accessing the target filesets before completing the steps.

  1. Make a new file domain on the new device.
  2. Create filesets in the new file domain for each of the old filesets you will move to the new file domain. Mount the filesets on temporary mount points.
  3. Copy all of the files from the old mounted filesets to the new mounted filesets. Unmount the old filesets.
  4. Mount the new filesets using the mount points of the old filesets. The directory tree will then be unchanged.
  5. Rename the filesets and file domain to be the same as the old ones.

Alternatively, if you have the optional AdvFS Utilities product, use the following steps to move the filesets to a different device. This can be accomplished without interrupting the users and without concern that files are being added, deleted, or modified while the move is occurring.

  1. Use the addvol command to add a new volume to the existing file domain.
  2. Use the rmvol command to remove the volume you want to take out of the file domain. All files will be automatically migrated from the old volume and relocated on the remaining volumes.
  3. Run the balance command to even the distribution of the files among the new and remaining volumes in the file domain. See Balance Utility for details on balancing file domains.

Setting Up AdvFS


Top of Page - Previous Section - Next Section

As you begin configuration planning, decide whether you want to set up AdvFS to resemble a traditional UFS configuration. If you have experience with the UFS model, you may want to use that model initially. Once you become more familiar with AdvFS, you can begin to move away from the traditional model.

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.

Note The AdvFS root file domain is currently limited to one volume.


Setting Up a Single-Volume File System


Top of Page - Previous Section - Next Section

The following procedure describes how to set up an active, single-volume file system. Creating a single-volume file domain with a single fileset is equivalent to creating a traditional UFS file system. With AdvFS, you can modify the file system size whenever the storage requirements change.

  1. Create a single-volume file domain by using the mkfdmn command. Then, you can add more volumes to an existing file domain by using the addvol utility.
  2. Create one or more filesets by using 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. (Naming the fileset with the same name as the mount point is recommended but is not required.)
  3. Create the mount-point directory by using the mkdir command.
  4. Mount each fileset by using the mount command.

Figure 3 Single-Volume File Domain

Single-Volume File Domain

The following examples set up active, single-volume file systems with different configurations using AdvFS.

The following example creates a file system with volume /dev/rz3c and directory /staff available for use with AdvFS. First, the domain_1 file domain is created. Then, the staff fileset is created in domain_1. Finally, the staff fileset is mounted at the /staff mount point.

# mkfdmn /dev/rz3c domain_1
# mkfset domain_1 staff_fs
# mkdir /staff
# mount domain_1#staff_fs /staff

The following example creates a single-volume file domain, domain_2, and two filesets, tmp 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 file systems. First, the domain_2 file domain is created. Then, the tmp and public filesets are created in domain_2. Last, the tmp and public filesets are mounted on their mount points.

# mkfdmn /dev/rz2c domain_2
# mkfset domain_2 tmp_fs
# mkfset domain_2 public_fs
# mkdir /public
# mount domain_2#tmp_fs /tmp
# mount domain_2#public_fs /public

Setting Up a Multivolume File Domain


Top of Page - Previous Section - Next Section

You can set up a multivolume file domain by setting up a single-volume file domain and immediately adding additional volumes. The following procedure describes how to set up an active, multivolume file system:

  1. Create a single-volume file domain by using the mkfdmn command.
  2. Add one or more volumes using the addvol command.
  3. Create one or more filesets by using 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.
  4. Create the mount-point directory by using the mkdir command.
  5. Mount each fileset by using the mount command.

Figure 4 Multivolume File Domain

Multivolume File Domain

The following example creates a multivolume file domain, domain_1, with volumes /dev/rz1c and /dev/rz2c, and then creates and mounts the public_fs fileset:

# mkfdmn /dev/rz1c domain_1
# addvol /dev/rz2c domain_1
# mkfset domain_1 public_fs
# mkdir /public
# mount domain_1#public_fs /public

The following example creates a multivolume file domain using two volumes created with LSM. First the file domain, domain_2, is created with two LSM volumes, /dev/vol/vol01 and /dev/vol/vol02, and then the develop_fs fileset is created and mounted:

# mkfdmn /dev/vol/vol01 domain_2
# addvol /dev/vol/vol02 domain_2
# mkfset domain_2 develop_fs
# mkdir /develop
# mount domain_2#develop_fs /develop

You can enlarge a file domain by adding an LSM volume. You first create the volume using LSM, then add the volume to the file domain using the addvol command.

The following example creates a 300-MB, mirrored LSM volume and adds that to the usr_domain file domain:

# volassist -U fsgen make v3_mirr 300m nmirror=2
# addvol /dev/vol/rootdg/v3_mirr usr_domain

You can remove an LSM volume from a file domain using the rmvol command. You must specify the complete path name of the LSM volume.

The following example removes the v3_mirr volume from the usr_domain file domain:

# rmvol /dev/vol/rootdg/v3_mirr usr_domain

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


Setting Up a File Domain with LSM Volumes


Top of Page - Previous Section - Next Section

You can use volumes created with the Logical Storage Manager (LSM) when creating or adding to an AdvFS file domain. You first create the volume using LSM. Then, create the file domain using the LSM volume, or add the LSM volume to an existing file domain. See the LSM manual for details on creating LSM volumes.

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

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

Creating a Domain for a Large Number of Files


Top of Page - Previous Section - Next Section

File systems that contain a very large numbers of files (over 50,000), such as Usenet news servers, require a change in the file-domain configuration. For these file systems, the standard AdvFS metadata extent size allocation may be inadequate, resulting in erroneous "out of disk space" error messages. By altering the extent size allocation when creating the file domain, you can accommodate the large number of files.

In AdvFS, the fileset data structure (metadata) is stored in a file called the bitfile metadata table (BMT). The BMT is equivalent to the UFS inode table except that the UFS inode table is statically allocated. To save space, AdvFS grows the BMT by extents of 128 pages each time additional metadata extents are needed. Handling many small files causes the system to request metadata extents more frequently, causing the metadata to become fragmented. Because the number of extents that describe the BMT is a fixed size resource, the file domain will appear to be out of disk space when in reality the BMT cannot be extended to map new files.

You can reduce the amount of metadata fragmentation in one of two ways: by increasing the number of pages the system attempts to grow the metadata table each time more space is needed or by preallocating all of the space for the metadata table when the file domain is created.

To preallocate all of the metadata table space you expect the file domain to need, use the mkfdmn command with the -p flag set to specify the number of pages to preallocate. Space that is preallocated for the metadata table cannot be deallocated so do not preallocate more space than you need for the metadata table. Table 5 provides suggested metadata table page estimates for numbers of files. Choose the number of pages from the Metadata Table Size column that corresponds to the number of files you expect the file domain to handle. Then create the file domain using the following format:

mkfdmn -p number_pages device domain_name

To configure the file domain to grow by more than 128 pages each time additional metadata extents are needed, create the file domain using the mkfdmn command along with the -x flag. Specify a number of metadata pages greater than 128. Table 5 provides suggested extent size estimates for numbers of files. Choose the number of pages from the Suggested Extent Size column that corresponds to the number of files you expect the file domain to handle. Then create the file domain using the following format:

mkfdmn -x number_pages device domain_name

You can set the extent size to any value, but Table 5 suggests extent sizes based on the number of files you anticipate and shows the resulting size of the metadata table. Table 5 provides guidelines for up to 800,000 files.

Table 5 Suggested Extent Sizes

Number of Files

Suggested Extent Size
(in Pages)

Metadata Table Size
(in Pages)

Less than 50,000

default (128)

3,600

100,000

256

7,200

200,000

512

14,400

300,000

768

21,600

400,000

1024

28,800

800,000

2048

57,600

Note To get the maximum benefit from increasing the number of metadata table extent pages, use the same number of pages when adding a volume with the addvol command as assigned when the file domain was created with the mkfdmn command.


Configuring an AdvFS Root File System


Top of Page - Previous Section - Next Section

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 the Installation Guide for Digital UNIX for instructions on installing AdvFS as the root file system during the initial installation. See Converting the Root File System for instructions on converting an existing UFS root file system to AdvFS.


Mounting the Root File System in Single-User Mode


Top of Page - Previous Section - Next Section

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 using the following format:

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.


Changing the Name of the Root File Domain


Top of Page - Previous Section - Next Section

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. Thus, to change the name of your root domain, use the mv command to rename root_domain to whatever name you want. Then use an editor to rename the root file domain entry in the /etc/fstab file.


Changing the Name of the Root Fileset


Top of Page - Previous Section - Next Section

Fileset names are stored in the domain and can be changed with the renamefset utility. You can only change the fileset name of an unmounted fileset.

Because you cannot unmount the root fileset, you must use an alternative bootable system. In the alternate root file system, create an entry in the /etc/fdmns directory for the root file domain containing the root fileset that you want to change. You can then direct the renamefset utility to change the name of the root fileset in the non-mounted root domain.

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/rz2a.

  1. Boot a root file system other than the one you want to change. (It can be UFS.)
  2. Make an entry in the /etc/fdmns directory of the mounted root for the root file system whose fileset name you want to change. In this example the root domain is named tmp_root_domain:
    # 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/rz2a
  4. Use the renamefset command to rename the fileset. In this example the fileset is renamed from root_fs to new_root:
    # renamefset tmp_root_domain root_fs new_root
  5. Mount the changed root to update the /etc/fstab file:
    # mount tmp_root_domain#new_root /mnt
  6. Edit the /etc/fstab entry for tmp_root_domain:
    # cd /mnt/etc
    # vi fstab
    Change the line:
    root_domain#root_fs / advfs rw 0 0
    to:
    root_domain#new_root / advfs rw 0 0
  7. Reboot the AdvFS system.

Note Remember, 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 the ed command or vi command in open mode.


Changing the File Domain Size


Top of Page - Previous Section - Next Section

AdvFS allows you to increase or decrease the amount of storage available to users and applications by adding or removing volumes in a file domain. Both adding and removing volumes can be accomplished while all filesets in the file domain are mounted and without interrupting users or applications. Path names and directories for files do not change, so both tasks are completely transparent to users.

Adding volumes enables you to create a multivolume file domain, increase the disk capacity of an existing file domain, 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.

You can also remove a volume from a file domain when the storage is no longer needed. When you remove a volume, AdvFS automatically migrates files to remaining volumes with no interruption to users or applications.

After mounting all filesets in the file domain, use the addvol command to add volumes or the rmvol command to remove volumes using the following format:

addvol device_name domain_name
rmvol device_name domain_name

Enlarging an Existing File Domain


Top of Page - Previous Section - Next Section

You can expand a file domain by adding another disk to the file domain or, alternatively, you can replace one of the disks in the file domain with a larger disk.

The following example shows how to replace one disk of the domain_1 file domain with a larger disk. Using the showfdmn command, you can display the contents of the file domain and the current disk capacity of each volume:

# showfdmn domain_1       

Id Date Created LogPgs Domain Name
2bb0c594.00008570 Wed Mar 24 12:33 1995 512 domain_1
Vol 512-Blks Free % Used Cmode Rblks Wblks Vol Name
1L 832527 79210 90% on 128 128 /dev/rz1c
2 832527 1684 98% on 128 128 /dev/rz2c
---------- ----- -----
1665054 80894 94%

By replacing the /dev/rz2c volume with a larger volume, you increase the disk capacity of the file domain. To do this, add the new volume, /dev/rz3c, to the file domain and then remove the /dev/rz2c volume. Neither adding nor removing volumes affects the directory hierarchy layer; all path names for the users remain the same. Also, the file system can remain active during the disk exchange. Running the balance utility after adding and removing volumes evens the file distribution between the volumes. It is not required.

# addvol /dev/rz3c domain_1
# rmvol /dev/rz2c domain_1
# balance domain_1

Figure 5 Enlarging a File Domain

Enlarging a File Domain

Reducing the Size of an Existing File Domain


Top of Page - Previous Section - Next Section

You can reduce the size of a file domain by removing a disk from a file domain or, alternatively, you can replace one of the disks in the file domain with a smaller disk.

The following example shows how to remove one disk of the domain_2 file domain. Using the showfdmn command, you can display the contents of the file domain and the current disk capacity of each volume:

# showfdmn domain_2        
Id Date Created LogPgs Domain Name
2bb0c594.00008570 Wed Nov 2 10:23 1995 512 domain_2
Vol 512-Blks Free % Used Cmode Rblks Wblks Vol Name
1L 832527 386984 54% on 128 128 /dev/rz1c
2 832527 647681 22% on 128 128 /dev/rz2c
3 832527 568894 32% on 128 128 /dev/rz3c
---------- ------ -----
2497581 1603559 36%

By removing the /dev/rz2c volume, you decrease the disk capacity of the file domain. Removing the volume does not affect the directory hierarchy layer; all path names for the users remain the same. Also, the file system can remain active during the disk removal. Running the balance utility after removing the volume evens the file distribution between the volumes. It is not required.

# rmvol /dev/rz2c domain_2
# balance domain_1

Creating Striped Files


Top of Page - Previous Section - Next Section

AdvFS file striping allows you to increase sequential read/write performance by allocating storage in segments across more than one disk.

File striping, in contrast to disk striping, allows you to stripe individual files according to your needs, without preconfiguring the disks. File striping offers the same performance enhancements for the striped file as disk striping.

Figure 6 Creating Striped Files

Creating Striped Files

Using the stripe utility, you can direct a file to distribute segments across specific disks (or volumes) within a file domain. Zero-length files are striped before data is written to the file. As the file is appended, AdvFS determines the number of pages per stripe segment; the segments alternate among the disks in a sequential pattern. For example, the file system allocates the first segment of a two-disk striped file on the first disk and the next segment on the second disk. This completes one sequence, or stripe. The next stripe starts on the first disk, and so on. Because AdvFS spreads the I/O of the striped file across the specified disks, the sequential read/write performance of the file increases.

To set up stripe files, first create an empty file. Then, using the stripe utility, specify the number of volumes in the file domain over which the file should be striped. Issue the stripe command using the following format:

stripe -n volume_count filename

For example, the following steps stripe the zero-length (empty) file abc over all three volumes in the file domain:

# touch abc
# stripe -n 3 abc

To stripe an existing file, you must:

  1. Create a new, empty file.
  2. Stripe the new, empty file.
  3. Copy the contents of the old file into the striped file.

The following example stripes file foo, which already contains data, across two volumes in the file domain:

# touch newfoo
# stripe -n 2 newfoo
# cp foo newfoo

Using Trashcans


Top of Page - Previous Section - Next Section

End users can configure their systems to retain a copy of files they have deleted. Trashcan directories can be attached 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 deleted from a directory with a trashcan attached can be returned to the original directory with the mv command.

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

Table 6 lists and defines the commands for setting up and managing trashcans:

Table 6 Trashcan Commands

Command Name

Use

Syntax

mktrashcan

Creates the trashcan.

mktrashcan trashcan_name directory

shtrashcan

Shows the contents of the trashcan.

shtrashcan directory

rmtrashcan

Removes the trashcan directory.

rmtrashcan directory

Note Deleted files in an attached trashcan count against your quota. When you delete files in the trashcan directory, they are unrecoverable.


Using AdvFS with LSM


Top of Page - Previous Section - Next Section

AdvFS can be used with the Logical Storage Manager (LSM) to provide additional volume-management capabilities. LSM is a disk-management tool that allows you to create mirrored volumes and striped volumes, and to perform other volume-management functions. Use LSM to create and manage the volumes that you use in AdvFS file domains. AdvFS treats LSM volumes just like any other volume such as disks or disk partitions.

In general, use LSM for its volume-management capabilities, such as:

Use AdvFS to manage file systems and file-level activities:


Setting up AdvFS with LSM Volumes


Top of Page - Previous Section - Next Section

To use LSM with AdvFS, you generally first create the LSM volumes with the desired attributes. LSM options include mirrored volumes, striped volumes, or mirrored and striped volumes. Then, you can create a file domain using the mkfdmn command and identifying the LSM volume as the initial volume. To create a multivolume file domain, you can then add an LSM volume to an AdvFS file domain using the addvol command just as you would any other volume.

If you already have an AdvFS file domain, you can encapsulate this data into LSM using the encapsulation tools. See the LSM manual for further information.

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 include LSM volumes in the file-domain information display. In addition, you can use the advscan command to locate AdvFS volumes in LSM disks groups.

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


Examples of Using LSM with AdvFS


Top of Page - Previous Section

The following are examples of how to set up AdvFS file domains with LSM volumes. In each example the volume is created with the desired attributes using LSM. Then an AdvFS file domain is created with the LSM-configured volumes.

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

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

The following example creates a file domain with mirrored LSM volumes:

# volassist make vol03 500m mirror=yes
# volassist make vol04 500m mirror=yes nmirror=3
# mkfdmn /dev/vol/vol03 safe_domain
# addvol /dev/vol/vol04 safe_domain
# mkfset safe_domain safe_fset1

The following example creates a striped LSM volume and then creates a striped AdvFS file domain:

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

Home - - Previous Chapter - Next Chapter - Top of Page
© Copyright Digital Equipment Corporation 1996
All rights reserved