Setting a DASD online or offline
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
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:
or# chzdev -e dasd 0.0.b100 --active
or# chccwdev -e 0.0.b100
# echo 1 > /sys/bus/ccw/devices/0.0.b100/online
- To set a DASD with device bus-ID 0.0.b100 offline, issue:
or# chzdev -d dasd 0.0.b100 --active
or# chccwdev -d 0.0.b100
# 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:
or# chccwdev -s 0.0.4711
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.# echo 1 > /sys/bus/ccw/devices/0.0.4711/safe_offline
- Try to resolve the problem that blocks the I/O request and wait for the command to complete.
- If you cannot resolve the problem, issue chccwdev -d to cancel the outstanding I/O requests. The data is lost.
Dynamic attach and detach
You can dynamically attach devices to a running Red Hat® Enterprise Linux 8.6 for IBM Z instance, for example, from z/VM®.
When a DASD is attached, Linux attempts to initialize it according to the DASD device driver configuration. You can then set the device online. You can automate setting dynamically attached devices online by using CCW hotplug events.
Be careful to avoid errors when working with devices that have become available to a running Linux instance.