From owner-freebsd-fs@freebsd.org Wed Dec 28 17:17:01 2016 Return-Path: Delivered-To: freebsd-fs@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0F533C9489E for ; Wed, 28 Dec 2016 17:17:01 +0000 (UTC) (envelope-from fjwcash@gmail.com) Received: from mailman.ysv.freebsd.org (unknown [127.0.1.3]) by mx1.freebsd.org (Postfix) with ESMTP id E2A4A1012 for ; Wed, 28 Dec 2016 17:17:00 +0000 (UTC) (envelope-from fjwcash@gmail.com) Received: by mailman.ysv.freebsd.org (Postfix) id E1FF2C9489D; Wed, 28 Dec 2016 17:17:00 +0000 (UTC) Delivered-To: fs@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E19F8C9489C for ; Wed, 28 Dec 2016 17:17:00 +0000 (UTC) (envelope-from fjwcash@gmail.com) Received: from mail-qk0-x230.google.com (mail-qk0-x230.google.com [IPv6:2607:f8b0:400d:c09::230]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9DCB01011 for ; Wed, 28 Dec 2016 17:17:00 +0000 (UTC) (envelope-from fjwcash@gmail.com) Received: by mail-qk0-x230.google.com with SMTP id t184so251071092qkd.0 for ; Wed, 28 Dec 2016 09:17:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=uQGTQgqumHi1Iwddjs7TYn/WT080ABu8mUQbp7mm7+8=; b=UwbQzSxKHrIwX/0Q3hVNoXUd47ZA0MJE+Ho4WLw0Ps8KYz2y62PrxFVkFE8e+UmDx8 J5IjjVCwlTPnjDhHsKCi4mob5K6oOPd8xBIDqmbHw3me9HyS97IXI+7hl+yekuWuEa2g 086cylEL1wcDgOJe6UiJZkIEKhOUrSa7FUbRfJ7IM3HXg5A97KS6f2azf4desE5fg6YH VBoMYl2b5sJvFssKUq74uLSaKXJJdXqbxzySc1sbiIX2pyxqWUOJgGxcSBVy1k9XVNpm p7GMr5SgUVsK/0yWO7rfxCjTapolP85emfADR9+xy1X6cbcnmppA+8YymrnFXYLFUwL9 S30g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=uQGTQgqumHi1Iwddjs7TYn/WT080ABu8mUQbp7mm7+8=; b=prHZQdpesI4sOw/nYxYZx8hWFSnh8p/JlBtWpZaarxCkcwXJw+5gdNxuY1WnNS/RIT iDAA8NsUSgKopn77740TxTsubKqbjIKEo9/LJqkj9NOlD+Onjn/ROHuwMdhGidyd/E1L 5HXFuwFzDy2r6KymuAGRWDUWwbcJJpuFtZbRnmKEnlOjMlxUGbQYUO+U1eMC83o+sxx0 vlEbcuXcooeoFNeJOTL4SvswnE1bS7WpI2OyVnhgbWtfXqVfppYwoZ5ckFboCoPzzBeg y8CYA19VUYDyckSBURqW13+c6s2Q/5eA8Je0l/dw1etVIL+8hSujsBUiQ3OdbowRYOVK wNHw== X-Gm-Message-State: AIkVDXJ/V/oE0orkH6atJsdIWpygAFmFl4Itei7dsQx9NPJpDsKiaceAqIUgvSIA8ZYI2faN9m0D9GfxiGBaOA== X-Received: by 10.55.151.199 with SMTP id z190mr39555516qkd.166.1482945419846; Wed, 28 Dec 2016 09:16:59 -0800 (PST) MIME-Version: 1.0 Received: by 10.12.165.161 with HTTP; Wed, 28 Dec 2016 09:16:59 -0800 (PST) Received: by 10.12.165.161 with HTTP; Wed, 28 Dec 2016 09:16:59 -0800 (PST) In-Reply-To: <4E030EC6-39AC-484C-BA53-2C8CA0E79B84@gmail.com> References: <4E030EC6-39AC-484C-BA53-2C8CA0E79B84@gmail.com> From: Freddie Cash Date: Wed, 28 Dec 2016 09:16:59 -0800 Message-ID: Subject: Re: Force ZFS to always look for devices in a defined location To: Ben RUBSON Cc: fs@freebsd.org Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Dec 2016 17:17:01 -0000 On Dec 27, 2016 11:03 PM, "Ben RUBSON" wrote: Hello, My zpools are made of devices from /dev/label. Example : NAME STATE READ WRITE CKSUM my-zpool ONLINE 0 0 0 mirror-0 ONLINE 0 0 0 label/slotone ONLINE 0 0 0 label/slottwo ONLINE 0 0 0 (...) For some reasons, it may happen that access to some devices fails and devices (quickly) toggle between ONLINE and UNAVAIL/REMOVED state. Then, sometimes, ZFS re-use the device using the /dev/da path, instead of waiting for the /dev/label path to be rediscovered by the system. It then leads to something like this, with is not nice, and not really correct (as last sector of /dev/da contains the label) : NAME STATE READ WRITE CKSUM my-zpool ONLINE 0 0 0 mirror-0 ONLINE 0 0 0 label/slotone ONLINE 0 0 0 da14 ONLINE 0 0 0 (...) My question is then, how to force ZFS to look for devices in a defined location ? (/dev/label/ in this example) I tried to offline / online impacted devices (da*), but it does not work, they do not come back with their /dev/label path. Zpool export / import works, but of course this is something we would like to avoid. Many thanks ! Ben Export the pool. Then use -d to import it using the labels: zpool import -d /dev/label my-zpool That will search the label directory for pool devices and use that path into the GEOM layer. And it will remember it for future imports. Aft least until things get confused again in the future. :) Cheers, Freddie