8    Administering the POLYCENTER Advanced File System

This chapter introduces the POLYCENTER Advanced File System (AdvFS), which is a file system option on the Digital UNIX operating system. AdvFS provides rapid crash recovery, high performance, and a flexible structure that enables you to manage your file system while it is on line.

An optional set of utilities is available for AdvFS that expands the capabilities of the file system. The POLYCENTER Advanced File System Utilities (AdvFS Utilities) provide functions such as adding volumes without reconfiguring the directory hierarchy of the file system, cloning filesets to enable online backups, and improving system performance with file defragmentation, domain balancing, and file striping. The AdvFS Utilities also include a graphical user interface (GUI) that simplifies file system management.

The AdvFS component is licensed with the Digital UNIX operating system and is available as an optional subset during an advanced installation. You can choose AdvFS as the file system type for the root, /usr, or /var file systems. See the Installation Guide for more information about performing advanced installations. The AdvFS Utilities are available as a separately licensed layered product.

Before setting up AdvFS, you need to understand how it differs from traditional UNIX file systems. These differences, although minor with regard to your transition from a UNIX File System (UFS), play a role in how you plan and maintain AdvFS. For information on UFS, see Chapter 7.

The remaining sections in this chapter describe the unique characteristics of the file system design, instructions on setting up a new file system, and a clarification of what you can accomplish without the optional file system utilities.

Table 8-1 lists and describes the commands unique to the base portion of AdvFS.

Table 8-1: Advanced File System Commands
CommandDescription
advfsstat  Displays AdvFS performance statistics 
advscan  Locates AdvFS partitions on disks 
chfile  Changes the attributes of a file 
chfsets  Changes the attributes of a fileset 
chvol  Changes the attributes of a volume 
mkfdmn  Creates a file domain 
mkfset  Creates a fileset within a file domain 
renamefset  Renames an existing fileset 
rmfdmn  Removes a file domain 
rmfset  Removes a fileset from a file domain 
shblk  Shows AdvFS blocks 
shfragbf  Shows AdvFS frag file 
showfdmn  Displays the attributes of a file domain 
showfile  Displays the attributes of a file 
showfsets  Displays the attributes of filesets in a file domain 
vbmtchain  Displays bitmap metadata table (BMT) information 
vbmtpg  Displays a formatted page of the bitfile metadata table (BMT) 
vdump  Performs incremental backups 
vfile  Displays a file 
vfragpg  Displays a page of the frag file 
vlogpg  Displays a page of the log file 
vlsnpg  Displays the logical sequence number (LSN) of a log page 
vrestore  Restores files from devices written with the vdump command 
vtagpg  Displays a formatted page of the tag directory 
vverify  Checks the AdvFS on-disk metadata structures 

AdvFS uses the the standard UFS quota commands to establish and manage AdvFS user and group quotas. Table 8-2 lists and describes the user and group quota commands to use with AdvFS.

Table 8-2: Advanced File System Quota Commands
CommandDescription
edquota  Edits user and group quotas 
ncheck  Prints the tag and full pathname for each file in the file system 
quot  Summarizes fileset ownership 
quota  Displays disk usage and limits by user or group 
quotacheck  Checks filesystem quota consistency 
quotaon  Turns quotas on 
quotaoff  Turns quotas off 
repquota  Summarizes quotas for a file system 

Table 8-3 lists and describes the optional Advanced File System Utilities that are available as a separately licensed layered product.

Table 8-3: Optional POLYCENTER Advanced File System Utilities
UtilityDescription
addvol  Adds volumes to an existing file domain 
balance  Balances the percentage of used space between two volumes 
clonefset  Creates a read-only fileset, which you use to perform online backups 
defragment  Makes the files in a domain more contiguous 
dtadvfs  Starts the AdvFS graphical user interface 
migrate  Moves the location of a file within a file domain 
mktrashcan  Attaches directories to a trashcan directory, which stores deleted files 
rmtrashcan  Detaches a specified directory from a trashcan directory 
rmvol  Removes a volume from an existing file domain 
shtrashcan  Shows the trashcan directory, if any, that is attached to a specified directory 
stripe  Stripes a file across several volumes in a file domain 


