Bug 2185048

Summary: Document NVMe udev naming change
Product: Red Hat Enterprise Linux 9 Reporter: Jenifer Abrams <jhopper>
Component: DocumentationAssignee: Michal Stubna <mstubna>
Documentation sub component: default QA Contact: RHEL DPM <rhel-docs>
Status: CLOSED CURRENTRELEASE Docs Contact: Michal Stubna <mstubna>
Severity: medium    
Priority: medium CC: gfialova, rhel-docs
Version: 9.0Keywords: Documentation
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Known Issue
Doc Text:
.udev rule change for NVMe devices There is a udev rule change for NVMe devices that adds `OPTIONS="string_escape=replace"` parameter. This leads to a disk by-id naming change for some vendors, if the serial number of your device has leading whitespace.
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-05-05 16:35:54 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Jenifer Abrams 2023-04-06 15:46:40 UTC
Document URL: 
https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/9/html-single/managing_file_systems/index#device-identifiers_assembly_overview-of-persistent-naming-attributes

(Or any other docs that mention udev naming for NVMe devices)

Section Number and Name: 

13.3. Device names managed by the udev mechanism in /dev/disk/

Describe the issue: 

Starting in RHEL 9 there is a udev rule change for NVMe devices that adds: OPTIONS="string_escape=replace"

RHEL 9:

$ grep -nr 'SYMLINK.*nvme-' /usr/lib/udev/rules.d/
/usr/lib/udev/rules.d/60-persistent-storage.rules:33:KERNEL=="nvme*[0-9]n*[0-9]", ATTR{wwid}=="?*", SYMLINK+="disk/by-id/nvme-$attr{wwid}"
/usr/lib/udev/rules.d/60-persistent-storage.rules:34:KERNEL=="nvme*[0-9]n*[0-9]p*[0-9]", ENV{DEVTYPE}=="partition", ATTRS{wwid}=="?*", SYMLINK+="disk/by-id/nvme-$attr{wwid}-part%n"
/usr/lib/udev/rules.d/60-persistent-storage.rules:41:  OPTIONS="string_escape=replace", ENV{ID_SERIAL}="$env{ID_MODEL}_$env{ID_SERIAL_SHORT}", SYMLINK+="disk/by-id/nvme-$env{ID_SERIAL}"
/usr/lib/udev/rules.d/60-persistent-storage.rules:47:  OPTIONS="string_escape=replace", ENV{ID_SERIAL}="$env{ID_MODEL}_$env{ID_SERIAL_SHORT}", SYMLINK+="disk/by-id/nvme-$env{ID_SERIAL}-part%n"

RHEL 8:

$ grep -nr 'SYMLINK.*nvme-' /usr/lib/udev/rules.d/
/usr/lib/udev/rules.d/60-persistent-storage.rules:19:KERNEL=="nvme*[0-9]n*[0-9]", ATTR{wwid}=="?*", SYMLINK+="disk/by-id/nvme-$attr{wwid}"
/usr/lib/udev/rules.d/60-persistent-storage.rules:20:KERNEL=="nvme*[0-9]n*[0-9]p*[0-9]", ENV{DEVTYPE}=="partition", ATTRS{wwid}=="?*", SYMLINK+="disk/by-id/nvme-$attr{wwid}-part%n"
/usr/lib/udev/rules.d/60-persistent-storage.rules:26:  ENV{ID_SERIAL}="$env{ID_MODEL}_$env{ID_SERIAL_SHORT}", SYMLINK+="disk/by-id/nvme-$env{ID_SERIAL}"
/usr/lib/udev/rules.d/60-persistent-storage.rules:31:  ENV{ID_SERIAL}="$env{ID_MODEL}_$env{ID_SERIAL_SHORT}", SYMLINK+="disk/by-id/nvme-$env{ID_SERIAL}-part%n"

This change is due to: https://github.com/systemd/systemd/commit/5118e8e71dda211d20e34ec8d3012186ba27d3d3

and discussion ongoing in: https://github.com/systemd/systemd/issues/27155 

When running RHEL 9.x, this leads to a disk by-id naming change for some vendors, if the device serial num has leading whitespace, for ex:

8.x:  /dev/disk/by-id/nvme-Vendor_model__Serial
9.x: /dev/disk/by-id/nvme-Vendor_model_______Serial

The existence of any leading whitespace can be seen in the device serial:
$ cat /sys/class/block/nvm*/device/serial

Suggestions for improvement: 

Document this by-id naming change from RHEL 8, for certain NVMe devices (depending on vendor serial number format).


Additional information: 
Related bug: https://issues.redhat.com/browse/OCPBUGS-11375