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
Many reasons exist to use AutoMount - among them are:
ZFS
dataset can be migrated by DFSMShsm.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.
This file defines the mount point and then the default allocations for the filesystems.
/u /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------
)
Update your /etc/rc
file to automatically start the automount
service at IPL time.
#Start the Automount Facility
/usr/sbin/automount
Next update your active BPXPRMxx member with this:
FILESYSTYPE TYPE(AUTOMNT) ENTRYPOINT(BPXTAMD)
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.
mkdir /u_old
sudo cp -rp /u /u-old
2a. If sudo
is not available then use su
before the cp
/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