Identify ZFS Disks Using /dev/disk/by-id/
    If you're running ZFS on Linux—whether for a homelab NAS, TrueNAS setup, or Proxmox storage—properly identifying your disks is crucial. Using persistent device identifiers like /dev/disk/by-id/ instead of mount points like /dev/sda can save you from disaster when hardware changes or you need to replace a failed drive.
This guide shows you how to match ZFS pool disks to their physical drives using serial numbers.
Why Use /dev/disk/by-id/?
Identifying disks in a ZFS pool based on /dev/disk/by-id/ identifier in Linux/Debian is essential for reliability.
Linux creates unique persistent block device identifiers to access hard drives in multiple ways. /dev/disk/by-id/ is one of them, and it's derived from the disk's serial number. More details on how this identifier is computed.
The problem with /dev/sda, /dev/sdb, etc.:
- These mount points can change after a reboot
 - Adding or removing hardware can shuffle drive letters
 - Makes replacing failed drives confusing
 
Using persistent identifiers prevents these issues and ensures ZFS always knows which physical disk is which.
View Available Disk Identifiers
You can view all existing /dev/disk/by-id/ identifiers using the ls command:
bash
ls -l /dev/disk/by-id/Matching ZFS Pool Disks to Physical Drives
Sometimes you lose track of which device identifier corresponds to which physical hard drive. This is especially problematic when you need to replace a drive in your pool. Here's how to figure it out:
Step 1: Display ZFS Pool Status
Use the zpool status command to see your pool configuration:
bash
zpool status -v tank(Replace tank with your pool name)

This shows you the /dev/disk/by-id/ identifiers ZFS is using for each drive.
Step 2: Display Disk Serial Numbers
Use the lsblk command to list physical disk information including serial numbers:
bash
lsblk -o NAME,SIZE,SERIAL,LABEL,FSTYPEStep 3: Match Them Up
The serial number from lsblk is embedded in the /dev/disk/by-id/ identifier from zpool status.
For example, if zpool status shows:
ata-WDC_WD40EFRX-68N32N0_WD-WCC7K1234567And lsblk shows a drive with serial WD-WCC7K1234567, you know that's the same physical drive.
Conclusion
By matching the serial numbers from lsblk with the identifiers in your ZFS pool, you can confidently identify which physical drive corresponds to each pool member. This is invaluable when:
- Replacing failed drives
 - Upgrading drives in your array
 - Troubleshooting hardware issues
 - Documenting your storage setup
 
Pro tip: Label your physical drives with their serial numbers using a label maker. Future you will thank you!
Running ZFS on Linux? Check out TrueNAS Scale for a polished ZFS experience with a web UI.