Mapping block devices to CCW devices
![]()
Each virtual block device corresponds to an online CCW device.
Other than the standard device nodes, udev-created device nodes can be based on the bus ID of the CCW device and so provide a persistent mapping of node to CCW device. Preferably, use such persistent device nodes when working with virtual block devices.
Use the information that follows if you need to find out the current mapping between standard device nodes and CCW devices. For example, you might need this mapping if your distribution does not provide suitable udev-created device nodes or for diagnostic explorations.
# ls /sys/blockThe command output is a list of symbolic links that match the device names of the block devices.
# ls /sys/block vda vdb vdc
These links contain several attributes, including another symbolic link, device. To find the bus ID for a particular block device, issue a command according to the following example:
# ls -1 /sys/block/vdb/device/../.. | head -1 0.0.1111
# ls -d /sys/devices/css0/*/*/virtio*/block/*
# ls -d /sys/devices/css0/*/*/virtio*/block/* /sys/devices/css0/0.0.0000/0.0.10b1/virtio3/block/vda /sys/devices/css0/0.0.0001/0.0.1111/virtio4/block/vdb /sys/devices/css0/0.0.0002/0.0.11ab/virtio5/block/vdc
# ls -d /sys/devices/css0/*/*/virtio*/block/* | awk -F "/" '{print $9 "\t" $6}'
vda 0.0.10b1
vdb 0.0.1111
vdc 0.0.11ab