2    Setting Up the File System

Once you have determined the configuration of your file system, you can create and structure it. This chapter discusses the following topics:

2.1    Overview

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

To create an active domain, do the following:

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

  2. Create a fileset (Section 2.4.3).

  3. Create a mount-point directory (Section 2.4.5).

  4. Mount a fileset (Section 2.4.5).

You can create one fileset per domain or you can create many. See Section 1.4.1 for guidelines.

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

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

2.2    Volumes

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

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

See Section 2.3 for information on how to associate volumes with domains.

2.2.1    Volume Attributes

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

To display or modify the current volume attributes, use the SysMan Menu utility called Manage an AdvFS Domain (see Appendix A), or enter the chvol command from the command line:

chvol device_name domain_name

The chvol command supports shorthand names for LSM volume names. The following commands are equivalent:

# chvol dom1 testdg.vol1
# chvol dom1 /dev/vol/testdg/vol1 

You can change the attributes of a volume in an active domain at any time; the system does not have to be quiescent. See Chapter 5 and the System Configuration and Tuning manual for more complete information on modifying attributes to improve system performance.

2.3    Domains

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

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

2.3.1    The /etc/fdmns Directory

The /etc/fdmns directory defines domains by providing a subdirectory for each domain you create. The domain name is defined by a directory entry. When you create a domain, the directory entry is created. The subdirectories contain a symbolic link to every volume in the domain.

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

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

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

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

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

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

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

2.3.2    Displaying Domain Information

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

showfdmn domain_name

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

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

To examine disk usage and quota values, see Section 3.4.

2.3.3    Creating Domains

The first step in setting up an AdvFS file system is creating a domain and assigning an initial volume to it. However, a domain is not a complete file system that you can mount. To mount an AdvFS file system, the domain must contain one or more filesets. You can access files as soon as you mount one or more filesets. (See Section 2.4.) For the advantages and disadvantages of different domain and fileset configurations, see Section 1.4.1.

To convert a UFS file system to AdvFS or to configure the root domain as AdvFS, see Appendix C.

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

mkfdmn volume_name domain_name

Figure 2-1:  Single-Volume Domain

If you create a domain on a partition and it overlaps with a partition that has an entry in the /etc/fdmns directory (that is, the partition is associated with a domain), you get an error message. You can override the message. Alternatively you can execute the mkfdmn command with the -F option to bypass this test.

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

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

The mkfdmn command supports shorthand names for LSM volume names. The following commands are equivalent:

# mkfdmn dom1 testdg.vol1
# mkfdmn dom1 /dev/vol/testdg/vol1 

2.3.3.1    Domain Version Numbers

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

All domains that were created in operating systems prior to Version 5.0 are recognized by later versions but are not automatically upgraded to the new structure.

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

DVN4 domains have an improved disk structure that provides support for quota values larger than two terabytes and increases performance for directories containing thousands of files. DVN4 domains automatically have an index created when the directory grows beyond a page, that is, about 200 files. Directories with more than 5000 files show the most benefit. Execute the showfile command to determine if a directory is indexed. Use the -i option to display information about the index. See showfile(8) for more information.

2.3.3.2    Creating Domains with DVN4

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

If you perform an update installation from a system running Version 4 of the operating system, all existing domains retain the DVN of 3. Thus /root, /usr, and /var also have a DVN of 3. No conversion utility exists. To move your data to a DVN4 domain, see Section 2.3.3.4.

To create an active single-volume DVN4 domain, do the following:

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

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

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

  4. Mount each fileset by using the mount command.

Caution

Do not use the mkfdmn command on a volume containing data that you want to keep. Executing the command destroys the data on that volume. If you have accidentally used the mkfdmn command, you might recover some of your data by using the /sbin/advfs/salvage utility if the volume is an AdvFS volume. (See Section 6.2.6.)

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

# mkfdmn /dev/disk/dsk2c domain_2 
# mkfset domain_2 fileset_a
# mkfset domain_2 fileset_b
# mkdir /fileset_a 
# mkdir /fileset_b 
# mount domain_2#fileset_a /fileset_a
# mount domain_2#fileset_b /fileset_b

You can set up a domain with various kinds of storage. See Section 1.5 for more information. If you have AdvFS Utilities, you can change the size of your domain by adding more volumes. You can transform a single-volume domain (except a non-cluster root domain) into a multivolume domain. Use the SysMan Menu utility called Manage an AdvFS Domain (see Appendix A), the AdvFS GUI (see Appendix E), or see Section 2.3.4.

