On Mon, Oct 30, 2023 at 09:56:22AM +0100, Oliver Neukum via openSUSE Factory wrote:
On 26.10.23 17:03, Martin Wilck wrote:
On Thu, 2023-10-26 at 12:32 +0200, Oliver Neukum wrote:
True in that regard is a name that is
a) based on a path b) refers to a device as opposed to a medium
To illustrate my point:
/dev/disk/by-path pci-0000:02:00.0-nvme-1 pci-0000:02:00.0-nvme-1- part4 pci-0000:06:00.3-usb-0:1.3.4:1.0-scsi- 0:0:0:3 pci-0000:06:00.3-usbv2-0:1.3.4:1.0-scsi-0:0:0:3 pci-0000:02:00.0-nvme-1-part1 pci-0000:06:00.3-usb-0:1.3.4:1.0-scsi- 0:0:0:0 pci-0000:06:00.3-usbv2-0:1.3.4:1.0-scsi-0:0:0:0 pci-0000:02:00.0-nvme-1-part2 pci-0000:06:00.3-usb-0:1.3.4:1.0-scsi- 0:0:0:1 pci-0000:06:00.3-usbv2-0:1.3.4:1.0-scsi-0:0:0:1 pci-0000:02:00.0-nvme-1-part3 pci-0000:06:00.3-usb-0:1.3.4:1.0-scsi- 0:0:0:2 pci-0000:06:00.3-usbv2-0:1.3.4:1.0-scsi-0:0:0:2
/dev/disk/by-uuid/ 6b557439-a722-46c6-b9fa-e3395a5f4d40 722799ab-821e-4921-9c20- f97d284ca32e 9C52-D41D fe8a60ac-2e5b-4090-a9eb-d68149568dfb
A lot of devices (not media) that exist and need to be referred to somehow.
And you don't see by-id links for these?
Yes, I have them, but look at how they are constructed. They are (showing all for comparison):
nvme-eui.ace42e00060644b22ee4ac0000000001 nvme-SKHynix_HFS512GD9TNI-L2B0B_CS0AN73541VA1AL6G_1-part1 nvme-SKHynix_HFS512GD9TNI-L2B0B_CS0AN73541VA1AL6G-part4 nvme-eui.ace42e00060644b22ee4ac0000000001-part1 nvme-SKHynix_HFS512GD9TNI-L2B0B_CS0AN73541VA1AL6G_1-part2 usb-Generic_USB_CF_Reader_058F312D81B1-0:1 nvme-eui.ace42e00060644b22ee4ac0000000001-part2 nvme-SKHynix_HFS512GD9TNI-L2B0B_CS0AN73541VA1AL6G_1-part3 usb-Generic_USB_CF_Reader_058F312D81B1-0:1-part1 nvme-eui.ace42e00060644b22ee4ac0000000001-part3 nvme-SKHynix_HFS512GD9TNI-L2B0B_CS0AN73541VA1AL6G_1-part4 usb-Generic_USB_MS_Reader_058F312D81B1-0:3 nvme-eui.ace42e00060644b22ee4ac0000000001-part4 nvme-SKHynix_HFS512GD9TNI-L2B0B_CS0AN73541VA1AL6G-part1 usb-Generic_USB_SD_Reader_058F312D81B1-0:0 nvme-SKHynix_HFS512GD9TNI-L2B0B_CS0AN73541VA1AL6G nvme-SKHynix_HFS512GD9TNI-L2B0B_CS0AN73541VA1AL6G-part2 usb-Generic_USB_SM_Reader_058F312D81B1-0:2 nvme-SKHynix_HFS512GD9TNI-L2B0B_CS0AN73541VA1AL6G_1 nvme-SKHynix_HFS512GD9TNI-L2B0B_CS0AN73541VA1AL6G-part3
usb-Generic_USB_SM_Reader_058F312D81B1-0:2. That is taking the path as ID. We are presenting the path and the vendor - Bus 004 Device 005: ID 058f:9540 Alcor Micro Corp. AU9540 Smartcard Reader - as id. That does not change the core problem. The only unique information about a device that we'll always have is the path.
The path is not stable either. USB and PCI devices can be plugged into a different port. Device order is not fixed - that's the very reason why sdX name is not stable. I would expect that the numbering of USB ports on a hub depends on the driver enumerating them and rarely changes. On the other hand, the order of the hubs and bus numbering would be arbitrary depending on device probe order. The PCI port order probably depends on some firmware table describing the PCI topology, and can potentially change with BIOS update. Thanks Michal