ZFS/By-ID = wwn??

mugsy27

New Member
May 11, 2021
2
0
1
Hey all... did a search for this but didn't see anything, so sorry if this is already posted. I originally (being a newb to zfs) created my vdev by using /dev/sdc /dev/sdd, etc (yea i know...real bad move!)...and it eventually bit me in the ass. After many reboots I was able to get my home server to align the drives correctly and my pool came back.

In order to fix this I did a zpool export <pool> and then ran zpool import -d /dev/disk/by-id <pool>

This seems to have kinda worked, but rather then grab the disk-id, it seems to have grabbed the wwn. If i do a ls -la /dev/disk/by-id | grep sdd i get the following.


Code:

scsi-35000c50065b811cb -> ../../sdd
scsi-35000c50065b811cb-part1 -> ../../sdd1
scsi-35000c50065b811cb-part9 -> ../../sdd9
scsi-SATA_ST1000NM0033-9ZM_Z1W16VXC -> ../../sdd
scsi-SATA_ST1000NM0033-9ZM_Z1W16VXC-part1 -> ../../sdd1
scsi-SATA_ST1000NM0033-9ZM_Z1W16VXC-part9 -> ../../sdd9
wwn-0x5000c50065b811cb -> ../../sdd
wwn-0x5000c50065b811cb-part1 -> ../../sdd1
wwn-0x5000c50065b811cb-part9 -> ../../sdd9

So I have 2 questions: 1> which of these is the actual disk id? If I were to destroy my pool and recreate it, which one do I use? 2> Is it good / acceptable practice to leave these as wwn. I read on another forum that I can do a rm -rf wwn* from /dev/disk/by-id and then re-export and import and it will grab the correct id...is this accurate and safe?

Thanks in advance for any assistance!
 

andrewbedia

Active Member
Jan 11, 2013
673
209
43
I work with ZFS day in and day out for my day job and use it at home personally.

think of wwn like a mac address (it basically is the equivalent in storage land). I've never seen issues using wwn. I would leave it as is. You can create a pool however you want and then re-import it using a different search path as you've found using -d, e.g. /dev/disk/by-id, /dev/disk/by-path, etc. A lot of drives even have the WWN on the sticker so you can identify a dead drive that way too.

I find WWN more reliable because some manufacturers don't code serial numbers properly (e.g. those white labeled Seagate Exos X16 drives) and wwns are still unique and fully serviceable. If the friendly identifiers (e.g. scsi-SATA_ST1000NM0033-9ZM_Z1W16VXC -> ../../sdd) end up having a duplicate, only one will show up and you can run into some issues there.
 
  • Like
Reactions: dswartz and Lix

pricklypunter

Well-Known Member
Nov 10, 2015
1,657
485
83
Canada
It's fine to use wwn. All that really matters is that each disk has a unique id, so that no matter what order they are found in, they can be cobbled back together again to form the array :)