Accessing DASD by force

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

A Linux® instance can encounter DASDs that are locked by another system.

Such a DASD is referred to as externally locked or boxed. The Linux instance cannot analyze a DASD while it is externally locked.

About this task

To check whether a DASD has been externally locked, read its availability attribute. This attribute should be good. If it is boxed, the DASD has been externally locked. Because a boxed DASD might not be recognized as DASD, it might not show up in the device driver view in sysfs. If necessary, use the device category view instead.

CAUTION:
Breaking an external lock can have unpredictable effects on the system that holds the lock.

Procedure

  1. Optional: To read the availability attribute of a DASD, issue a command of this form:
    # cat /sys/bus/ccw/devices/<device_bus_id>/availability
    Example: This example shows that a DASD with device bus-ID 0.0.b110 (device number 0xb110) has been externally locked.
    # cat /sys/bus/ccw/devices/0.0.b110/availability
    boxed
    If the DASD is an ECKD type DASD and if you know the device bus-ID, you can break the external lock and set the device online. This means that the lock of the external system is broken with the unconditional reserve channel command.
  2. To force a boxed DASD online, write force to the online device attribute. Issue a command of this form:
    # echo force > /sys/bus/ccw/devices/<device_bus_id>/online
    Example: To force a DASD with device number 0xb110 online issue:
    # echo force > /sys/bus/ccw/devices/0.0.b110/online

Results

If the external lock is successfully broken or if the lock has been surrendered by the time the command is processed, the device is analyzed and set online. If it is not possible to break the external lock (for example, because of a timeout, or because it is an FBA-type DASD), the device remains in the boxed state. This command might take some time to complete.

For information about breaking the lock of a DASD that has already been analyzed see tunedasd - Adjust low-level DASD settings.