Score:0

Persistent device naming per physical port

cn flag

I have quite a few servers that are used to test some FC and SAS hardware. One of the nightmares is that I seem to be unable to find something in udev that identifies a physical port. What I ideally want is to have something in /dev that maps device names to physical ports on my HBA. So for example /dev/fc/by-physical-port/0 would always be the same exact port. I can't use any serial number or model or as an identifier because these are constantly changing.

The location in sysfs is not consistent. Sometimes the some port has a different location and sometimes different ports have the same location.

Is there anyway to handle this? Either with udev rules, or any other way? For some context It will always be a direct connection to a device.

Any help is appreciated!

John Smith avatar
cn flag
@sudodus Like I said these are different drives but same physical port. I want to have persistence according to the physical port even though different drives are connected.
user1686 avatar
us flag
If you run `udevadm info` on the device (both with the `-a` option and without), does it have any sysfs attribute or udev property that directly tells you which port it's on?
John Smith avatar
cn flag
@user1686 no...
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.