NVMe device hotplug unplug procedure change
Because UEK R5 adds support for NVMe subsystems and multipathing, enumerated device names that are generated by the kernel are not stable. The result is that the procedure for identifying and unplugging NVMe devices by using hotplug functionality is slightly different than the procedure that you may have followed when using other kernel releases.
Perform the following steps to identify, power down, and unplug the appropriate device:
-
Identify the disk that you wish to remove, according to its WWN or UUID, by using the lsblk command:
# lsblk -o +UUID,WWN,MODEL
Take note of the enumerated kernel instance name that is assigned to the device; for example:
nvme0n1
.Important:
it is important to understand that the device name does not necessarily map to the controller or PCIe bridge to which it is attached. See NVMe device names change across reboots.
-
Search for the device path to obtain the PCI domain identifier for the device:
# find /sys/devices -iname nvme0n1 /sys/devices/pci0000:85/0000:85:01.0/0000:8d:00.0/nvme/nvme1/nvme0n1
Note that
0000:8d:00.0
in the returned path for the device is the PCI domain identifier for the device. You will need this information to proceed. -
Obtain the physical slot number for the NVMe drive. Under UEK R5, the slot is bound to the NVMe device directly, not the PCIe controller.
You can locate the slot number for the NVMe device by running the lspci command and by querying the PCI domain identifier for the device in verbose mode, for example:
# lspci -s 0000:8d:00.0 -vvv 8d:00.0 Non-Volatile memory controller: Intel Corporation Express Flash NVMe P4500 (prog-if 02 [NVM Express]) Subsystem: Oracle/SUN Device 4871 Physical Slot: 104-1 …
Note that the Physical Slot number for the device in the previous example is
104-1
. This value is required to proceed. -
Use the Physical Slot number for the device to find its bus interface:
# find /sys -iname "104-1" /sys/bus/pci/slots/104-1
-
Use the returned bus interface path to power off the NVMe drive:
# echo 0 > /sys/bus/pci/slots/104-1/power
Depending on your hardware, the blue disk LED located on the front panel of the system may display to indicate that you can safely remove the disk drive.