8.1    Features and Benefits

The AdvFS and AdvFS Utilities provide an innovative design that is not based on any existing file system, such as the BSD or the System V file systems. AdvFS enables you to: The AdvFS Utilities enable multivolume file systems. Multiple volumes allow file-level striping and file migration. File-level striping improves file transfer rates by spreading I/O among several disks. File migration allows for load and capacity balancing and reduces file fragmentation.

Table 8-4 lists AdvFS features and their benefits, which are unavailable to traditional file systems such as the BSD or the System V file systems. Note that some of the features listed require the optional POLYCENTER AdvFS Utilities license.

Table 8-4: Advanced File System Features and Benefits
FeatureBenefit
Rapid crash recovery  Write-ahead logging eliminates the requirement to use the fsck utility when recovering from an unexpected system failure and makes file system recovery time rapid and independent of file system size. 
Unified buffer cache  This cache interacts with the virtual memory system to dynamically adjust the amount of physical memory being used to cache file data. 
Extended capacity  The design supports large-scale storage systems by extending the size of both files and file systems. It is designed to handle files and filesets as large as nearly 16 terabytes. 
Disk spanning  A file or file system can span multiple disks within a pool of disk volumes, which you can adjust to match your storage needs. (This feature requires the optional AdvFS Utilities.) 
Graphical User Interface  Simplifies system management by organizing AdvFS functions into menu-selected tasks and graphically depicting file-system status. (This feature requires the optional AdvFS Utilities.) 
Online resizing  You can dynamically change the size of the file system by adding or removing disk volumes while the system remains in use. This enables both online storage configuration and online file system maintenance. (This feature requires the optional AdvFS Utilities.) 
File-level striping  This feature improves file transfer rates by distributing file data across multiple disk volumes. (This feature requires the optional AdvFS Utilities.) 
On-line performance tuning  System performance can be tuned using an array of utilities and can be performed without interrupting system users. 
Online backup  You can back up the contents of your file system to media without interrupting the workflow of system users. 
File undelete  System users can recover unintentionally deleted files, thus improving data availability. (This feature requires the optional AdvFS Utilities.) 


8.2    AdvFS Design Overview

Unlike UFS, AdvFS consists of two distinct layers; each layer contains different file system mechanisms. The directory hierarchy layer implements the file-naming scheme and Digital UNIX file system-compliant functions such as creating and opening files or reading and writing to files. The physical storage layer implements write-ahead logging, caching, file allocation, and physical disk I/O functions.

The decoupled file system structure enables you to manage the physical storage layer apart from the directory hierarchy layer. This means that you can move files between a defined group of disks, without changing file pathnames. Since the pathnames remain the same, the action is completely transparent to end users.

The two-layer structure is the cornerstone of AdvFS. Supporting the design are two file system concepts: the file domain and the fileset.


8.2.1    File Domains

The following sections describe file domains and filesets in more detail.
A file domain is a named set of one or more volumes that provides a shared pool of physical storage. With respect to file domains, a volume is any mechanism that behaves like a UNIX block device: an entire magnetic disk, a disk partition, or a logical volume that is configured with the Logical Volume Manager (LVM) or the Logical Storage Manager (LSM).

Creating a file domain is the first step in setting up AdvFS. The number of file domains that you construct on your system depends on the needs of your site, the resources available to the system, and the number of independent file systems you choose to manage.

When created, all file domains consist of a single (or initial) volume. You transform a single-volume file domain into a multiple-volume file domain by adding one or more volumes. Unless you have installed the optional file system utilities and registered the license PAK, you are limited to creating single-volume file domains.

The /etc/fdmns directory, which the file system automatically creates and updates for you, contains a subdirectory for each file domain on your system. The subdirectories contain a symbolic link to every volume in the file domain.

Use the following guidelines for file domains:

Refer to the addvol(8),
mkfdmn(8), advfs(4), fdmns(4), and showdmn(8) reference pages for more information.


8.2.2    Filesets and File Systems

A fileset represents a portion of the directory hierarchy of a file system; each fileset, which has a unique name, is a collection of directories and files that form a subtree structure. Because the hierarchy layer is independent of the storage layer, you can manage file placement without affecting the logical structure of filesets.

