Setting a DASD online or offline

Red Hat Enterprise Linux 8.6 LPAR mode z/VM guest KVM guest

Use the chzdev command, the chccwdev command, or the online sysfs attribute of the device to set DASDs online or offline.

About this task

When Linux® boots, it senses your DASD. Depending on your specification for the dasd= parameter, it automatically sets devices online.

Procedure

Use the chzdev command to set a DASD online or offline.

Alternatively, use the chccwdev command, or write 1 to the device's sysfs online attribute to set it online or 0 to set it offline. In contrast to the sysfs attribute, the chccwdev command triggers a cio_settle for you and waits for the cio_settle to complete.

Outstanding I/O requests are canceled when you set a device offline. To wait indefinitely for outstanding I/O requests to complete before setting the device offline, use the chccwdev option --safeoffline or the sysfs attribute safe_offline.fcp_The chzdev command uses safe offline (if available), unless you specify the --force option.

When you set a DASD offline, the deregistration process is synchronous, unless the device is disconnected. For disconnected devices, the deregistration process is asynchronous.

Examples

  • To set a DASD with device bus-ID 0.0.b100 online, issue:
    # chzdev -e dasd 0.0.b100 --active
    or
    # chccwdev -e 0.0.b100
    or
    # echo 1 > /sys/bus/ccw/devices/0.0.b100/online
  • To set a DASD with device bus-ID 0.0.b100 offline, issue:
    # chzdev -d dasd 0.0.b100 --active
    or
    # chccwdev -d 0.0.b100
    or
    # echo 0 > /sys/bus/ccw/devices/0.0.b100/online
  • To complete outstanding I/O requests and then set a DASD with device bus-ID 0.0.4711 offline, issue:
    # chccwdev -s 0.0.4711
    or
    # echo 1 > /sys/bus/ccw/devices/0.0.4711/safe_offline
    If an outstanding I/O request is blocked, the command might wait forever. Reasons for blocked I/O requests include reserved devices that can be released or disconnected devices that can be reconnected.
    1. Try to resolve the problem that blocks the I/O request and wait for the command to complete.
    2. If you cannot resolve the problem, issue chccwdev -d to cancel the outstanding I/O requests. The data is lost.