Working with DASDs in a copy-pair relation

6.10 LPAR mode z/VM guest KVM guest

Control the copy relation of DASD devices on Linux with sysfs attributes.

Before you begin

To set up a copy-pair relationship, the secondary device must be offline while the primary device can be online or offline.

About this task

DASDs can be set up in a copy-pair relationship using, for example, Peer-to Peer- Remote-Copy (PPRC). A pair consists of a primary volume and a secondary volume. Data written to the primary volume is replicated on the secondary volume by the storage system.

This task describes how to set up a copy-pair relation on Linux. It will not set up the storage server. Find out what the copy-pairs are from your storage server and match them in Linux.

You can control the copy-pair relationship of a DASD with the copy_pair and copy_role sysfs attributes. You can use primary DASDs as ordinary block devices, but you cannot directly access secondary devices.

Procedure

  • To query the copy role of a device, read from the copy_role sysfs attribute.
    Possible values are:
    none
    Not part of a copy relation or no copy relation has been set up.
    primary
    The device is the primary device in a copy relation.
    secondary
    The device is the secondary device in a copy relation.

    For example, to query the copy-pair role of a DASD with the device bus-ID 0.0.9700, issue:

    # cat /sys/bus/ccw/devices/0.0.9700/copy_role
    primary
    The example shows that DASD 0.0.9700 is a primary device.
  • To add a copy-pair, issue a command of this form:
    # echo <primary_bus_ID>,<secondary_bus_ID> > /sys/bus/ccw/devices/<bus_ID>/copy_pair
    Where:
    <primary_bus_ID>
    is the device bus-ID of the primary DASD device.
    <secondary_bus_ID>
    is the device bus-ID of the secondary DASD device.
    <bus_ID>
    is the device bus-ID of either the primary or secondary DASD device; the relationship is set up for both devices.
    For example, to add a copy pair with primary device 0.0.9700 and secondary device 0.0.9740, issue:
    # echo 0.0.9700,0.0.9740 > /sys/bus/ccw/devices/0.0.9700/copy_pair
    For multiple secondary device, repeat the setup for each pair. Cascading secondary devices are not supported. If a mismatch is detected, the devices cannot be set online.
  • To delete all copy-pairs for a device, issue a command of this form:
    # echo clear > /sys/bus/ccw/devices/<bus_ID>/copy_pair
    All relations are deleted on the device with bus_ID and all associated devices.
    For example:
    # cat /sys/bus/ccw/devices/0.0.9700/copy_pair
    0.0.9700,0.0.9740
    # echo clear > /sys/bus/ccw/devices/0.0.9700/copy_pair
    # cat /sys/bus/ccw/devices/0.0.9700/copy_pair
    # cat /sys/bus/ccw/devices/0.0.9740/copy_pair