Comment 1 for bug 2003654

Revision history for this message
Patrik Lundin (eest) wrote (last edit ):

And some additional information, curtin seems to look up stuff in /dev/disk/by-id/ in its lookup_disk(serial) function: https://github.com/canonical/curtin/blob/b08eecd68cf5f1bccf4255b3d00a77af51c159f7/curtin/block/__init__.py#L921-L924

On a machine where the WWN is duplicate, there will only exists links for one of the disks:
```
$ ls -l /dev/disk/by-id/* | grep 502b2a201d1c1b1a
lrwxrwxrwx 1 root root 9 Jan 20 12:49 /dev/disk/by-id/scsi-3502b2a201d1c1b1a -> ../../sdb
lrwxrwxrwx 1 root root 10 Jan 20 12:49 /dev/disk/by-id/scsi-3502b2a201d1c1b1a-part1 -> ../../sdb1
lrwxrwxrwx 1 root root 10 Jan 20 12:49 /dev/disk/by-id/scsi-3502b2a201d1c1b1a-part2 -> ../../sdb2
lrwxrwxrwx 1 root root 9 Jan 20 12:49 /dev/disk/by-id/wwn-0x502b2a201d1c1b1a -> ../../sdb
lrwxrwxrwx 1 root root 10 Jan 20 12:49 /dev/disk/by-id/wwn-0x502b2a201d1c1b1a-part1 -> ../../sdb1
lrwxrwxrwx 1 root root 10 Jan 20 12:49 /dev/disk/by-id/wwn-0x502b2a201d1c1b1a-part2 -> ../../sdb2
```

So this can not be used to detect the duplication.