SCSI device nodes
User space programs access SCSI devices through device nodes.
SCSI device names are assigned in the order in which the devices
are detected. In a typical SAN environment, this can mean a seemingly
arbitrary mapping of names to actual devices that can change between
boots. Therefore, using standard device nodes of the form /dev/<device_name>
where <device_name> is the device name that the SCSI stack
assigns to a device, can be a challenge.
Ubuntu Server 20.04.1 LTS provides udev to create device nodes for you. Use the device nodes to identify the corresponding actual device.
- 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. For more information about the SCSI device naming scheme, see the /linux-doc/admin-guide/devices.txt.gz
file in the linux-doc package.
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
for whole SCSI device and/dev/disk/by-path/ccw-<device_bus_id>-fc-<wwpn>-lun-<lun>
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./dev/disk/by-path/ccw-<device_bus_id>-fc-<wwpn>-lun-<lun>-part<n>
- Device nodes that are based on file system information
- udev creates device nodes of the form
where <uuid> is a unique file-system identifier (UUID) for the file system in a partition./dev/disk/by-uuid/<uuid>
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 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:
- /dev/sda (standard device node according to the SCSI device naming scheme)
- /dev/disk/by-path/ccw-0.0.3c1b-fc-0x500507630300c562-lun-0x401040ea000000
- /dev/disk/by-id/scsi-36005076303ffc56200000000000010ea
- /dev/disk/by-id/wwn-0x6005076303ffc56200000000000010ea
- /dev/sda1 (standard device node according to the SCSI device naming scheme)
- /dev/disk/by-path/ccw-0.0.3c1b-fc-0x500507630300c562-lun-0x401040ea000000-part1
- /dev/disk/by-uuid/7eaf9c95-55ac-4e5e-8f18-065b313e63ca
- /dev/disk/by-label/boot
- /dev/disk/by-id/scsi-36005076303ffc56200000000000010ea-part1
- /dev/disk/by-id/wwn-0x6005076303ffc56200000000000010ea-part1
- /dev/sda2 (standard device node according to the SCSI device naming scheme)
- /dev/disk/by-path/ccw-0.0.3c1b-fc-0x500507630300c562-lun-0x401040ea000000-part2
- /dev/disk/by-uuid/b4a818c8-747c-40a2-bfa2-acaa3ef70ead
- /dev/disk/by-label/SWAP-sda2
- /dev/disk/by-id/scsi-36005076303ffc56200000000000010ea-part2
- /dev/disk/by-id/wwn-0x6005076303ffc56200000000000010ea-part2
Multipath
Users of SCSI-over-Fibre Channel attached devices should always consider setting up and using redundant paths through their Fibre Channel Storage Area Network.
Path redundancy improves the availability of the LUNs. In Linux, you can set up path redundancy using the device-mapper multipath tool. For information about multipath devices and multipath partitions, see the chapter about multipathing in How to use FC-attached SCSI devices with Linux on z Systems®, SC33-8413.