2.3.3.3    Creating Domains with DVN3

You can create a DVN3 domain on a Version 5 system. Execute the mkfdmn command with the -V3 option. This is useful if you need backward compatibility.

For more information about creating a DVN3 domain, see mkfdmn(8). See Section 2.4.5 for directions on mounting the DVN3 domain you have created.

2.3.3.4    Upgrading Domains to DVN4

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

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

  2. Unmount the old domain and remove it by using the rmfdmn command.

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

  4. Create the new filesets by using the mkfset command and mount them.

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

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

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

2.3.4    Increasing the Size of Domains

You can expand a domain by doing any of the following:

Neither increasing nor decreasing size affects the directory hierarchy layer; all pathnames for the files remain the same. The file system can remain active during the process.

Except in a cluster configuration, the root domain is restricted to one volume. If you need to increase the size of your root domain, depending on your volume, you can increase the underlying storage and notify the domain, or you can follow the procedure in Section 6.4.9 to change the device on which root is located.

Unless quotas are set, every fileset in the domain can access the available storage. (See Chapter 3 for a discussion of quotas.)

2.3.4.1    Increasing Storage in Domains by Adding Volumes

A newly created domain consists of one volume, which can be a disk, disk partition, or logical volume. If you have AdvFS Utilities, you can increase the size of the domain by adding one or more volumes. Figure 2-2 shows a graphic illustration of adding volumes to a domain. The volume you add initially contains no data. Once the volume is added, information will be stored on it as a result of adding files to the domain, as the vfast utility operates (see Section 5.8), if you migrate files to it (see Section 5.12), and if you balance the domain (see Section 5.11).

Figure 2-2:  Enlarging a Domain

To add volumes, use the SysMan Menu utility called Manage an AdvFS Domain (see Appendix A), a graphical user interface (see Appendix E), or enter the addvol command from the command line:

addvol device_name domain_name

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

# addvol /dev/disk/dsk3c resources

The addvol command supports shorthand names for LSM volume names. The following commands are equivalent:

# addvol dom1 testdg.vol1
# addvol dom1 /dev/vol/testdg/vol1 

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

Performance might improve if, instead of increasing the size of a DVN3 domain, you upgrade to the new file structure (Section 2.3.3.4) before increasing its size.

You cannot add a volume to the root domain unless you are running a cluster. (See the Cluster Administration manual.) If you are running a cluster configuration, you add another root volume the same way that you add any volume. If you are not running a cluster and need to increase the size of the root domain, see Section 6.4.9.

Caution

Do not use the addvol command to add a volume containing data that you want to keep. Executing the command destroys the data on that volume. If you have accidentally used the addvol command, you might recover some of your data by using the /sbin/advfs/salvage utility. (See Section 6.2.6.)

To add volumes to a domain, do the following:

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

  2. Add the new volume to the domain.

    If you add a partition and it overlaps with a partition that has an entry in the /etc/fdmns directory (that is, the partition is associated with a domain), you get an error message. You can override the message. Alternatively you can use the addvol command with the -F option to bypass this test. See addvol(8) for more information.

    Caution

    Use the -F option with extreme caution. Disabling the overlap check can result in extensive data loss. (See addvol(8).)

  3. If you are not running the vfast utility (see Section 5.8), it is a good idea to run the balance utility to even the file distribution between the volumes.

The following example adds one disk, the volume /dev/disk/dsk3c to domain_1:

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

2.3.4.2    Increasing Storage in Domains by Exchanging Volumes

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

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

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

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

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

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

  6. Unmount the old and new filesets.

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

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

2.3.4.3    Increasing Storage in Domains by Extending an Existing Volume

You can increase the amount of storage available in your domain by enlarging the size of an existing volume. For example, LSM and hardware RAID controllers support dynamically increasing the size of a volume. Because expanding the size of an LSM or hardware RAID volume is done independently of AdvFS, you must notify the domain when the size of a volume changes by using the mount command with the -o extend option. You only need to mount one fileset with this option to increase the size of the domain.

If the fileset is not already mounted, enter:

mount -o extenddomain#fileset /mount_point

If the fileset is already mounted, enter:

mount -u -o extenddomain#fileset /mount_point

When the -o extend option is used, all additional storage is available to all filesets in the domain.

Note

Increasing the size of a domain by extending a volume is unidirectional. AdvFS does not support shrinking volumes.

2.3.5    Reducing the Size of Domains

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

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

