If I understand you correctly, there might be a fundamental misunderstanding:
The entire structure below
/dev/disk/by-*
consists of only
symlinks to physical devices, which are dynamically generated by udev based on hardware data (i.e. mostly for convencience). For any
sgdisk -R
command (to clone partition tables to another device), while of course you can use any
by-id
device path, sgdisk will "just" follow the symlink to the actual device and use that. Because of the changes on the
target device, udev will then also generate symlinks for that. So what you are seeing in
/dev/disk/by-*
is merely the
result but not the
cause.
This is entirely intentional for NVMe devices, and cannot be called a duplicate: It is merely an additional symlink to the exact same device/partition under an
alternative name. The reason is NVMe's concept of namespaces where "1" is the default-existing namespace, i.e. udev creates symlinks for both the default (=unnamed) and for the explicit "1" namespace. If your device would have multiple namespaces configured, you would see additional symlinks with "(disk id)_2" etc. You can check these with "nvme list" and other sub-commands of the nvme-cli package.
If you clone the partition table of one disk to another, the generated partition symlinks for the target will depend on that device's namespace(s) because namespaces and partitions are different concepts (but in your case both devices seem to have only the default "1" namespace which is perfectly fine).
So what you are seeing is simply not a problem.
Regards