Examples for udev-created DASD device nodes

6.10 LPAR mode z/VM guest KVM guest

The udev utility program can create device nodes that are based on device information from sysfs.

If your distribution provides udev, you can use udev to create DASD device nodes for you. Such device nodes typically include unique properties like device IDs or labels.

The DASD device driver assigns standard device names in the sequence in which DASDs are set online. To preserve the mapping between standard device nodes and DASDs across reboots, you must control the sequence in which the DASDs are set online. For example, use the dasd= kernel or module parameter.

Alternatively, you can use udev to create device nodes that are based on unique properties of a DASD and so identify a particular device. Such device nodes are independent of the sequence in which the devices are set online and can help you to reliably address an intended disk space.

For example, the device nodes can be based on the following information:
  • The bus ID of the disk
  • The disk label (VOLSER)
  • Information about the file system on the disk
The file system information can be a universally unique identifier (UUID) and, if available, the file system label.
Note: The format of the nodes that udev creates for you depends on distribution-specific configuration files. The device node descriptions that follow are according to generic rules as found in many distributions and in the 59-dasd.rules file as shipped with the s390-tools package.
Device nodes that are based on bus IDs
udev creates device nodes of the form
/dev/disk/by-path/ccw-<device_bus_id>
for whole DASD and
/dev/disk/by-path/ccw-<device_bus_id>-part<n>
for the <n>th partition.
Device nodes that are based on VOLSERs
udev creates device nodes of the form
/dev/disk/by-id/ccw-<volser>
for whole DASD and
/dev/disk/by-id/ccw-<volser>-part<n>
for the <n>th partition.

If you want to use device nodes that are based on VOLSER, be sure that the VOLSERs in your environment are unique. VOLSERs are included in the volume label.

If you assign the same VOLSER to multiple devices, Linux® can still access each device through its standard device node. However, only one of the devices can be accessed through the VOLSER-based device node. Thus, the node is ambiguous and might lead to unintentional data access.

Furthermore, if the VOLSER on the device that is addressed by the node is changed, the previously hidden device is not automatically addressed instead. To reassign the node, you must reboot Linux or force the kernel to reread the partition tables from disks, for example, by issuing:
# blockdev --rereadpt /dev/dasdzzz

You can assign VOLSERs to ECKD type devices with dasdfmt when formatting or later with fdasd when you are creating partitions.

Device nodes that are based on file system information
udev creates device nodes of the form
/dev/disk/by-uuid/<uuid>
where <uuid> is the UUID for the file system in a partition.

If a file system label exists, udev also creates a node of the form
/dev/disk/by-label/<label>

There are no device nodes for the whole DASD that are based on file system information.

If you want to use device nodes that are based on file system labels, be sure that the labels in your environment are unique.

Additional device nodes
/dev/disk/by-id contains additional device nodes for the DASD and partitions, that are all based on a device identifier as contained in the uid attribute of the DASD.

The sections that follow show how such nodes can be used to access a device by VOLSER or device bus-ID, regardless of its device name.