Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 28 Dec 2016 09:16:59 -0800
From:      Freddie Cash <fjwcash@gmail.com>
To:        Ben RUBSON <ben.rubson@gmail.com>
Cc:        fs@freebsd.org
Subject:   Re: Force ZFS to always look for devices in a defined location
Message-ID:  <CAOjFWZ4-u5nJZkjNEtDu=bAHh2UmzvAm8am0j0uhyajC8eUCSw@mail.gmail.com>
In-Reply-To: <4E030EC6-39AC-484C-BA53-2C8CA0E79B84@gmail.com>
References:  <4E030EC6-39AC-484C-BA53-2C8CA0E79B84@gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Dec 27, 2016 11:03 PM, "Ben RUBSON" <ben.rubson@gmail.com> 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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAOjFWZ4-u5nJZkjNEtDu=bAHh2UmzvAm8am0j0uhyajC8eUCSw>