Published at 11/5/2024

Enabling USS AutoMount

AutoMount - What Is It?

z/OS UNIX System Services (USS), sometimes referred to as OMVS, provides the ability to automatically both allocate and/or mount a filesystem for use as a users home directory. This filesystem is a ZFS dataset that is defined in a USS file.

This is not an exhaustive explanation but should be enough to get you started.

Note: If a mount point (such as /u) is to be used for AutoMount then it can only be used for AutoMount. See below for a suggested migration if you wish to retain /u as your mount point for user home directories.

See the IBM Documentation for more information at https://www.ibm.com/docs/en/zos/3.1.0?topic=descriptions-automount-configure-automount-facility

Why Use AutoMount?

Many reasons exist to use AutoMount - among them are:

  1. Eliminate the requirement to manually allocate the users home filesystem when the userid is defined.
  2. For infrequently used home filesystems the ZFS dataset can be migrated by DFSMShsm.
  3. It's just easier once it is setup.

And once enabled completely there is no more need to pre-allocate a ZFS for a users home directory (aka filesystem) ever again.

When the user connects via OMVS, or shell, their personal ZFS will be allocated if it does not exist and then mounted, and if it does exist then it will just be mounted.

Steps To Define

  1. Create two files

/etc/auto.master

This file defines the mount point and then the default allocations for the filesystems.

/u   /etc/u.map

/etc/u.map


name      *
type         ZFS
Filesystem  <uc_name>.OMVS.ZFS
mode      rdwr
duration  60
delay       10
setuid      no
allocuser  space(5,5) cyl pathperm(755) dataclas(xxx)

Replace the dataclas(xxx) with a valid dataclas or other SMS allocation construct (mgmtclas or storclas).

The permissions for the files should be:

/etc/auto.master 755 (or rwxr--r--) /etc/u.map 700 (or rwx------)

Activating AutoMount

Update /etc/rc

Update your /etc/rc file to automatically start the automount service at IPL time.

#Start the Automount Facility
/usr/sbin/automount

System Parmlib Update

Next update your active BPXPRMxx member with this:

FILESYSTYPE TYPE(AUTOMNT) ENTRYPOINT(BPXTAMD)

Possible migration Scenario

Assuming you wish to use the /u mount point for the user home filesystem mounts and that you are currently using it, then you need to copy all existing directories under /u to a new location until all the migrations are completed.

  1. mkdir /u_old
  2. Copy using something like this sudo cp -rp /u /u-old 2a. If sudo is not available then use su before the cp
  3. in the /etc/profile add a call to a script if the /u/userid is empty to invoke the command to copy from the /u_old/userid to /u/userid: cp -rp /u_old/userid/* /u/userid/ (no su or sudo required) 3a. In the copy script be sure to let the user know what is happening using the echo command

Share on social media

Facebook share buttonReddit share buttonThreads share button