Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 19 Nov 2014 09:01:50 -0700
From:      Alan Somers <asomers@freebsd.org>
To:        "Patrick M. Hausen" <hausen@punkt.de>
Cc:        "freebsd-stable@freebsd.org List" <freebsd-stable@freebsd.org>
Subject:   Re: 10.1 geom "diskid"
Message-ID:  <CAOtMX2iB9HoPrCLVyMtZtUBYKpdAoupJ8a0sY=whr4mAqAJFsg@mail.gmail.com>
In-Reply-To: <FE4F6E61-C332-40A4-A913-281505819FA7@punkt.de>
References:  <FE4F6E61-C332-40A4-A913-281505819FA7@punkt.de>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, Nov 19, 2014 at 8:40 AM, Patrick M. Hausen <hausen@punkt.de> wrote:
> Hi, all,
>
> next question, sorry. I just created a fresh 10.1 installation
> with ZFS. With the last reboot after adding dedicated SSD
> based l2arc and zil, the underlying devices are referred to
> by "diskid" instead of the GPT labels I have first been using:
>
>         NAME                                STATE     READ WRITE CKSUM
>         zroot                               ONLINE       0     0     0
>           mirror-0                          ONLINE       0     0     0
>             gpt/disk0                       ONLINE       0     0     0
>             gpt/disk1                       ONLINE       0     0     0
>         logs
>           diskid/DISK-BTTV334403R7200GGNp2  ONLINE       0     0     0
>         cache
>           diskid/DISK-BTTV334403R7200GGNp1  ONLINE       0     0     0
>
> I can live with that, but I do not understand why the ada2 device
> changed from gpt/* to diskid/* while the others did not?
>
> /dev/gpt entries are not even present for ada2, neither are ada2p?
>
> At least the system could try to be consistent ;-)

When ZFS imports a pool, it tries to open each vdev by name.  If it
can't find the vdev's name, or if that devname now refers to some
other provider, then ZFS searches through every geom provider to find
the ones with the right label.  Sometimes it finds /dev/da* first,
sometimes it finds /dev/gpt/* first, and sometimes it finds
/dev/diskid/* first.  That's why it seems inconsistent.

If you want to force some consistency, you can set these tunables in
/boot/loader.conf.local.  That way ZFS will only be able to use the
/dev/da* and /dev/ada* devnames.
kern.geom.label.disk_ident.enable=0
kern.geom.label.gptid.enable=0

Or, if you specify the /dev/diskid/* or /dev/gpt/* devnames in the
zpool create command, then those devnames should get written to the
label, and ZFS will always use them when it imports a pool.  At least,
I think that it will.  I haven't tested it myself.

-Alan



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