Setting up data set file system /dsfs on z/OS

There is a good overview of dsfs here.

The documentation is pretty good. It is clear – but I would have ordered the sections differently.

Concept

My understanding of how dsfs works is that you can access z/OS datasets, members and spool, through a Unix file system interface, and so use commands like “ls”. When you read a member, it is read into the dsfs file system, and the Unix commands work on this data. When you write to the Unix file, it is written to the dsfs file system, and the data is written to the dataset when the file is closed.

Some information is cached in the dsfs file system, and some definitions, such as DCB information on a per userid basis is also stored.

Setup the RACF definitions

//IBMRACFL JOB 1,MSGCLASS=H                                
//S1 EXEC PGM=IKJEFT01,REGION=0M
//SYSPRINT DD SYSOUT=*
//SYSTSPRT DD SYSOUT=*
//SYSTSIN DD *
ADDGROUP DSFSGRP SUPGROUP(SYS1)
ADDUSER DSFS DFLTGRP(DSFSGRP) AUTHORITY(USE) UACC(NONE)
RDEFINE STARTED DSFS.** STDATA(USER(DSFS))
SETROPTS RACLIST(STARTED)
SETROPTS RACLIST(STARTED) REFRESH
/*
//

The started task procedure is in IOE.SIOESAMP(DSFS)

You can configure it to use the parmlib concatenation. I configured it to use a member in user….parmlib.

//DSFS     PROC REGSIZE=0M                                            
//*
//DSFSGO EXEC PGM=BPXVCLNY,REGION=&REGSIZE,TIME=1440
//*
//*STEPLIB DD DISP=SHR,DSN=hlq.SIEALNKE <--DSFS LOADLIB
//IDFZPRM DD DISP=SHR,DSN=USER.Z31A.PARMLIB(DSFS) <--DSFS PARM FILE

This is automatically started when you activate the dsfs physical file system (in a bpxprmxx member).

Create the ZFS

If you are going to use encrypted data sets the ZFS needs to be encrypted. See One minute MVS – Using individual data set encryption on z/OS.

I do not know how much space you actually need. If you specify a secondary extent, the ZFS can expand as needed.

If you want the ZFS to be larger than 4GB you need to specify Extended Addressability. On ADCD there is an SMS Data Class DCEATTR with extended attributes.

The documentation talks about having the z/OS image name as part of the data set when part of a sysplex. I specified the name as part of DSFS startup.

If you are using ADCD and you use a “system” HLQ such as ZFS.DSFS, then when you move to the next release of ADCD you’ll have to migrate it. By using COLIN as a HLQ, it gets picked up automatically in the next release after I have imported the user catalog.

//IBMCLUST  JOB 1 
//DEFINE EXEC PGM=IDCAMS,REGION=0M
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
DEFINE CLUSTER (NAME(COLIN.ZFS.DSFS) -
VOLUMES(* ) -
CYL(100 1000) -
DATACLASS(DCEATTR) -
ZFS )

/*
LISTCAT ENT(COLIN.ZFS.DSFS) ALL
DELETE COLIN.ZFS.DSFS

The ZFS is formatted when it is first used, and as it expands.

Startup parameters

In USER.Z31A.PARMLIB(DSFS), referred to in the DSFS started procedure, I have

* 
UTFS_NAME=COLIN.ZFS.DSFS

Without the UTFS_NAME, it will look for a data set with the image name. If you are running in a sysplex each system needs its own ZFS.

Define the root

In TSO OMVS use mkdir /dsfs

Define the physical file system, and mount the file

I created USER.Z31A.PARMLIB(BPXPRMFS) with

FILESYSTYPE TYPE(DSFS) ENTRYPOINT(IDFFSCM) ASNAME(DSFS)

MOUNT TYPE(DSFS)
MODE(RDWR)
NOAUTOMOVE
MOUNTPOINT('/dsfs')
FILESYSTEM('COLIN.ZFS.DSFS')

Activate and start it

You can use the operator command set omvs=(FS) to activate the member bpxprmfs (defined above). This starts the address space DSFS. You could have this activated as part of IPL in the usual way.

The first time I started DSFS, I got messages

SET OMVS=(FS)                                                         
IEE252I MEMBER BPXPRMFS FOUND IN USER.Z31A.PARMLIB
BPXO032I THE SET OMVS COMMAND WAS SUCCESSFUL.
IEF196I IEF285I USER.Z31A.PARMLIB KEPT
IEF196I IEF285I VOL SER NOS= A3CFG1.
...
$HASP100 DSFS ON STCINRDR
$HASP373 DSFS STARTED
IEF403I DSFS - STARTED - TIME=08.51.23
IDFS00153I DSFS kernel: Initializing z/OS DSFS 279
Version 03.01.00 Service Level OA65531 - HZFS510.
Created on Tue Sep 12 19:21:54 EDT 2023.
Address space asid x47.
IDFS00064I USER.Z31A.PARMLIB(DSFS) is the configuration data set currently in use.
IDFS00352I DSFS is using HLQ EXCLUDE mode.
IDFS00039I DSFS kernel: initialization complete.
BPXF025I FILE SYSTEM COLIN.ZFS.DSFS IS BEING MOUNTED.
IDFS00320I Formatting to 4096 control interval 18000 for primary
IDFS00003I Primary extent loaded successfully for COLIN.ZFS.DSFS.
IDFS00034I Detaching utility file system COLIN.ZFS.DSFS.

Stop dsfs

If you get messages saying data set in use etc, this may be due to the DSFS program has started. You can stop it using f omvs,stoppfs=dsfs, fix any problems, and restart it.

Setting up permissions

Some of the dsadm commands, for example which change the configuration, need permission. The issuer must be logged in as a root user (UID=0) or have READ authority to the
SUPERUSER.FILESYS.PFSCTL resource in the z/OS UNIXPRIV class. Note: If you are permitted READ to the BPX.SUPERUSER resource in the RACF FACILITY class, you can become a UID of 0 by issuing the su command to get uid 0.

PERMIT SUPERUSER.FILESYS.PFSCTL CLASS(UNIXPRIV) ID(userid) ACCESS(READ)
SETROPTS RACLIST(UNIXPRIV) REFRESH

PERMIT BPX.SUPERUSER CLASS(FACILITY) ID(userid) ACCESS(READ)
SETROPTS RACLIST(FACILITY) REFRESH

Once it has started – now what?

In OMVS you can use the ls -ltr command

IBMUSER:/u/ibmuser: >ls -ltr  /dsfs                           
total 0
drwxrwxrwx 2 OMVSKERN SYS1 0 Sep 9 03:51 txt
drwxrwxrwx 2 OMVSKERN SYS1 0 Sep 9 03:51 sysout
drwxrwxrwx 2 OMVSKERN SYS1 0 Sep 9 03:51 rec
drwxrwxrwx 2 OMVSKERN SYS1 0 Sep 9 03:51 bin

You can use the dsfs commands in Unix Services

dsadm fsinfo
File System Name: COLIN.ZFS.DSFS

System: S0W1 Devno: 0
Size: 72000K Free 8K Blocks: 8732
Free 1K Fragments: 7 Log File Size: 2056K
Bitmap Size: 16K Anode Table Size: 8K
File System Objects: 7 Version: 1
Overflow Pages: 0 Overflow HighWater: 0
Space Monitoring: 0,0
ENOSPC Errors: 0 Disk IO Errors: 0
Status: NE,NC

File System Creation Time: Sep 9 03:51:25 2024
Mount Time: Sep 9 03:51:25 2024

Last Grow Time: n/a

3 thoughts on “Setting up data set file system /dsfs on z/OS

Leave a comment