Scenario: Changing the contents of a DCSS

6.10 z/VM guest

Before you change the contents of a DCSS, you must add the DCSS to Linux®, access it in a writable mode, and mount the file system on it.

About this task

The scenario that follows is based on these assumptions:
  • The Linux instance runs as a z/VM® guest with class E user privileges.
  • A DCSS was set up and can be accessed in exclusive-writable mode by the Linux instance.
  • The DCSS does not overlap with the guest's main storage.
  • There is only a single DCSS named MYDCSS.
  • The DCSS block device driver is set up and ready to be used.
The description in this scenario can readily be extended to changing the content of a set of DCSSs that form a contiguous memory space. The only change to the procedure would be mapping the DCSSs in the set to a single DCSS device in step 1. The assumptions about the set of DCSSs would be:
  • The contiguous memory space that is formed by the set does not overlap with the guest storage.
  • Only the DCSSs in the set are added to the Linux instance.

Procedure

Perform the following steps to change the contents of a DCSS:

  1. Add the DCSS to the block device driver.
    # echo MYDCSS > /sys/devices/dcssblk/add
  2. Ensure that there is a device node for the DCSS block device.
    If it is not created for you, for example by udev, create it yourself.
    1. Find out the major number that is used for DCSS block devices. Read /proc/devices:
      # cat /proc/devices
      ...
      Block devices
      ...
      254 dcssblk
      ...
      The major number in the example is 254.
    2. Find out the minor number that is used for MYDCSS.
      If MYDCSS is the first DCSS to be added, the minor number is 0. To be sure, you can read a symbolic link that is created when the DCSS is added.
      # readlink /sys/devices/dcssblk/MYDCSS/block
      ../../../block/dcssblk0
      The trailing 0 in the standard device name dcssblk0 indicates that the minor number is, indeed, 0.
    3. Create the node with the mknod command:
      # mknod /dev/dcssblk0 b 254 0
  3. Set the access mode to exclusive-write.
    # echo 0 > /sys/devices/dcssblk/MYDCSS/shared
  4. Mount the file system in the DCSS on a spare mount point.
    # mount /dev/dcssblk0 /mnt
  5. Update the data in the DCSS.
  6. Create a save request to save the changes.
    # echo 1 > /sys/devices/dcssblk/MYDCSS/save
  7. Unmount the file system.
    # umount /mnt
    The changes to the DCSS are now saved. When the last z/VM guest stops accessing the old version of the DCSS, the old version is discarded. Each guest that opens the DCSS accesses the updated copy.
  8. Remove the device.
    # echo MYDCSS > /sys/devices/dcssblk/remove
  9. Optional: If you have created your own device node, you can clean it up.
    # rm -f /dev/dcssblk0