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.
When you set a DASD offline, the deregistration process is synchronous, unless the device is disconnected. For disconnected devices, the deregistration process is asynchronous.
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.
The chzdev command uses safe offline (if available), unless you specify the
--force option.
Examples
- To set a DASD with device bus-ID 0.0.b100 online, issue:
# chzdev -e dasd 0.0.b100
This setting persists across re-boots. For more details, see Device configuration with chzdev and lszdev. To apply this setting to the running system only, use the chzdev command with the
-aoption or one of the following commands:# chccwdev -e dasd 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:
# chzdev -d dasd 0.0.b100
This setting persists across re-boots. For more details, see Device configuration with chzdev and lszdev. To apply this setting to the running system only, use the chzdev command with the
-aoption or one of the following commands:# 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:
# 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.- 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 will be lost.