Filesets and file systems are equivalent in many ways. For instance, you mount filesets individually like you mount file systems. Similarly, filesets are units on which you enable quotas and back up data.

Although you can set up a fileset to simulate a traditional file system, filesets offer more flexibility. For instance, you can create multiple filesets in place of one file system, allowing you to manage each fileset independently. Conversely, you can create one large fileset in a situation where you usually define multiple file systems, thereby reducing management overhead.

Unlike file systems, filesets can have clone filesets. A clone fileset is a read-only copy of an existing fileset that you create to capture your data at one moment in time. You can back up the contents of the clone fileset to media while the original fileset remains available to system users. The clone fileset utility, clonefset, is available with the POLYCENTER Advanced File System Utilities.

Use the following guidelines for filesets:

Refer to the
advfs(4), fdmns(4), mkfset(8), and showfsets(8) reference pages for more information.


8.3    File Storage Allocation

The Advanced File System (AdvFS) always attempts to write each file to disk as a set of contiguous units called pages; a page is 8 KB of disk space. Contiguous, in this context, means storage on disk that is physically adjacent. A set of one or more contiguous pages is called an extent. Contiguous placement of the pages means that the I/O mechanism works more efficiently. When a file consists of many small extents, the I/O mechanism must work harder to read or write that file.


8.3.1    Allocation Policy

Files are not static; disk space requirements change over time. To maintain contiguous file placement without over-allocating space on the disk, AdvFS applies a policy to file storage allocation. Each time a file is appended, AdvFS adds pages to the file by preallocating one-fourth of the file size up to 16 pages. If a large write requires more file space, AdvFS attempts to allocate up to 256 contiguous pages. Excess preallocated space is truncated when the file is closed. Unused preallocated space is then available for the next write.

For multivolume file domains, new files are allocated sequentially across volumes. Volumes that are more than 86% full (allocated) are not used for new file allocation unless all volumes are over 86% full. When existing files are appended, storage is allocated on the volume on which the file was initially allocated, until that volume is full.

When a new volume is added to a file domain, it is added to the storage allocation sequence. Files are allocated to the new volume in turn.


8.3.2    Fragments

AdvFS writes files to disk in sets of 8-KB pages. When a file uses only part of the last page, less than 8 KB, a file fragment is created. The fragment, which is from 1 KB to 7 KB in size, is allocated from the frag file. Using fragments considerably reduces the amount of unused, wasted disk space. Note that the frag file is a special file not visible in the directory hierarchy.


8.3.3    Policy Allocation Limitations

Given the dynamic nature of a file system, the file storage-allocation policy cannot always guarantee contiguous page placement. The following factors affect the policy:

File fragmentation can reduce the I/O performance of AdvFS. You can use the defragment utility to reduce domain fragmentation. The defragment utility is available with the optional AdvFS Utilities. See the defragment(8) reference page for information on reducing file fragmentation.


8.4    Setting Up the Advanced File System

As you begin planning, decide whether you want to set up AdvFS to resemble a traditional UFS configuration. Once you become 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 and makes AdvFS features available on all local file systems. By having the /usr file system on AdvFS you can significantly reduce the amount of time your system is down after a system failure.

You can put the root file system and /usr file system on AdvFS during the initial base system installation. If you prefer, you can convert your existing root and /usr file systems after installation. See Section 8.9 and Section 8.10 for conversion guidelines.

The following procedure is a guide for setting up an active, single-volume file system:

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

    You can add more volumes to any existing file domain (except for the root_domain) by using the addvol utility, if you have installed the file system utilities.

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

    Name each fileset the same as its mount-point directory; for example, if the mount-point directory is /tmp, name the fileset tmp.

  3. Create the mount-point directory by using the mkdir command.

  4. Mount each fileset by using the mount command.

In the unlikely event of a severe failure where you must restore the /fdmns directory manually by reconstructing that directory, you must have a separate record of your file system configuration with the name of each file domain and its associated volumes. Always keep this record up-to-date.

The following examples use AdvFS to set up active file systems. The file-domain configurations in the examples are:

