Does IDs from `ls -l /dev/disk/by-id` output are unique to a disk? – DELL PERC card

Lucio Queiroz asked:

Does output from ls -l /dev/disk/by-id can be used as a universal disk identifier?

I am currently trying to find a unique identifier that I can use to create a ZFS raidz pool using a unique identifier for each disk.

Potentially I want to use the same identifier to restore the ZFS pool after the system reinstall.

I have these requirements:

  • Disks don’t have partitions yet.
  • Disks can be moved to another machine.
  • Disks can change position slot in the same machine.

I’m currently using:

  • Ubuntu Server 20.04 LTS
  • DELL PowerEdge R710
  • DELL PERC6/i raid card
  • 5 x 500GB DELL disks attached to raid card (sdb-sbf)
  • 1 x 120GB SSD that is not attached to the raid card (sda)

PS. This RAID card doesn’t have pass-through, so each disk is attached as an individual RAID0. Does it change the serial exposed to the OS?

Example output from ls -lah /dev/disk/by-id/

~$ ls -lah /dev/disk/by-id/
total 0
drwxr-xr-x 3 root root 960 Oct 23 06:12 .
drwxr-xr-x 8 root root 160 Oct 18 18:53 ..
lrwxrwxrwx 1 root root   9 Oct 18 18:53 ata-ADATA_SP550_2G2520036769 -> ../../sda
lrwxrwxrwx 1 root root  10 Oct 18 18:54 ata-ADATA_SP550_2G2520036769-part1 -> ../../sda1
lrwxrwxrwx 1 root root  10 Oct 18 18:54 ata-ADATA_SP550_2G2520036769-part2 -> ../../sda2
lrwxrwxrwx 1 root root   9 Oct 18 18:53 scsi-0ATA_ADATA_SP550_2G2520036769 -> ../../sda
lrwxrwxrwx 1 root root  10 Oct 18 18:54 scsi-0ATA_ADATA_SP550_2G2520036769-part1 -> ../../sda1
lrwxrwxrwx 1 root root  10 Oct 18 18:54 scsi-0ATA_ADATA_SP550_2G2520036769-part2 -> ../../sda2
lrwxrwxrwx 1 root root   9 Oct 18 18:53 scsi-1ATA_ADATA_SP550_2G2520036769 -> ../../sda
lrwxrwxrwx 1 root root  10 Oct 18 18:54 scsi-1ATA_ADATA_SP550_2G2520036769-part1 -> ../../sda1
lrwxrwxrwx 1 root root  10 Oct 18 18:54 scsi-1ATA_ADATA_SP550_2G2520036769-part2 -> ../../sda2
lrwxrwxrwx 1 root root   9 Oct 18 18:53 scsi-36a4badb02b6020002666efd071e1c1a0 -> ../../sdb
lrwxrwxrwx 1 root root   9 Oct 18 18:53 scsi-36a4badb02b6020002666effa74599a2b -> ../../sdc
lrwxrwxrwx 1 root root   9 Oct 18 18:53 scsi-36a4badb02b6020002666f01c766dd5f0 -> ../../sdd
lrwxrwxrwx 1 root root   9 Oct 18 18:53 scsi-36a4badb02b6020002666f04478ce7cc5 -> ../../sde
lrwxrwxrwx 1 root root   9 Oct 18 18:53 scsi-36a4badb02b6020002666f0627a912d6b -> ../../sdf
lrwxrwxrwx 1 root root   9 Oct 18 18:53 scsi-SATA_ADATA_SP550_2G2520036769 -> ../../sda
lrwxrwxrwx 1 root root  10 Oct 18 18:54 scsi-SATA_ADATA_SP550_2G2520036769-part1 -> ../../sda1
lrwxrwxrwx 1 root root  10 Oct 18 18:54 scsi-SATA_ADATA_SP550_2G2520036769-part2 -> ../../sda2
drwxr-xr-x 2 root root 340 Oct 18 18:53 scsi-SDELL_PERC_6
lrwxrwxrwx 1 root root   9 Oct 18 18:53 usb-iDRAC_LCDRIVE_20120430-0:0 -> ../../sdg
lrwxrwxrwx 1 root root   9 Oct 18 18:53 usb-iDRAC_Virtual_CD_20120430-0:0 -> ../../sr0
lrwxrwxrwx 1 root root   9 Oct 18 18:53 usb-iDRAC_Virtual_Floppy_20120430-0:1 -> ../../sdh
lrwxrwxrwx 1 root root   9 Oct 18 18:53 wwn-0x6a4badb02b6020002666efd071e1c1a0 -> ../../sdb
lrwxrwxrwx 1 root root   9 Oct 18 18:53 wwn-0x6a4badb02b6020002666effa74599a2b -> ../../sdc
lrwxrwxrwx 1 root root   9 Oct 18 18:53 wwn-0x6a4badb02b6020002666f01c766dd5f0 -> ../../sdd
lrwxrwxrwx 1 root root   9 Oct 18 18:53 wwn-0x6a4badb02b6020002666f04478ce7cc5 -> ../../sde
lrwxrwxrwx 1 root root   9 Oct 18 18:53 wwn-0x6a4badb02b6020002666f0627a912d6b -> ../../sdf

Is /dev/disk/by-id/wwn-0x6a4badb02b6020002666efd071e1c1a0 persistent if system is reinstalled?

Does it point to the disk or to the raid card slot?

My answer:


The World Wide Name is expected to be globally unique, and barring mistakes by a drive manufacturer it should be.

However, in the case of the single-disk RAID0 on your ancient PERC card, which was how people worked around its lack of JBOD support, the WWN refers to the virtual RAID0 disk, not to the physical disk. (And global uniqueness might not be possible, but they will at least be unique on your controller.) This should not cause you a problem in practice, but if it does, then buy a different HBA that supports JBOD.


View the full question and any other answers on Server Fault.

Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.