Examples of udev-created SCSI device nodes

6.18 LPAR mode z/VM guest

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

Note: The format of the nodes that udev creates for you depends on distribution-specific configuration files. The device node descriptions in this section are according to generic rules as found in many distributions and in the udev rules file as it is shipped with the s390-tools packages.
Device nodes that are based on device names
udev creates device nodes that match the device names that are used by the kernel. These standard device nodes have the form /dev/<name>.

The examples in this section use standard device nodes as assigned by the SCSI stack. These nodes have the form /dev/sd<x> for entire disks and /dev/sd<x><n> for partitions. In these node names <x> represents one or more letters and <n> is an integer. See Documentation/devices.txt in the Linux® source tree for more information about the SCSI device naming scheme.

To help you identify a particular device, udev creates additional device nodes that are based on the device's bus ID, the device label, and information about the file system on the device. The file system information can be a universally unique identifier (UUID) and, if available, the file system label.

Device nodes that are based on bus IDs
udev creates device nodes of the form
/dev/disk/by-path/ccw-<device_bus_id>-fc-<wwpn>-lun-<lun>
for whole SCSI device and
/dev/disk/by-path/ccw-<device_bus_id>-fc-<wwpn>-lun-<lun>-part<n>
for the <n>th partition, where <wwpn> is the worldwide port number of the target port and <lun> is the logical unit number that represents the target SCSI device.
Note: The format of these udev-created device nodes has changed and now matches the common code format. Device nodes of the prior form, ccw-<device_bus_id>-zfcp-<wwpn>:<lun> or ccw-<device_bus_id>-zfcp-<wwpn>:<lun>-part<n>, are no longer created.
Device nodes that are based on file system information
udev creates device nodes of the form
/dev/disk/by-uuid/<uuid>
where <uuid> is a unique file-system identifier (UUID) for the file system in a partition.
If a file system label is assigned, udev also creates a node of the form:
/dev/disk/by-label/<label>

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

Additional device nodes
/dev/disk/by-id contains additional device nodes for the SCSI device and partitions that are all based on a unique SCSI identifier that is generated by querying the device.

Example

For a SCSI device that is assigned the device name sda, has two partitions that are labeled boot and SWAP-sda2 respectively, a device bus-ID 0.0.3c1b (device number 0x3c1b), and a UUID 7eaf9c95-55ac-4e5e-8f18-065b313e63ca for the first and b4a818c8-747c-40a2-bfa2-acaa3ef70ead for the second partition, udev creates the following device nodes:

For the whole SCSI device:
  • /dev/sda (standard device node according to the SCSI device naming scheme)
  • /dev/disk/by-path/ccw-0.0.3c1b-fc-0x500507630300c562-lun-0x401040ea00000000
  • /dev/disk/by-id/scsi-36005076303ffc56200000000000010ea
  • /dev/disk/by-id/wwn-0x6005076303ffc56200000000000010ea
For the first partition:
  • /dev/sda1 (standard device node according to the SCSI device naming scheme)
  • /dev/disk/by-label/boot
  • /dev/disk/by-path/ccw-0.0.3c1b-fc-0x500507630300c562-lun-0x401040ea00000000-part1
  • /dev/disk/by-id/scsi-36005076303ffc56200000000000010ea-part1
  • /dev/disk/by-uuid/7eaf9c95-55ac-4e5e-8f18-065b313e63ca
  • /dev/disk/by-id/wwn-0x6005076303ffc56200000000000010ea-part1
For the second partition:
  • /dev/sda2 (standard device node according to the SCSI device naming scheme)
  • /dev/disk/by-label/SWAP-sda2
  • /dev/disk/by-path/ccw-0.0.3c1b-fc-0x500507630300c562-lun-0x401040ea00000000-part2
  • /dev/disk/by-id/scsi-36005076303ffc56200000000000010ea-part2
  • /dev/disk/by-uuid/b4a818c8-747c-40a2-bfa2-acaa3ef70ead
  • /dev/disk/by-id/wwn-0x6005076303ffc56200000000000010ea-part2

Device nodes by-uuid use a unique file-system identifier that does not relate to the partition number.