Copying the physical blocks of the aggregate to a larger data set
Another method to increase the size of a zFS aggregate is to copy the physical blocks of the aggregate to a larger data set using the DFSMS REPRO command. This approach is normally faster than using the pax command. However, do not format the target zFS data set before using the REPRO command. Figure 1 shows an example of this approach.
//SUIMGVMB JOB ,'EXPAND AGGR WITH REPRO',
// CLASS=A,MSGCLASS=X,MSGLEVEL=(1,1)
//DEFINE EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=H
//SYSIN DD *
DEFINE CLUSTER (NAME(PLEX.NEW.AGGR002.LDS0002) -
LINEAR CYL(100 5) SHAREOPTIONS(3) -
VOLUMES(CFC000 CFC001))
/*
//LCAT1 EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//* This step should show a HI-U-RBA of 0
//* for PLEX.NEW.AGGR002.LDS002
//SYSIN DD *
LISTCAT ENTRIES(PLEX.OLD.AGGR002.LDS0002) -
ALL
LISTCAT ENTRIES(PLEX.NEW.AGGR002.LDS0002) -
ALL
/*
//REPRO1 EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=H
//* The next line guarantees that the file system is not mounted
//IN1 DD DSN=PLEX.OLD.AGGR002.LDS0002,DISP=OLD
//SYSIN DD *
REPRO -
INFILE(IN1) -
OUTDATASET(PLEX.NEW.AGGR002.LDS0002)
/*
//LCAT2 EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//* This step should show the HI-U-RBA of
//* PLEX.NEW.AGGR002.LDS002 equal to the HI-U-RBA
//* of PLEX.OLD.AGGR002.LDS002
//SYSIN DD *
LISTCAT ENTRIES(PLEX.OLD.AGGR002.LDS0002) -
ALL
LISTCAT ENTRIES(PLEX.NEW.AGGR002.LDS0002) -
ALL
/*
Figure 2 shows a zFS file system (PLEX.OLD.AGGR002.LDS0002) that is full and a newly-defined zFS data set (PLEX.NEW.AGGR002.LDS0002 before the REPRO) that is larger. PLEX.NEW.AGGR002.LDS0002 has a larger HI-A-RBA than PLEX.OLD.AGGR002.LDS0002. When the blocks from PLEX.OLD.AGGR002.LDS0002 are copied into PLEX.NEW.AGGR002.LDS0002 using REPRO, the result is PLEX.NEW.AGGR002.LDS0002 after REPRO. There is now room to add data to PLEX.NEW.AGGR002.LDS0002.
With this approach, the new VSAM linear data set must not be formatted as an empty zFS file system before the REPRO command is used. (If the new data set was formatted, the REPRO would copy blocks to the end of the primary allocation, not the beginning. The data blocks being copied contain all the file system data and the file system information, so formatting is not necessary.) Neither file system needs to be mounted. REPRO uses native VSAM calls to read and write the blocks.
- When using the REPRO command, do not use the z/OS® UNIX ishell command or the z/OS UNIX automount command with the allocany or allocuser keyword, because those commands will automatically format the aggregate.
- Do not use this approach to copy an HFS file system to a zFS file system because you will be copying the physical blocks of the file system (not the individual files) and the internal format of HFS file systems is different than the internal format of zFS file systems.
Notice that the ZFS attribute is not set in the LISTCAT output for the target data set (PLEX.NEW.AGGR002.LDS0002). It is set the first time the zFS file system is mounted read-write.
Now the new aggregate can grow into the available space in the allocated portion of the data set or even extend to additional extents if there is space on the volume.
After you successfully copy the data, when you are comfortable with the new, larger aggregate, you can delete the old aggregate.