You can only use AdvFS commands to reduce the size of a domain. No analog to the mount command with the -o extend option exists to indicate to a domain that the storage has been reduced.

Caution

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

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

rmvol device_name domain_name

For example, to remove dsk3c from the domain inventory:

# rmvol /dev/disk/dsk3c inventory

The rmvol command supports shorthand names for LSM volume names. The following commands are equivalent:

# rmvol dom1 testdg.vol1
# rmvol dom1 /dev/vol/testdg/vol1 

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

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

To reduce the size of a domain:

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

  2. Remove the volume.

  3. If you are not running the vfast utility, it is a good idea to run the balance utility to even the file distribution between the remaining volumes. This step is not required.

You cannot remove a volume from a domain that you are balancing or defragmenting or that the vfast utility is balancing or defragmenting.

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

# showfdmn domain_2 
  Id              Date Created     LogPgs Version Domain Name
2bb0c594.00008570 Fri Apr 26 10:23 2002 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

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

2.3.6    Removing Domains

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

You can use the rmfdmn command to remove a domain and inactivate filesets. This might present a security hole because the command changes no data on the volumes. You might be able to access your data by using the /sbin/advfs/salvage command. (See Section 6.2.6.) Instead, use the rmfset command to remove each fileset. (See Section 2.4.7.)

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

rmfdmn domain_name

For example, to remove the domain promotions:

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

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

2.3.7    Renaming Domains

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

  1. Unmount all the filesets and any related clones.

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

    # mv /etc/fdmns/old_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 domain.

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

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

Locate the following in the /etc/fstab file:

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

Edit this line as follows:

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

Mount the fileset:

