Handling lost device reservations
A DASD reservation by your Linux® instance can be lost if another system unconditionally reserves this DASD.
About this task
This other system then has exclusive I/O access to the DASD for the duration of
the unconditional reservation. Such unconditional reservations can
be useful for handling error situations where:
- Your Linux instance cannot gracefully release the DASD.
- Another system requires access to the DASD, for example, to perform recovery actions.
After the DASD is released by the other system, your Linux instance might process
pending I/O requests and write faulty data to the DASD. How to prevent
pending I/O requests from being processed depends on the reservation
policy. There are two reservation policies:
- ignore
- All I/O operations for the DASD are blocked until the DASD is released by the second system. When using this policy, reboot your Linux instance before the other system releases the DASD. This policy is the default.
- fail
- All I/O operations are returned as failed until the DASD is set offline or until the reservation state is reset. When using this policy, set the DASD offline and back online after the problem is resolved.
Procedure
Set the reservation policy with a command of this form:
# echo <policy> > /sys/bus/ccw/devices/<device_bus_id>/reservation_policy
where: - <device_bus_id>
- specifies the DASD.
- <policy>
- is one of the available policies,
ignore
orfail
.
Examples
- The command of this example sets the reservation policy for a DASD
with bus ID
0.0.7009
tofail
.# echo fail > /sys/bus/ccw/devices/0.0.7009/reservation_policy
- This example shows a small scenario. The first two commands confirm
that the reservation policy of the DASD is
fail
and that the reservation has been lost to another system. Assuming that the error that had occurred has already been resolved and that the other system has released the DASD, operations with the DASD are resumed by setting it offline and back online.# cat /sys/bus/ccw/devices/0.0.7009/reservation_policy fail # cat /sys/bus/ccw/devices/0.0.7009/last_known_reservation_state lost # chccwdev -d 0.0.7009 # chccwdev -e 0.0.7009