zpool component names - gpt vs. gptid

Trond Endrestøl Trond.Endrestol at fagskolen.gjovik.no
Wed Nov 5 11:13:58 UTC 2014


On Wed, 5 Nov 2014 10:48-0000, Arthur Chance wrote:

> On 05/11/2014 09:27, Trond Endrestøl wrote:
> > On Wed, 5 Nov 2014 09:06-0000, Arthur Chance wrote:
> > 
> > > These days I use GPT labelled partitions (/dev/gpt/<label>) exclusively
> > > when
> > > creating zfs pools. However, on my latest box, where I have two pools each
> > > with a single component, "zpool status" lists the components as
> > > gptid/<uuid>
> > > rather than gpt/<label>
> > > 
> > > Is there any way to persuade zfs/zpool to use the GPT label devices rather
> > > than the gptid devices? Failing that, how do you map gptid's back to the
> > > underlying disk partitions? It's obvious in this case, but I'm building a
> > > new
> > > file server with eight identical disks in a raidz2 set up and am worried
> > > how
> > > I'll identify which disk has problems in the future.
> > 
> > Look at: zpool import -d /dev/gpt some-zpool
> > 
> 
> I tried that before (after exporting the zpool of course) and it failed.
> Looking a bit harder, the /dev/gpt device had ceased to exist because the
> corresponding /dev/gptid device was active. Retasting the disk brought the gpt
> dive back, and importing with -d worked for one zpool. However, the other has
> root on it and I'd have to do it from a live memory stick.
> 
> However, none of this explains why zpool was using the gptid disks - I'd
> created the pools using gpt labelled disks and that got lost over some reboot,
> and I'd like to stop that happening again. The problem is that I don't know
> why it happened. I recently started using boot environments in order to switch
> from 10.1-RC3 to -RC4, but I'm not sure if that's connected - /boot and the
> zfs cache are within the b.e. and should have been copied over.

Hmm, I don't believe the cache file is used much these days, unless 
you:

1. Re-import all your zpools from a live memory stick:

zpool import -d /dev/gpt -o cachefile=/tmp/zpool.cache zpool1
zpool import -d /dev/gpt -o cachefile=/tmp/zpool.cache zpool2

2. Copy /tmp/zpool.cache to your b.e.'s /boot/zfs/zpool.cache while 
still running from the live memory stick.

3. Enable the kernel to consult /boot/zfs/zpool.cache by having these 
three lines in /boot/loader.conf:

zpool_cache_load="YES"
zpool_cache_type="/boot/zfs/zpool.cache"
zpool_cache_name="/boot/zfs/zpool.cache"

-- 
+-------------------------------+------------------------------------+
| Vennlig hilsen,               | Best regards,                      |
| Trond Endrestøl,              | Trond Endrestøl,                   |
| IT-ansvarlig,                 | System administrator,              |
| Fagskolen Innlandet,          | Gjøvik Technical College, Norway,  |
| tlf. mob.   952 62 567,       | Cellular...: +47 952 62 567,       |
| sentralbord 61 14 54 00.      | Switchboard: +47 61 14 54 00.      |
+-------------------------------+------------------------------------+


More information about the freebsd-questions mailing list