IBM Cloud Docs
Mounting file shares on z/OS

Mounting file shares on z/OS

Use these instructions to connect a z/OS-based IBM Cloud® Compute Instance to a Network File System (NFS) file share.

Before you begin

  1. If your file share was set up with VPC access mode, verify that the virtual server instance where you want to mount the share is in the same zone as the file share. If the file share was set up with Security group access mode, verify that the virtual server instance is part of the same security group. For more information, see Mount target access modes.
  2. Confirm that a mount target for the share exists for the VPC that the instance resides in. If a new mount target is needed, follow the instructions in Creating file shares and mount targets.
  3. Get the mount path of the file share from the mount target. Mount path information can be obtained from the File share details page in the UI, from the CLI, with the API, or Terraform.

Mounting the file share

SSH into the Compute instance where you want to mount the file share, then continue with these steps to mount a file share on a z/OS host.

  1. Create a /u/ibmuser directory.

    mkdir /u/ibmuser/test
    
  2. Start the NFS client. You can issue commands D OMVS,P to verify whether the NFS client is started or not.

    • If the entry for NFS file system is in the sys1.parmlib.bpxprm00, you can safely skip this step.

    • If the entry for NFS file system is not in the sys1.parmlib.bpxprm00, you need to complete the following steps to start the NFS client:

      1. To set up the NFS client, run the following job on your z/OS virtual server instance.

        //NFSCLNT  JOB CLASS=A,MSGCLASS=H,MSGLEVEL=(1,1),NOTIFY=&SYSUID.,
        //         REGION=0M
        //*********************************************************************
        //* Configuration for the NFS client.                                 *
        //*********************************************************************
        //ALIAS    EXEC PGM=IDCAMS
        //SYSPRINT DD SYSOUT=*
        //SYSIN    DD *
          DEF ALIAS(NAME(MVSCLNT) RELATE(CATALOG.VS01.SYS)) -
            CAT(CATALOG.VS01.MASTER)
        /*
        //DEFLOG1  EXEC PGM=IEFBR14
        //SYSPRINT DD SYSOUT=*
        //LOG1     DD DSN=MVSCLNT.LOG1,
        //         DISP=(NEW,CATLG),UNIT=3390,SPACE=(CYL,(2,5),RLSE),
        //         RECFM=VB,LRECL=137,BLKSIZE=6144,VOL=SER=OPEVS1
        //*
        //DEFLOG2  EXEC PGM=IEFBR14
        //SYSPRINT DD SYSOUT=*
        //LOG2     DD DSN=MVSCLNT.LOG2,
        //         DISP=(NEW,CATLG),UNIT=3390,SPACE=(CYL,(2,5),RLSE),
        //         RECFM=VB,LRECL=137,BLKSIZE=6144,VOL=SER=OPEVS1
        //*
        //DEFRACF  EXEC PGM=IKJEFT01
        //SYSPRINT DD SYSOUT=*
        //SYSTSPRT DD SYSOUT=*
        //SYSTSIN  DD *
          RDEFINE STARTED MVSNFSC.* UACC(NONE) +
            STDATA(USER(SYSTEM) GROUP(SYS1) TRUSTED(YES))
        
        SETR REFRESH RACLIST(STARTED)
        /*
        //COPYSAMP EXEC PGM=IEBCOPY
        //SYSPRINT DD SYSOUT=*
        //SYSUT1   DD UNIT=SYSDA,SPACE=(TRK,(5,1))
        //SYSUT2   DD UNIT=SYSDA,SPACE=(TRK,(5,1))
        //SYSUT3   DD UNIT=SYSDA,SPACE=(TRK,(5,1))
        //SYSUT4   DD UNIT=SYSDA,SPACE=(TRK,(5,1))
        //INDD     DD DSN=SYS1.NFSSAMP,DISP=SHR
        //OUTDD    DD DSN=SYS1.PROCLIB,DISP=SHR
        //SYSIN    DD *
          COPY I=INDD,O=OUTDD
          SELECT MEMBER=((GFSCPROC,MVSNFSC))
        /*
        
      2. Add the following command to the SYS1.PARMLIB(BPXPRM00) after AUTOMNT.

        FILESYSTYPE TYPE(NFS) ENTRYPOINT(GFSCINIT) ASNAME(MVSNFSC)
        
      3. To start the NFS client address space MVSNFSC, issue the following commands from the console /SDSF Log.

        set OMVS=00
        
      4. To verify that the NFS client is started, issue the commands D OMVS,P.

      If the principal MVSNFSC is in the list, the NFS client is started successfully.

  3. Run the following commands from TSO to mount the file share on z/OS in ASCII format:

    mount type(NFS) filesystem(nfs02) mountpoint('/u/ibmuser/test') parm('<mount path>,xlat(y),vers(4)')
    

    You can also run the following commands to mount the file share on z/OS in binary format:

    mount type(NFS) filesystem(nfs02) mountpoint('/u/ibmuser/test') parm('<mount path>,vers(4)')
    

    For more information, see Additional mount command examples.

  4. To verify that the file share is successfully mounted to z/OS, you can run command df to display the directory /u/ibmuser/test.