The number sign (#) between the file domain and fileset is part of the syntax that represents a fileset; this character does not indicate a comment.

Refer to the mkfdmn(8), mkfset(8), and addvol(8) reference pages for more information.


8.5    Managing File System and Fileset Quotas

AdvFS eliminates the slow reboot activities associated with quotas on UFS. As a result, enabling quotas is a useful way of tracking and controlling the amount of physical storage that each fileset consumes.

The AdvFS quota system is compatible with the Berkeley-style quotas of UFS. Basically, AdvFS supports user account and group quotas. However, the AdvFS quota system differs in two ways: AdvFS differentiates between quota maintenance and quota enforcement and supports fileset quotas.


8.6    Backing Up Data

The dump command supports UFS exclusively. As a result, AdvFS provides an equivalent backup command called vdump. AdvFS also replaces the restore command with the equivalent vrestore command.

If you already use the dump or restore commands to back up and restore data, then the vdump and vrestore commands will be familiar to you.

There are differences between the UFS commands and AdvFS commands. The vdump command supports other file system types, so you can use vdump command capabilities on files systems other than AdvFS. Several minor flags are absent from AdvFS commands; new flags increase your access to information when backing up and restoring files. The vdump command also provides the following features that are unavailable with the dump command:

Table 8-7 lists and describes new command flags for the vdump command.

Table 8-7: The vdump Command Flags
FlagDescription
-C  Compresses data during a backup 
-D  Backs up a subdirectory 
-F  Specifies the number of in-memory buffers 
-V  Displays the current command version number 
-h  Displays usage help 
-q  Displays error messages, but not warning messages 
-v  Displays the names of files as they are backed up 
-x  Increases saveset error protection 
Table 8-8 lists and describes new command flags for the vrestore command.

Table 8-8: The vrestore Command Flags
FlagDescription
-V  Displays the current command version number 
-l  Lists the saveset structure 
-q  Displays error messages, but not warning messages 
-o  Provides file overwrite options 
Refer to the vdump(8) and vrestore(8) reference pages for more information.


8.7    Restoring the fdmns Directory

The /etc/fdmns directory contains a set of subdirectories, one for each file domain on your system. Each subdirectory includes symbolic links to every volume in the file domain. AdvFS cannot mount filesets without this directory.

Note

You must use the addvol and rmvol utilities to add and remove volumes. Creating and removing links alone does not add or remove a volume.


AdvFS creates a corresponding subdirectory each time you create a file domain. For example, you can create a file domain called mydomain, which contains the volume /dev/rz1c. The file system creates the /etc/fdmns/mydomain subdirectory, which contains a symbolic link to /dev/rz1c. When you add or remove a volume from the file domain, the file system updates the subdirectory by adding or removing symbolic links.

In some ways, the /etc/fdmns directory resembles the /etc/fstab file; each has special significance and requires extra attention. You must restore the /etc/fdmns directory if its contents are deleted, corrupted, or if you install a new version of the operating system. Although a missing or damaged /etc/fdmns directory prevents access to the file domain, the data within the file domain remains intact.


8.7.1    Restoring from Backup Media

Restoring from backup media is the preferable method for restoring the /etc/fdmns directory, provided you have a current backup copy of the directory. You can use any standard backup facility (vdump, dump, tar, or cpio) to back up the /etc/fdmns directory. To restore the directory, use a recovery procedure that is compatible with your backup facility.

Always back up the /etc/fdmns directory whenever you create a new file domain, add a volume to an existing file domain, or remove a volume from an existing file domain.


8.7.2    Reconstructing the Directory

You can reconstruct the /etc/fdmns directory manually or with the advscan command. The procedure for reconstructing the fdmns directory is similar for both single-volume and multivolume file domains.

If you choose to reconstruct manually, you must know the name of each file domain on your system and its associated volumes. In other words, you need detailed records of the file domains on your system.

The following example manually reconstructs two file domains, each containing a single volume (or special device). The file domains are:

To reconstruct the two single-volume file domains, enter:
# mkdir /etc/fdmns

# mkdir /etc/fdmns/domain1

# cd /etc/fdmns/domain1

# ln -s /dev/rz1c

# mkdir /etc/fdmns/domain2

# cd /etc/fdmns/domain2

# ln -s /dev/rz2c

The following example, which requires that the optional AdvFS Utilities be installed, reconstructs one multivolume file domain. The domain1 file domain contains three volumes:

To reconstruct the multivolume file domain, enter:
# mkdir /etc/fdmns

# mkdir /etc/fdmns/domain1

# cd /etc/fdmns/domain1

# ln -s /dev/rz1c

# ln -s /dev/rz2c

# ln -s /dev/rz3c
Refer to the
fdmns(4), mkfdmn(8), and addvol(8) reference pages for more information.

You can use the advscan command to rebuild all or a part of your /etc/fdmns file domain. The advscan command can perform the following tasks:

  1. List partitions in the order they are found on disk.

  2. Scan all disks found in any file domain.

  3. Re-create missing domains.

  4. Fix the domain count and links if you specify a domain.

  5. Includes Logical Storage Manager (LSM) disk groups.

See the advscan(8) reference page for details on using the command to restore the /etc/fdmns directory.


8.8    Restarting the System

Unexpected shutdowns, usually as a result of system interruption or media failure, cause you to restart your Digital UNIX operating system. When you are forced to restart your system after an unexpected shutdown, AdvFS is affected.


8.8.1    System Interruption

An example of a system interruption is when your site unexpectedly loses power. This usually happens without warning.

AdvFS uses write-ahead logging as a way to reduce the impact of system interruptions. As your system reboots, the file system scans all records in the recovery log. Any operations that were uncommitted when the interruption occurred are undone. Thus, the number of uncommitted records in the log determines the speed of the recovery. Since the recovery depends on the number of records in the log, instead of the amount of data in the file system, the recovery process dramatically improves. The default log size is 4 MB.

AdvFS automatically initiates crash recovery on a file domain as soon as you mount a fileset within that file domain. You can add filesets to the /etc/fstab file (at least one fileset per domain) so that all file domains recover during the system reboot.


8.8.2    Media Failure

Newer magnetic disks fail less frequently than devices based on older technology. Nevertheless, if any single disk in a file domain fails, you must restore all filesets in the file domain. Assuming you use the vdump command to back up your filesets, you can restore your filesets by using the vrestore command.

Refer to the advfs(4), fdmns(4), vdump(8), and vrestore(8) reference pages for more information.


8.9    Converting the root File System

Converting the root file system to AdvFS enables booting from an AdvFS file domain and supports AdvFS as the root file system. The AdvFS root domain must reside on a single disk.

This section presents instructions for converting the root file system from UFS to AdvFS. These instructions are guidelines, that is, suggestions to illustrate the process of converting the root file system to AdvFS. Specific file names and disk partitions can vary, depending on your system.

You can convert the UFS root file system on one disk to the equivalent AdvFS root file system on a different target disk.

Requirements:

Assumptions: Use the following procedure as a guide for converting the root file system:

  1. Log in as root on the system containing the root file system.

  2. Create a file domain and fileset.
    # mkfdmn -r -t rz26 /dev/rz2a root_domain
    
    # mkfset root_domain root

  3. Create a mount-point directory and mount the new fileset on the directory.
    # mkdir /newroot
    
    # mount -t advfs root_domain#root /newroot

  4. Restore the UFS root file system to the root fileset.
    # vdump 0f - / | (cd /newroot; vrestore -xf -)

  5. Make the disk with the root domain a bootable disk.
    # disklabel -r /dev/rrz2a > /tmp/rz2label
    
    # disklabel -t advfs -r -R /dev/rrz2a /tmp/rz2label rz26

  6. Edit the /etc/fstab file on the AdvFS root fileset to indicate the new root entry.

    1. Search /newroot/etc/fstab for the entry that previously mounted root as a UFS file system, such as:
      /dev/rz1a   /  ufs rw 1 1

    2. Comment out this entry by preceding it with a pound sign (#).

    3. Add the following line:
      root_domain#root  /  advfs rw 1 1

  7. Shut down the system and reset the boot default device, BOOTDEF_DEV to point to the disk with the new root domain.

  8. Reboot the system to enable the AdvFS root file system.

The converted root file system is ready to use.

The AdvFS root domain is limited to one disk. Do not use the addvol command to extend the root domain.


8.10    Converting the /usr File System from UFS to AdvFS

Relying on the fsck utility to check and repair the /usr file system can be time-consuming. By converting the /usr (UFS) file system to AdvFS, you can reduce the amount of time your system is down after a system failure.

This section presents several methods for converting the /usr file system from UFS to AdvFS. These methods are guidelines to illustrate the process of converting file systems to AdvFS: Specific file names, tape drives, and disk partitions can vary, depending on your system.


8.10.1    Using a Backup Tape to Convert the /usr File System from UFS to AdvFS

You can convert the /usr (UFS) file system to the equivalent /usr (AdvFS) file system by backing up the existing file system to tape and restoring it to an AdvFS environment.

Requirements:

Assumptions: Use the following procedure as a guide for converting the /usr file system:

  1. Log in as root on the system that contains the /usr file system.

  2. Back up the /usr file system to /dev/rmt0h, the default tape drive, by entering the following sequence of commands:
    # mt rewind
    
    # cd /usr
    
    # vdump -0 .

  3. Edit the /etc/fstab file.

    1. Search for the entry that mounts /usr as a UFS file system.
      /dev/rz3g          /usr       ufs rw 1 2

    2. Replace the previous line with the following entry, which mounts /usr as an AdvFS file system:
      usr_domain#usr    /usr        advfs  rw

  4. Shut down the system.
    # shutdown -h now

  5. Reboot the system to single-user mode.
    >>> b -fl i
    The system will prompt you for the name of the kernel you want to boot. Press Return to accept the default vmunix kernel.

  6. In single-user mode, mount the root file system as rw, create the usr_domain file domain, and create the usr fileset by entering the following sequence of commands:
    # mount -u /
    
    # mkfdmn /dev/rz3g usr_domain
    
    # mkfset usr_domain usr

  7. Mount the usr fileset on the /usr directory.
    # mount -t advfs usr_domain#usr /usr

  8. Restore the /usr file system from tape to the usr fileset.
    # vrestore -x -D /usr

  9. Continue booting the system to multiuser mode. Once the system prompt returns, the converted /usr file system is ready to use.


8.10.2    Using an Intermediate File to Convert from UFS to AdvFS

You can convert the /usr (UFS) file system to the equivalent /usr (AdvFS) file system by backing up the existing file system to a file and restoring it to an AdvFS environment.

Requirements:

Assumptions:

Use the following procedure as a guide for converting the /usr file system:

  1. Log in as root on the system that contains the /usr file system.

  2. Back up the /usr file system to /tmp/usr_bck, the intermediate file, by entering the following sequence of commands:
    # cd /usr
    
    # vdump -0f /tmp/usr_bck /usr

  3. Edit the /etc/fstab file.

    1. Search for the entry that mounts /usr as a UFS file system.
      /dev/rz3g          /usr       ufs rw 1 2

    2. Replace the previous line with the following entry, which mounts /usr as an AdvFS file system:
      usr_domain#usr    /usr        advfs  rw

  4. Shut down the system:
    # shutdown -h now

  5. Reboot the system in single-user mode:
    >>> b -fl i
    The system will prompt you for the name of the kernel you want to boot. Press Return to accept the default vmunix kernel.

  6. In single-user mode, mount the root file system as rw, create the usr_domain file domain, and create the usr fileset by entering the following sequence of commands:
    # mount -u /
    
    # mkfdmn /dev/rz3g usr_domain
    
    # mkfset usr_domain usr

  7. Mount the usr fileset on the /usr directory:
    # mount -t advfs usr_domain#usr /usr

  8. Restore the /usr file system from the intermediate file to the usr fileset:
    # vrestore -xf /tmp/usr_bck -D /usr

  9. Continue booting the system to multiuser mode. Once the system prompt returns, the converted /usr file system is ready to use.


8.10.3    Converting from One Disk to Another Disk

You can convert the /usr (UFS) file system on one disk to the equivalent /usr (AdvFS) file system on a different target disk.

Requirements:

Assumptions: Use the following procedure as a guide for converting the /usr file system:

  1. Log in as root on the system that contains the /usr file system.

  2. Create a file domain and fileset by entering the following sequence of commands:
    # mkfdmn /dev/rz2c usr_domain
    
    # mkfset usr_domain usr

  3. Create a mount-point directory and mount the new fileset on the directory by entering the following sequence of commands:
    # mkdir /usr.advfs
    
    # mount -t advfs usr_domain#usr /usr.advfs

  4. Change to the /usr directory.
    # cd /usr

  5. While there is no activity on the system, copy the contents of the UFS file system to the AdvFS file system.
    # vdump -0f - -D . | vrestore -xf - -D /usr.advfs

  6. Edit the /etc/fstab file.

    1. Search for the entry that mounts /usr as a UFS file system:
      /dev/rz3g          /usr       ufs rw 1 2

    2. Replace the previous line with the following entry, which mounts /usr as an AdvFS file system:
      usr_domain#usr    /usr        advfs  rw

  7. Shut down and reboot the system. Once the system prompt returns, the converted /usr file system is ready to use.


8.11    Converting a Data File System from UFS to AdvFS

By converting your data file systems to AdvFS, you can eliminate lengthy reboots. Moreover, you can introduce new configurations to reduce file system management overhead.

This section presents two different methods for converting data file systems from UFS to AdvFS. The second method appends the first method with additional instructions, resulting in an AdvFS file system that consists of two independent filesets within one file domain.

The conversion methods presented here are only guidelines to illustrate the process of converting file systems to AdvFS. Specific file names, tape drives, and disk partitions can vary, depending on your system.


8.11.1    Using a Backup Tape to Convert a Data File System from UFS to AdvFS

You can convert a data UFS file system to the equivalent data AdvFS file system by backing up the existing file system to tape and restoring it to an AdvFS environment.

Requirements:

Assumptions:

Use the following procedure as a guide for converting the /staff2 file system:

  1. Log in as root on the system that contains the /staff2 file system.

  2. Back up the /staff2 file system to /dev/rmt0h, the default tape drive, by entering the following sequence of commands:
    # mt rewind
    
    # cd /staff2
    
    # vdump -0 .

  3. Create a file domain and fileset by entering the following sequence of commands:
    # umount /staff2
    
    # mkfdmn /dev/rz2c staff_domain
    
    # mkfset staff_domain staff2

  4. Mount the new fileset on the directory by entering the following command:
    # mount -t advfs staff_domain#staff2 /staff2

  5. Restore the /staff2 file system from tape to the staff2 fileset.
    # vrestore -x -D /staff2

  6. Edit the /etc/fstab file.

    1. Search for the entry that previously mounted /staff2 as a UFS file system:
      /dev/rz2c          /staff2       ufs rw 1 2

    2. Replace the previous line with the following entry, which mounts /staff2 as an AdvFS file system:
      staff_domain#staff2     /staff2	    advfs  rw

The converted /staff2 file system is ready to use.


8.11.2    Transferring an Existing Data File System and Converting It to AdvFS

You can transfer an existing data file system to a new system, then convert the file system to AdvFS.

Requirements:

Assumptions: Use the following procedure as a guide for converting the /staff4 file system:

  1. Log in to the system that contains the /staff4 file system and back up the file system by entering the following command:
    # tar c /staff4

  2. Log in as root on the target system.

  3. Create a fileset in the staff_domain file domain.
    # mkfset staff_domain staff4

  4. Create a mount-point directory and mount the new fileset on the directory by entering the following sequence of commands:
    # mkdir /staff4
    
    # mount -t advfs staff_domain#staff4 /staff4

  5. Restore the /staff4 file system from /dev/rmt0h, the default tape drive, by entering the following sequence of commands:
    # mt rewind
    
    # tar x /staff4

  6. Edit the /etc/fstab file. Add the following line, which mounts /staff4 as an AdvFS file system:
    staff_domain#staff4     /staff4	    advfs  rw

  7. The staff_domain file domain now includes both filesets, which are ready to use.