ZFS should still check paths for devices that have no devid
Many block devices have a unique
devid that identifies the particular physical media; e.g., a specific hard disk, or a specific logical volume. Unfortunately not every block device is required to provide one but ZFS assumes in some places that one will be available.
Of particular note is
zpool_vdev_name(), used in
zpool status to get the short
/dev name of a disk vdev; e.g.,
/dev/dsk/c0t0d0 would be printed as
c0t0d0. In addition to rendering the short name, this function is responsible for confirming that the
/dev path is still correct. The path may have changed for devices (e.g., SATA disks) which have a
/dev path based on their physical attachment point rather than the media identity. The
zpool_vdev_name() function uses the devid value to determine an appropriate
/dev path, and if it has changed it notifies the kernel that the ZFS pool configuration needs to be updated as well.
If the vdev does not have a devid then we do not update the
/dev path at all, potentially leaving an incorrect value. This prevents processes that use the
/dev path (e.g.,
installboot) from correctly interacting with the devices in the pool, and will almost certainly confuse the operator.
If a device does not have a devid, we should fall back to determining a valid
/dev path for the physical path (i.e., the
/devices path). If a vdev does not have a physical path either, we'll continue to do nothing for now.
Updated by Joshua M. Clulow about 4 years ago
I've run the ZFS test suite on OmniOS before and after this change. Though there are still a few failures, they seem consistent before and after, and mostly a result of a few presumably flakey tests.
In addition, I've used this a bunch as part of testing my work in progress for #7119. I've been able to take an installed OmniOS image made in VirtualBox on my desktop and write it to disks in several totally different systems, both physical and virtual. The new boot-time scan (in the #7119 code) correctly find the new
/devices path and then a subsequent
zpool status will update the
/dev path in on systems that both do, and do not, have a devid for the disks.
In addition I booted the RTI bits on a system where there was no change in any rpool path and that works too.
Updated by Electric Monk about 4 years ago
- Status changed from New to Closed
- % Done changed from 0 to 100
commit 727feae5cc0661f4ec44e87b934863693bedf87d Author: Joshua M. Clulow <firstname.lastname@example.org> Date: 2019-08-28T23:57:58.000Z 10622 ZFS should still check paths for devices that have no devid Reviewed by: Toomas Soome <email@example.com> Reviewed by: Gordon Ross <firstname.lastname@example.org> Reviewed by: Andy Fiddaman <email@example.com> Reviewed by: Jerry Jelinek <firstname.lastname@example.org> Approved by: Dan McDonald <email@example.com>