zpool component names - gpt vs. gptid

Arthur Chance freebsd at qeng-ho.org
Wed Nov 5 14:40:58 UTC 2014


On 05/11/2014 11:13, Trond Endrestøl wrote:
> 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"
>

Ah, I wasn't aware of that last part. Thanks.

I seems to me that if the cache isn't usually used and requires special 
loading at boot time, then this problem is going to affect anyone using 
zfs. gptids may be unique, but they're not exactly user friendly.




More information about the freebsd-questions mailing list