EXPAND (Expand Directory)

The EXPAND (Expand Directory) command pre-expands a directory before it fills up. Using the EXPAND command helps avoid delays that sometimes occur when a directory is full and there is not enough disk space available for the system to expand the full directory.

Syntax

Explanation

<directory name>

The <directory name> must be the name of an active directory, such as a SYSTEMDIRECTORY, SYSTEM/ACCESS, SYSTEM/CATALOG, or SYSTEM/ARCHIVE.

<family name>

The <family name> is the name of the disk on which the specified directory is located.

<number>

The <number> specifies the total number of AREAS the directory should have. The maximum number of AREAS is 1000. If the directory is one of a duplicated or triplicated set of directories, the expand process expands the specified directory and all of its duplicates. If the directory already has the requested number of AREAS or more, the expand process terminates without adding any AREAS to the directory.

Example

This example expands SYSTEMDIRECTORY for the family PACK to 400 AREAS:

EXPAND SYSTEMDIRECTORY/001 ON PACK AREAS = 400

Considerations for Use

If the system is waiting on an RSVP message for directory space, then an EXPAND command for that directory or any of its duplicates waits until you resolve the directory space required by the RSVP message before proceeding, such as the following:

PK4101 2000 (FAMILYINDEX 1) SECTORS REQUIRED ON 
   PACK: *SYSTEMDIRECTORY/001

If there is not enough available disk space initially to expand the directory to the specified size, the expand process invokes a special internal form of the "SQUASH <family name>" command to make enough disk space available to allocate all the requested AREAS. This squash process can move areas of files from the target disk to other members of the family. Because only one SQUASH or RES command can run on a family at a given time, you should not use EXPAND while a SQUASH or RES command is running for the family containing the directory.  

In the case of disks that contain several directories, such as the DL CATALOG family, you should not run EXPAND for one directory on a family while an expand process is already running for another directory on that family.

Changing the Size of the SYSTEMDIRECTORY for a Disk Family

The following three system commands enable you to change the size of the SYSTEMDIRECTORY for a disk family.

  • EXPAND SYSTEMDIRECTORY/<number> ON <family name> AREAS <number>

    The primary purpose of this  command is to preexpand the SYSTEMDIRECTORYs for a given family.

    Preexpanding the SYSTEMDIRECTORYs for a family helps to ensure that the system is not delayed waiting for disk space on the base pack to expand the SYSTEMDIRECTORY while you are adding files to the family.

  • NEW SYSTEMDIRECTORY ON <family name>

    The primary purpose of this command is to change the AREASECTORS value of the SYSTEMDIRECTORY on the indicated family.

    You can change AREASECTORS from the old 600 sector value to 2000 or 4000 sectors, greatly increasing the capacity of the directory.

  • SQUASH SYSTEMDIRECTORY ON <family name>

    The primary purpose of this command is to reduce the size of the SYSTEMDIRECTORY for the family and return unused AREAS to the available disk space pool for use by normal files.

    Use this command for disk families that at one time contained a large number of files but no longer contain or need to contain so many files.

    Note that this function is completely different from the function of the "SQUASH <family name>" system command, which attempts to reduce the checkerboarding of the available disk space pool.

Performance

The SQUASH SYSTEMDIRECTORY and NEW SYSTEMDIRECTORY commands both use the same algorithm as follows:

  • Make a new copy of the SYSTEMDIRECTORY and, in the process, assign new record numbers to each record (each disk file header) copied from the old directory to the new directory.

  • Adjust the linkages between segments of all segmented disk file headers in the directory (for example, the disk file headers for files with more than 2000 AREAS).

  • Execute a family rebuild or catalog rebuild for the family to update the record number information in the FAST or CATALOG.

  • Go through the main memory and update the record numbers in the disk file headers for all permanent disk files that are currently open or are in the STRUCTURE HEADER cache.

To make a coherent copy of the directory, the process procures various locks to block all access to the SYSTEMDIRECTORY by programs and system software. This activity blocks the opening and closing of files on the family, the removal of files from the family, the changing of the file name or other attributes of files on the family, and so forth. The locks also block the use of the PD (Print Directory) and other system commands, CANDE FILES and LFILES commands, and MARC commands that reference the family. In some cases, the blockage can extend to uses of the PER PK command either manually or in an ADM display.

Postpone using the SQUASH SYSTEMDIRECTORY and NEW SYSTEMDIRECTORY commands until a time when critical programs are not running. Before using either of these commands, consider using the ADM ST system command on any ODT that is running the automatic display of system status with a the display of disk packs (PER PK). Whenever a SQUASH SYSTEMDIRECTORY or NEW SYSTEMDIRECTORY process is running, avoid issuing any commands that reference disks, such as PER PK (Peripheral Status), PD (Print Directory), MP (Mark Program), and so forth.

The EXPAND SYSTEMDIRECTORY command uses a much simpler algorithm as follows:

  • It searches for available disk space and adds spare AREAS to the SYSTEMDIRECTORY.

  • If it cannot find enough available disk space to reach the number of AREAS that you specified in the command, the system might try performing a special form of the "SQUASH <family name>" process and then try to find more space.

Using EXPAND SYSTEMDIRECTORY is much less disruptive than using SQUASH SYSTEMDIRECTORY and NEW SYSTEMDIRECTORY because it does not need to block all access to the SYSTEMDIRECTORY while it is running. Using the EXPAND SYSTEMDIRECTORY command consumes very little processor or I/O time except in cases where it runs out of available disk space. In such cases, it attempts to move files to make space available.