VDEV_ID(8)

πŸ“¦
version 2.4.4 Β· 4 versions
, in alpine 3.22, alpine 3.23, alpine 3.24, debian trixie, nixos 26.05, nixpkgs unstable, ubuntu questing, ubuntu resolute, ubuntu stonking

✨ VDEV_ID β€” the vdev_id girlies' guide ✨

okay bestie, so this is vdev_id from section 8 of the System Manager's Manual, and it is genuinely one of the most underrated little helpers in the whole ZFS ecosystem. she generates user-friendly names for JBOD disks πŸ’– and honestly? iconic behaviour.


🌸 NAME 🌸

vdev_id β€” generate user-friendly names for JBOD disks 🫢


πŸŽ€ SYNOPSIS πŸŽ€

vdev_id -d dev -c config_file -g sas_direct|sas_switch|scsi -m -p
        phys_per_port

πŸ’… DESCRIPTION πŸ’…

so vdev_id is a udev helper, which is a fancy way of saying she runs behind the scenes and does the tedious work so you don't have to. she parses vdev_id.conf(5) to map a physical path in a storage topology to a channel name. then that channel name gets combined with a disk enclosure slot number to create an alias that reflects where the drive physically lives. lowkey this is the most helpful thing ever when you're trying to do tasks like replacing failed drives 😭 because instead of staring at /dev/sdq and going "which one is that" you get a name that literally tells you where the drive is. main character energy fr fr.

slot numbers can also be remapped, in case the default numbering is giving absolutely nothing and you need it to be different. the drive aliases get created as symbolic links in /dev/disk/by-vdev. yes bestie, that directory is your new best friend. πŸ¦‹

the topologies supported right now are sas_direct, sas_switch, and scsi. there's also a multipath mode where dm-mpath devices are handled by examining the first running component disk as reported by the driver. when you're in multipath mode, the config file should contain a channel definition with the same name for each path to a given enclosure β€” no cap, that part is important.

vdev_id also supports creating aliases based on existing udev links in the /dev hierarchy, using the alias configuration file keyword. go check vdev_id.conf(5) for the deets. πŸ“


✨ OPTIONS ✨

here's the whole menu, bestie, every single one, no skips πŸ’€

  • -d device β€” the device node you want to classify, like /dev/sda.
  • -c config_file β€” the path to an alternate configuration file. the default is /etc/zfs/vdev_id.conf.
  • -g sas_direct|sas_switch|scsi β€” tells her which physical topology you're working with, which governs how physical paths get mapped to channels:
    • sas_direct and scsi β€” channels are uniquely identified by a PCI slot and HBA port number.
    • sas_switch β€” channels are uniquely identified by a SAS switch port number.
  • -m β€” only handle dm-multipath devices. if you pass this, she examines the first running component disk of a dm-multipath device, as provided by the driver, to figure out the physical path.
  • -p phys_per_port β€” the number of PHY devices associated with a SAS HBA port or a SAS switch port. vdev_id internally uses this value to determine which HBA or switch port a device is connected to. the default is 4.
  • -h β€” print a usage summary. (your little "help me" button, bestie πŸ™ˆ)

πŸ‘‘ SEE ALSO πŸ‘‘


ngl bestie, if you're ever lost in a sea of /dev/sd* names, this is the page to come back to. she ate. πŸ’…

okay bye ily, this was OpenZFS's VDEV_ID(8) from May 26, 2021 β€” source and version: OpenZFS 🌈 mwah, go name some disks πŸŽ€