From d4aae2a05475ed7a9b39bd0c6b4fe99085a1cbd5 Mon Sep 17 00:00:00 2001 From: Brian Behlendorf Date: Thu, 26 Jun 2014 16:36:13 -0700 Subject: [PATCH] Improve differing sector size error When adding or replacing a vdev with a different sector size the error message should be more useful. In addition to describing the problem provide a hint that the '-o ashift' option can be used to override the optimal default value. Since using a non-optimal value may incur a significant performance penalty we should issue this error. But there a numerous reasons why a administrator may wish to do this anyway. Signed-off-by: Niklas Edmundsson Signed-off-by: Brian Behlendorf Closes #2421 --- lib/libzfs/libzfs_pool.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/libzfs/libzfs_pool.c b/lib/libzfs/libzfs_pool.c index b1ddd983d..9d0366711 100644 --- a/lib/libzfs/libzfs_pool.c +++ b/lib/libzfs/libzfs_pool.c @@ -2753,10 +2753,11 @@ zpool_vdev_attach(zpool_handle_t *zhp, case EDOM: /* - * The new device has a different alignment requirement. + * The new device has a different optimal sector size. */ zfs_error_aux(hdl, dgettext(TEXT_DOMAIN, - "devices have different sector alignment")); + "new device has a different optimal sector size; use the " + "option '-o ashift=N' to override the optimal size")); (void) zfs_error(hdl, EZFS_BADDEV, msg); break;