2010年9月18日 星期六

zFS file How TO



(1) Create and Format a zFS file:
//DEFINE EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=A
//SYSUDUMP DD SYSOUT=a
//AMSDUMP DD SYSOUT=A
//DASD DD DISP=OLD,UNIT=3390,VOL=SER=ZFS001
//SYSIN DD *
DEFINE CLUSTER (NAME(OMVS.ZFS.COMPAT.AGR0001) -
VOLUMES(ZFS001) -
LINEAR -
CYL(10 0) -
SHAREOPTIONS(3))
/*
//ZFSBIT EXEC PGM=IOEAGFMT,REGION=0M,
// PARM=('-aggregate OMVS.ZFS.COMPAT.AGR0001 -compat')
//STDOUT DD SYSOUT=A
//STDERR DD SYSOUT=A
//SYSUDUMP DD SYSOUT=A
//CEEDUMP DD SYSOUT=A
//SYSPRINT DD SYSOUT=A
//*

(2) Growing a zFS Aggregate file:
>> Dataset must have a secondary extent defined and space must exist on the volume to grow into.
>> Size specified on the grow command must be larger thant the current size of the aggregate.
>> You may need to allocate extra blocks for grow to work succesfully as SMS might require some reserved blocks.
>> Size of 0 (zero) grows the agrregate by the size of the secondary allocation.

Example:

zfsadm aggrinfo OMVS.ZFS.COMPAT.AGR0001
| OMVS.ZFS.COMPAT (R/W COMP): 1150 K free out of total 1440

zfsadm grow OMVS.ZFS.COMPAT.AGR0001 1440
| IOEZ00175E Error growing aggregate OMVS.ZFS.COMPAT.AGR0001, error code=121 reason code=EF17606E

zfsadm grow OMVS.ZFS.COMPAT.AGR0001 1441
| IOEZ00173I Aggregate OMVS.ZFS.COMPAT.AGR0001 successfully grown
| OMVS.ZFS.COMPAT.AGR0001 (R/W COMP): 1798 K free out of total 2160


>> Automatically Grow an Agrregate by specifying AGGGROW parameter on mount command……
>> or set default in IOEFSPRM globally.
>> If out-of-space condition occurs Aggregate is automatically grown and I/O re-driven transparently

(3) Adding A volume to an Aggregate:
//STEP01 EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
ALTER OMVS.ZFS.COMPAT.AGR0001.DATA -
ADDVOLUMES(* *)

Adds two volumes to the candidate volume list, selected by SMS. Specify VOLSER if specific volumes
are needed. File must be closed and re-opened before candidates become available for allocation.
UNMOUNT and MOUNT zFS files again to achieve this…. (including any CLONEed files systems!!!)

(4) Backing up a zFS File System with DFDSS:
Backup and Restore of zFS Aggregate

To Backup a zFS file system simply use DFDSS….

//*-----------------------------------------------------------------
//* THIS JOB QUIESCES A ZFS AGGREGATE, DUMPS IT, THEN UNQUIESCES IT.
//*-----------------------------------------------------------------
//DUMP EXEC PGM=ADRDSSU,REGION=4096K
//SYSPRINT DD SYSOUT=*
//SYSABEND DD SYSOUT=*
//OUT DD DSN=hlq.ZFS.BACKUP,
// DISP=(NEW,CATLG,DELETE),SPACE=(CYL,(5,1),RLSE)
//SYSIN DD *
DUMP DATASET(INCLUDE(OMVS.ZFS.COMPAT.AGR0001)) -
CONCURRENT -
OUTDD(OUT)
/*
//

Note: The file systems needs to be attached but not nescessarily mounted.

(5) Restoring a zFS File System with DFDSS:
To Restore the zFS file system….

//*-----------------------------------------------------------------
//* THIS JOB RESTORES A ZFS AGGREGATE.
//*-----------------------------------------------------------------
//ZFSREST EXEC PGM=ADRDSSU,REGION=0M
//SYSPRINT DD SYSOUT=*
//SYSABEND DD SYSOUT=*
//INDS DD DISP=SHR,DSN=hlq.ZFS.BACKUP
//SYSIN DD *
RESTORE DATASET(INCLUDE(**)) -
CATALOG -
RENAMEU( -
(OMVS.ZFS.COMPAT.AGR0001, -
OMVS.ZFS.COMPAT.AGR0001.RESTORE) -
) -
WRITECHECK -
INDD(INDS)


>> Once restored the old file will need to be unmounted and then
the new one mounted in it's place….
>> To restore into the original zFS aggregate run the following.
>> File cannot be mounted or attached whilst restore is running


//*---------------------------------------------------
//* THIS JOB RESTORES A ZFS AGGREGATE.
//*---------------------------------------------------
//ZFSREST EXEC PGM=ADRDSSU,REGION=0M
//SYSPRINT DD SYSOUT=*
//SYSABEND DD SYSOUT=*
//INDS DD DISP=SHR,DSN=hlq.ZFS.BACKUP
//SYSIN DD *
RESTORE DATASET(INCLUDE(OMVS.ZFS.COMPAT.AGR0001)) -
CATALOG -
REPLACE -
WRITECHECK -
INDD(INDS)

(6) Mounting zFS File Systems:
Mounting zFS File Systems


To add entries so that the zFS file systems are mounted automatically on the next IPL:
From z/OS 1.3 upwards, zFS file systems can be mounted via BPXPRMxx e.g.

MOUNT FILESYSTEM('OMVS.ZFS.COMPAT.AGR001') TYPE(ZFS)
MOUNTPOINT('/etc/zfs/mntpoint')

Prior to z/OS 1.3 zFS file systems could not be mounted via BPXPRMxx.
To mount via IPL you should place /usr/sbin/mount commands in /etc/rc.
For example:

/usr/sbin/mount -f OMVS.ZFS.COMPAT.AGR001 -t ZFS /etc/zfs/mntpoint

Either command can be entered via TSO or OMVS respectively to mount a file system post IPL.

Usefull Parameters on the MOUNT command:

AGGRFULL(90,5) Issues WTO when Aggregate is 90% full and every 5% after.
AGGRGROW File system can dynamically grow

Examples:

MOUNT FILESYSTEM('OMVS.ZFS.COMPAT.AGR0001') MOUNTPOINT('/etc/zfs/mntpoint')
TYPE(ZFS) MODE(RDWR) PARM('AGGRFULL(90,5)')

/usr/sbin/mount -f OMVS.ZFS.COMPAT.AGR0001 -t ZFS -o 'AGGRFULL(90,5)' /etc/zfs/mntpoint

(7) Determining Free Space in an Aggregate:
Display a Brief summary of aggregate space:

zfsadm aggrinfo

Result:

/:zfsadm aggrinfo
IOEZ00370I A total of 2 aggregates are attached.
OMVS.ZFS.SAMPLE.FILE1 (R/W COMP): 636386 K free out of total 720000
OMVS.ZFS.SAMPLE.FILE2 (R/W COMP): 971840 K free out of total 1080000

Display a Detailed summary of aggregate space:

zfsadm aggrinfo -long

Result:

/:zfsadm aggrinfo -long
IOEZ00370I A total of 2 aggregates are attached.
OMVS.ZFS.SAMPLE.FILE1 (R/W COMP): 636386 K free out of total 720000
version 1.4

79498 free 8k blocks; 402 free 1K fragments
3600 K log file; 48 K filesystem table
112 K bitmap file


OMVS.ZFS.SAMPLE.FILE2 (R/W COMP): 971840 K free out of total 1080000
version 1.4

120639 free 8k blocks; 6728 free 1K fragments
10800 K log file; 56 K filesystem table
160 K bitmap file

Display a Detailed summary of a specific aggregate space:

zfsadm aggrinfo OMVS.ZFS.SAMPLE.FILE1 -long

Result:

/:zfsadm aggrinfo OMVS.ZFS.SAMPLE.FILE1 -long
OMVS.ZFS.SAMPLE.FILE1 (R/W COMP): 636378 K free out of total 720000
version 1.4

79497 free 8k blocks; 402 free 1K fragments
3600 K log file; 48 K filesystem table
112 K bitmap file

沒有留言:

張貼留言