# mount /fset

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. You mount AdvFS filesets. Filesets contain files, are units on which you enable quotas, and are units for backing up data.

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

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

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 must be unique within a domain. You cannot use slash (/), number (#), colon (:), asterisk (*), question mark (?), tab, newline, form feed, return, vertical tab, and space characters. Filesets that are not in the same domain can have the same name.

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

Each fileset has a unique fileset ID composed of the domain ID and a fileset tag. Each domain has its own series of fileset tags.

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

2.4.1    Designating Filesets in the /etc/fstab File

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

The fileset entry includes the domain name, fileset name, mount point, file system type, and the mount-point options. If you want to enable user and group quotas (see Section 3.2), include the userquota and groupquota options and the pass field numbers. No spaces can be left in the list of options delimited by commas; that is, from rw through groupquota.

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

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

acct_124#crdt /crdt advfs rw,userquota,groupquota 0 2 

If you want only to add group quotas, for example, do not include the user quota designation. In this case the fileset entry would be:

acct_124#crdt /crdt advfs rw,,groupquota 0 2 

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

You can relocate the quota.user and quota.group files to subdirectories of the fileset. However, you cannot relocate them to other filesets nor delete them. If you relocate your files, you must update the /etc/fstab file entry to include the path and name of the relocated files in the userquota and groupquota parameters.

For example, to relocate the quota.user file to the d4 subdirectory in the crdt fileset and rename it nq, change the /etc/fstab entry to:

acct_124#crdt /crdt advfs rw,userquota=/d4/nq,groupquota 0 2

In this example, the group quota file is not moved.

2.4.2    Displaying Fileset Information

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

showfsets domain_name

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

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

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

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

You can use a graphical user interface to obtain similar information. (See Appendix E.)

2.4.3    Creating Filesets

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

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

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

mkfset domain_name fileset_name

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

# mkfset advertising coupons 

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

See also Section 2.3.3, which explains domains.

2.4.4    Upgrading Filesets

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

You cannot mount DVN4 filesets on operating system versions earlier than Version 5.0 unless you NFS mount them from a server running Version 5.0 or later of the operating system software. See Section 6.4.6 for information on avoiding other incompatibilities.

2.4.5    Mounting Filesets

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

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

mount domain_name#fileset_name mount_point

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

# mkdir /coupons 
# mount advertising#coupons /coupons 

To automatically mount your fileset at reboot, it must be entered in the /etc/fstab file, as described in Section 2.4.1.

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

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

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

You can specify temporary atomic-write data logging in your mount operation. (See Section 5.5.)

2.4.6    Unmounting Filesets

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

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

umount mount_point

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

# umount /coupons

2.4.7    Removing a Fileset

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

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

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

rmfset domain_name fileset_name

For example, to remove the tmp_1 fileset in domain_1:

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

The most secure way to remove all filesets in a domain is by using the rmfset command. The utility destroys pointers to the metadata for all the files in the fileset so you cannot recover them by using the /sbin/advfs/salvage utility. (See Section 6.2.6.) It is faster to delete filesets by using the rmfdmn command to remove the domain. However, if you do this, you might be able to access some of the data, because the rmfdmn command removes the definition of the domain in the /etc/fdmns directory and relabels the volumes, but it does not alter any data on the volume.

2.4.8    Renaming Filesets

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

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

renamefset domain_name old_fileset_name new_fileset_name

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

For example, to rename the sad fileset in dmn_1 that is mounted at /mount_point to happy using the command line and vi editor:

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

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

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

Edit this line as follows:

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

Mount the fileset:

# mount /mount_point

Note

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

2.4.9    Changing the Characteristics of Filesets

You can change fileset characteristics with the chfsets command. Change the fileset quota limits by using the -F, -f, -B, and -b options. (See Section 3.3.2.) Use the -o option to turn fragment files on and off (Section 5.2), to enable or disable object safety (Section 6.4.11), and to enable or disable the data management API (DMAPI) (Appendix D).

2.4.10    AdvFS Fileset Clones

If you have the optional AdvFS Utilities license, and you are root user, you can back up your files using an AdvFS fileset clone. A fileset clone is a read-only snapshot of fileset structure information (metadata). When you clone a fileset (create a fileset clone), the utility copies only the structure of the original fileset, not the actual data. When a file is modified, the file system copies the original, unchanged data to the AdvFS fileset clone. Therefore a copy of the system as it was at the time of creating the clone remains for the life of the clone. (This process is called copy-on-write.)

The only data in the fileset clone is a copy of data that has been modified, so the fileset clone is usually smaller than the original fileset. Figure 2-3 illustrates the relationship between a parent fileset and its clone.

Figure 2-3:  Cloning a Fileset

Fileset clones increase the availability of data because they do the following:

A clone cannot be cloned. Data caching is not applicable to clones.

Note

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

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

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

Caution

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

You cannot clone a DMAPI-enabled fileset.

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

2.4.10.1    Creating an AdvFS Fileset Clone

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

clonefset domain_name fileset_name clone_name

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

# clonefset transactions day300 clone_day300

See Section 4.3.11 for command-line instructions on using cloning as a source for backup. See Section E.4.3 for an explanation of cloning with the AdvFS GUI.

2.4.10.2    Mounting and Unmounting an AdvFS Fileset Clone

Clones are mounted and unmounted in the same manner as any other fileset. (See Section 2.4.5 and Section 2.4.6.)

2.4.10.3    Removing an AdvFS Fileset Clone

Clones are removed in the same manner as any other fileset. (See Section 2.4.7.)

2.4.10.4    Renaming an AdvFS Fileset Clone

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

2.5    Configuring an AdvFS root File System

Configuring AdvFS for the root file system has several advantages:

The following are restrictions on the AdvFS root file system:

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

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

See Section C.2 for instructions on converting an existing UFS root file system to AdvFS. See the Installation Guide for instructions on installing AdvFS as the root file system during the initial operating system installation.

2.5.1    Mounting the root File System in Single-User Mode

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

# 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. See mount(8) for more information.

2.5.2    Changing the Name of the root Domain

You can change the name of the root domain as you would any other domain. (See Section 2.3.7.) 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. Both need to be updated if you change the name.

2.5.3    Changing the Name of the root Fileset

You can change the name of the root fileset as you would any other fileset. (See Section 2.4.8.) There are, however, two complications:

Therefore, you must use an alternate bootable partition. 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, do the following:

  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 to update its /etc/fstab file.

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

  7. Shut down the alternate system.

  8. Reboot the original AdvFS system.

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

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

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

    #mkdir /etc/fdmns/tmp_root_domain
    

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

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

  4. Rename the fileset from root_fs to new_root:

    # renamefset tmp_root_domain root_fs new_root 
    

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

    #mount tmp_root_domain#new_root /mnt
    

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

    # cd /mnt/etc 
    # vi fstab 
    

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

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

    Edit this line as follows:

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

  7. Shut down the alternate system.

    # shutdown -h now
    

  8. Reboot the AdvFS system.

Note

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

2.6    Setting Up Trashcans for File Recovery

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

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

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

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

Table 2-1:  Trashcan Commands

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

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

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

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

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

To remove the connection between the trashcan and the directory:

# rmtrashcan /booklist
   '/booklist' detached