From 040ba7a7ca81605f7d430158f16b666671e09e85 Mon Sep 17 00:00:00 2001 From: Christos Longros <98426896+chrislongros@users.noreply.github.com> Date: Tue, 10 Feb 2026 22:19:44 +0100 Subject: [PATCH] libzfs: improve error message for zpool create with ENXIO When zpool create fails because a vdev cannot be opened (ENXIO), the error falls through to zpool_standard_error() which reports the generic 'one or more devices is currently unavailable'. This is misleading when the real cause is a block size mismatch or other device open failure. Add an explicit ENXIO case in zpool_create()'s error handling to provide a more descriptive message. Reviewed-by: Brian Behlendorf Signed-off-by: Christos Longros Closes #18184 Closes #11087 --- lib/libzfs/libzfs_pool.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/libzfs/libzfs_pool.c b/lib/libzfs/libzfs_pool.c index db5cd6dc0..7da5c218d 100644 --- a/lib/libzfs/libzfs_pool.c +++ b/lib/libzfs/libzfs_pool.c @@ -1632,6 +1632,11 @@ zpool_create(libzfs_handle_t *hdl, const char *pool, nvlist_t *nvroot, errbuf)); } + case ENXIO: + zfs_error_aux(hdl, dgettext(TEXT_DOMAIN, + "one or more devices could not be opened")); + return (zfs_error(hdl, EZFS_BADDEV, errbuf)); + default: return (zpool_standard_error(hdl, errno, errbuf)); }