The REPLACE (Replace Pack Volume) command initiates a pack volume replacement operation.
Syntax

Explanation
REPLACE PK <unit number> ONTO PK <unit number>
Transfers a bit-image copy of all data on the pack with the first unit number to the pack with the second unit number.
Both the source and destination volumes must be reserved before a pack volume can be replaced. These volumes can be reserved with the UR (Unit Reserved) command.
Before the pack volume is replaced, messages are displayed describing both the source and destination volumes, and you are asked to indicate whether to proceed by entering either an OK (Reactivate) or DS (Discontinue) command.
The data on the source pack volume are copied to the destination volume. At intervals during the copy phase, messages show how much of the data was transferred and how much was transferred successfully. Errors are not logged, but bad areas are recorded in the SECTORSINERROR report file.
When copying is complete, the system analyzes the effect of any damage on files stored on the source volume. Lists of damaged files are generated, and affected areas are marked to prevent their use. This information is stored in the DAMAGEDFILES and DAMAGEREPORT files.
The label information is transferred to the destination volume and the source volume is marked unlabeled. The destination volume can then be brought online and used.
REPLACE & COMPARE PK <unit number> ONTO PK <unit number>
The COMPARE option causes each successful transfer operation to be followed by a pair of read operations—one of the source and one of the destination. The resulting data are compared. If either read operation fails or if the comparison fails, the same action takes place as if the original transfer had failed. The COMPARE option helps to ensure the accuracy of the transfer but it doubles the time required for a pack volume replacement.
Examples
Example 1
In this example, the operator requests that the contents of pack 241 be copied onto pack 240. Note that both packs must be reserved with a UR command before the REPLACE is started. The system asks for confirmation before doing the replacement, and the operator enters OK. During the replacement process, the system sends periodic messages stating how much of the pack was read so far. When the replace operation is completed, the operator restores the packs to the system with a UR command and then uses a PER PK command to list the status of the packs on the system. Pack 240 has inherited the label that was attached to pack 241 previously, and pack 241 is unlabeled.
PER PK
240*B [206000] #1 PARTS2 (0) 241*B [123123] #1 PARTS1 (0)
CLOSE PK 240,241
PK240 WILL BE CLOSED PK241 WILL BE CLOSED PK240 UNIT CLOSED PK241 UNIT CLOSED
UR PK 240,241
PK240 RESERVED PK241 RESERVED
REPLACE PK 241 ONTO PK 240
5231 PK240 IS PARTS2 #1 [206000] 5231 OK TO REPLACE PK241 ONTO PK240 ? (PK240 WILL BE OVERWRITTEN.)
5231 OK
5231 PK241 10 % READ. 100 % SUCCESSFULLY. 5231 PK241 20 % READ. 100 % SUCCESSFULLY. 5231 PK241 30 % READ. 100 % SUCCESSFULLY. 5231 PK241 40 % READ. 100 % SUCCESSFULLY. 5231 PK241 50 % READ. 100 % SUCCESSFULLY. 5231 PK241 60 % READ. 100 % SUCCESSFULLY. 5231 PK241 70 % READ. 100 % SUCCESSFULLY. 5231 PK241 80 % READ. 100 % SUCCESSFULLY. 5231 PK241 90 % READ. 100 % SUCCESSFULLY. 5231 PK241 100 % READ. 100 % SUCCESSFULLY. 5231 PK241 REPLACED ONTO PK240. 0 FAILURES. (0 SECTORS OUT OF 362230)
UR - PK 240,241
PK240 AVAILABLE PK241 AVAILABLE 5232 PK241 [000000] PARTS1 NO VOL1 5233 FAMILY REBUILDING:PK240 PARTS1 5233 FAMILY REBUILDING(50%):PK240 PARTS1
PER PK
----- PK STATUS ----- 240*B [123123] #1 PARTS1 (0) 241*B [000000] #1 L A B E L E R R O R
Example 2
This example shows the REPLACE command responses on systems that support the Mirrored Disk Pooling Facility (MDPF) when the destination pack is assigned as a free spare disk in the spare disk pool. Before the command begins copying data from the source pack to the destination pack, it displays one of the following two messages:
-
If MDPF is installed on your system, the message is similar to the following:
REPLACE PK 64 ONTO PK 65 <mix number> PK64 IS DBDATA #1 [<serial #>] <mix number> PK65 IS DESIGNATED A SPARE FOR MIRROR REPLACEMENT <mix number> OK TO REPLACE PK 64 ONTO PK 65? (PK 65 WILL BE OVERWRITTEN)
-
If MDPF is not installed on your system, the message is similar to the following:
REPLACE PK 64 ONTO PK 65 <mix number> PK64 IS DBDATA #1 [<serial #>] <mix number> PK65 IS DESIGNATED A SPARE FOR MIRROR REPLACEMENT, A FEATURE NOT ENABLED ON THIS SYSTEM. <mix number> OK TO REPLACE PK 64 ONTO PK 65? (PK 65 WILL BE OVERWRITTEN)
Note: | The OK TO REPLACE message is displayed by the REPLACE command regardless of the presence or absence of MDPF. |
If you respond OK, the command completes the replacement and removes the free spare attribute on the destination pack. A status change message is issued if the free spare attribute of a disk is removed. The status change message is defined in the MCP System Interfaces Programming Reference Manual.
If you respond DS, the command is rejected and no replacement occurs.
Considerations for Use
You can use the SCAN (Scan Pack Volume) command before the REPLACE command to determine in advance the probable results of using the REPLACE command. For more information, refer to the SCAN (Scan Pack Volume) command.
A visible independent runner, REPLACEPACK, performs the pack volume replacement. It controls both volumes until it finishes, preventing any other use of them. Because REPLACEPACK leaves both volumes reserved, you must enter UR − to make them available. Refer to the UR (Unit Reserved) command. REPLACEPACK displays an error message and terminates if any of the following conditions occurs:
-
The units do not exist.
-
The source pack is larger than the destination pack.
-
The units are not reserved.
-
The units are not available; for example, if they are being used by maintenance or by another REPLACEPACK.
-
The directories for the source volume are not available.
-
The source volume is not a labeled pack.
If REPLACEPACK is discontinued with a DS command or terminates for any other reason during the copy phase, the source volume is not modified and the destination volume is unlabeled.
If errors occur on the destination volume, REPLACEPACK displays a message summarizing the errors and then displays the following RSVP message before proceeding to the damage analysis phase:
OK TO CONTINUE OR DS AND TRY ANOTHER DESTINATION.
In the damage analysis phase, if REPLACEPACK terminates for any reason (such as a halt/load), the source volume is still labeled and the destination volume is unlabeled. Changes already made to the directory—areas locked out or marked destroyed—remain in effect. REPLACEPACK ignores DS (Discontinue) commands in the damage analysis phase.
Three output files contain the results of the operation. These files are named SECTORSINERROR, DAMAGEDFILES, and DAMAGEREPORT, and reside on the halt/load family. Their FILEKIND attribute is set to DATA and their MAXRECSIZE attribute is 15 words. These files can be processed by CANDE or used as input to user-written programs. The files are named according to the following convention:
REPLACE/<family name>/FAMILYINDEX<integer>/<report file name>
SECTORSINERROR File
This file lists regions that were not successfully copied. Each record describes a region. A region is a contiguous set of sectors that all failed to copy for the same reason. Possible reasons are as follows:
SOURCE READ ERROR DESTINATION WRITE ERROR SOURCE COMPARE READ ERROR DESTINATION COMPARE READ ERROR COMPARE ERROR
Included in the description is the physical result descriptor obtained while the system attempted to transfer the first sector of the region. If no bad sectors are found, a null SECTORSINERROR file is created. A SECTORSINERROR file might look like this:
REPLACE/TESTPK/FAMILYINDEX2/SECTORSINERROR ON HLDISK SCAN/REPLACE ERROR @ ADDRESS: 8090 FOR 1 SOURCE READ ERROR ... ... RD=0001E9E60581 SCAN/REPLACE ERROR @ ADDRESS: 34009 FOR 6 DESTINATION WRITE ... ... ERROR RD=0001E9EA0901 SCAN/REPLACE ERROR @ ADDRESS: 59067 FOR 1 SOURCE READ ERROR ... ... RD=0001E9E60581
Both the start sector and the number of sectors are in decimal characters.
DAMAGEDFILES File
This file contains a list of files for which one or more areas were not successfully copied. The titles are separated by commas. The file can be used to make a WFL deck containing a COPY, ADD, or REMOVE statement. If no bad sectors are found, this file is not created. A DAMAGEDFILES file might look like this:
REPLACE/TESTPK/FAMILYINDEX2/DAMAGEDFILES ON HLDISK (XYZ)SYMBOL/GREEN ,*TESTDB/PARTS/DATA
DAMAGEREPORT File
This file contains a more detailed description of the damage to those files for which one or more areas were not successfully copied. For each file, the title and a list of affected areas are included. If the file is a DMSII file (its FILEKIND is DBDATA), the phrase DMS ROW LOCKOUT OF is included. If a JOBDESC file was affected, messages describing the problem appear at the end of the DAMAGEREPORT file. If no bad sectors are found, this file is not created.
A DAMAGEREPORT file might look like this:
REPLACE/TESTPK/FAMILYINDEX2/DAMAGEREPORT ON HLDISK
DAMAGED FILE: (XYZ)SYMBOL/GREEN ROW(S): 17,24 DAMAGED FILE: *TESTDB/PARTS/DATA DMS ROW LOCKOUT OF ROW(S): 7
Directories
In general, the directories for a family must be available to REPLACEPACK when a member of that family is the subject of a pack volume replacement operation. Consider the following cases:
-
The volume contains the only directory for the family. In this case, the family is already offline, and REPLACEPACK implicitly has access to the directory.
-
The volume does not contain a directory. In this case, the family must be online; that is, the directory volumes must be online and the directory must have been complemented. REPLACEPACK ensures that this is the case and then locks the directory volumes online (by incrementing their open counts) until the operation completes.
-
The volume contains one of several directories for the family, and the family is not online. In this case, REPLACEPACK terminates if it cannot find all other directories for the family. REPLACEPACK locks the other directory volumes online and marks them in a way that prevents the family from coming online (being complemented) until the pack volume replacement is completed.
-
The family is in a marked state if it was online when one of its directory volumes was closed. A family is also left in this state if some of its directory volumes are brought online, but at least one is left offline, and VERIFYFAMILY is discontinued when it requests the offline volume.
-
The volume contains one of several directories for the family, and the family is online. In this case, REPLACEPACK uses the online directories, just as if the subject of the pack volume replacement did not have a directory. If any damage is found, the directory timestamps in the online directories are updated, making the directory on the destination volume obsolete.
-
The only way to get a family into this state is for you to respond OF to VERIFYFAMILY when it requests the volume that is to be the subject of the pack volume replacement. This action should be taken only as a last resort.
The suggested approach for dealing with multimember families is to close only the volume that is to be the subject of the pack volume replacement. All other members of the family that have directories should be left online.
It is possible to perform pack volume replacement operations on several nondirectory volumes of the same family at the same time. However, you should first consider how such actions will reduce the rate of I/O subsystem throughput and increase the system workload.
If the subject volume of a pack volume replacement operation contains a directory, then parts of the directory might not transfer correctly to the destination volume. All records in a directory contain a checksum, which detects any such errors.
Duplicate directories are referenced, if possible, when records in the directory on the source volume are bad. Messages inform you that this replacement has occurred.
If there is no duplicate directory, then messages appear describing the problem, and REPLACEPACK waits with the following RSVP:
OK TO ERASE BAD RECORDS?
Enter one of the following system commands to reply to this message:
-
DS terminates the pack volume replacement.
-
OK lets pack volume replacement continue, but might cause files to be lost from the directory.
If there is no duplicate directory and the portion of the directory describing the directory itself is corrupted, the pack volume replacement is terminated.
Replacing Disks with Varying Sector Sizes
Some restrictions apply to the replacement of a disk with another disk that uses a different sector size or format (either VSS-1, VSS-2, or VSS-3). For a general description of VSS disks, refer to the Peripherals Information File.
Only those 180-byte disks that were configured with VSS = VSS2 or VSS=VSS3 can be replaced by a VSS-2 disk. The VSS option ensures that file areas are allocated properly for optimal performance. This option is described in the topics INITIALIZE (Initialize Disk) and RC (Reconfigure Disk).
The following chart shows the various combinations of disks, and indicates whether a REPLACE command can copy the data from the source disk to the target disk.
SOURCE UNIT |
Destination Unit |
Allowed |
|||
---|---|---|---|---|---|
Physical Sector Size |
INITVSS |
RC Option(1) |
Physical Sector Size |
INITVSS |
|
180 |
NA |
-- |
180 |
NA |
YES |
180 |
NA |
-- |
512 |
VSS1 |
YES |
180 |
NA |
-- |
512 |
VSS2 |
NO |
180 |
NA |
VSS2 |
180 |
NA |
YES |
180 |
NA |
VSS2 |
512 |
VSS1 |
NO |
180 |
NA |
VSS2 |
512 |
VSS2 |
Yes |
180 |
NA |
VSS3 |
180 |
NA |
YES |
180 |
NA |
VSS3 |
512 |
VSS1 |
NO |
180 |
NA |
VSS3 |
512 |
VSS2 |
Yes |
512 |
VSS1 |
-- |
180 |
NA |
YES |
512 |
VSS1 |
-- |
512 |
VSS1 |
YES |
512 |
VSS1 |
-- |
512 |
VSS2 |
NO |
512 |
VSS1 |
GAPS |
180 |
NA |
NO |
512 |
VSS1 |
GAPS |
512 |
VSS1 |
YES |
512 |
VSS1 |
GAPS |
512 |
VSS2 |
NO |
512 |
VSS2 |
VSS2 |
180 |
NA |
YES |
512 |
VSS2 |
VSS2 |
512 |
VSS1 |
NO |
512 |
VSS2 |
VSS2 |
512 |
VSS2 |
YES |
512 |
VSS2 |
VSS3 |
180 |
NA |
YES |
512 |
VSS2 |
VSS3 |
512 |
VSS1 |
NO |
512 |
VSS2 |
VSS3 |
512 |
VSS2 |
YES |
-
RC Option(1) refers to VSS=VSS2 or VSS3; GAPS=TRUE or FALSE. VSS or GAPS specified. No special alignment of file rows.
-
GAPS is the unallocated sectors left between file rows so that two rows are never in the same physical sector. Only allowed on VSS-1 packs.
-
VSS2 indicates file rows are allocated on a 2-sector (logical) boundary.
-
VSS3 indicates file rows are allocated on a 22-sector (logical) boundary.
If you enter a REPLACE command with a VSS-1 disk or a 180-byte disk that lacks the VSS = VSS2 option as the source, and a VSS-2 disk as the destination, the system responds with the following message:
NOT ALLOWED: Destination must be INITIALIZED as VSS-1 and RCED with CAPACITY option to replace this source.
To convert the selected disk to a compatible destination for this source,
-
If the disk is labeled, enter the following command:
INITIALIZE PK <destination disk> OLDNAME = <name> VSS = VSS1
If the disk is not labeled, enter the following command:
INITIALIZE PK <destination disk> VSS = VSS1
-
Enter the following command:
RC PK <destination disk> NAME = <temp name> SERIAL = <temp serial> CAPACITY LIKE PK <source disk>
Additionally, you cannot replace a VSS-2 disk with a VSS-1 disk. And if a 180-byte disk has the VSS = VSS2 attribute, you cannot replace the disk with a VSS-1 disk. If you attempt either of these operations, the system displays the following message:
NOT ALLOWED: Destination must be INITIALIZED as VSS-2 and RCED with CAPACITY option to replace this source.
To convert the selected disk to a compatible destination for this source,
-
If the disk is labeled, enter the following command:
INITIALIZE PK <destination disk> OLDNAME = <name> VSS = VSS1
If the disk is not labeled, enter the following command:
INITIALIZE PK <destination disk> VSS = VSS1
-
Enter the following command:
RC PK <destination disk> NAME = <temp name> SERIAL = <temp serial> CAPACITY LIKE PK <source disk>