Scot Hetzel wrote:> On 11/26/09, Arnaud Houdelette <arnaud.houdelette@tzim.net> wrote:
>
>> Scot Hetzel wrote:
>>
>>
>>> On 11/26/09, Arnaud Houdelette <arnaud.houdelette@tzim.net>
wrote:
>>>
>>>
>>>
>>>> I just upgraded from 7.2 to 8.0.
>>>> Under 7.2 the pool was like :
>>>> NAME STATE READ WRITE CKSUM
>>>> tank ONLINE 0 0 0
>>>> raidz1 ONLINE 0 0 0
>>>> ad6p1 ONLINE 0 0 0
>>>> ad10p1 ONLINE 0 0 0
>>>> ad8p1 ONLINE 0 0 0
>>>> ad4p1 ONLINE 0 0 0
>>>>
>>>> I'd like to use gpt labels or gptids reimporting the pool.
>>>> # ls /dev/gpt
>>>> disk1 disk2 disk3 disk4
>>>> # ls /dev/gptid
>>>> 0902db4e-d462-11de-96bd-001d923bc7a0
>>>> 9fb111f8-d426-11de-99bc-001d923bc7a0
>>>> 1be29091-d9dc-11de-9f4a-001d923bc7a0
>>>> ffb4e96a-d497-11de-96bd-001d923bc7a0
>>>>
>>>> I did # zpool import -d /dev/gpt tank
>>>> and I got
>>>> tank ONLINE
>>>> raidz1 ONLINE
>>>> ada1p1 ONLINE
>>>> ada3p1 ONLINE
>>>> ada2p1 ONLINE
>>>> gpt/disk4 ONLINE
>>>>
>>>> Now, how to force zpool import to only use gpt labels (or
uuids) ? Or
>>>>
>> at
>>
>>>> least get back to coherent situation ( zpool export tank /
zpool import
>>>> gives the same now. and zpool import -d /dev, as zpool import
-d
>>>>
>> /dev/gptid
>>
>>>> gives nothing ) ?
>>>>
>>>>
>>>>
>>>>
>>> Use 'zpool replace' to change the zfs pool to use the gpt
names:
>>>
>>> zpool replace tank ada1p1 gpt/disk1
>>> zpool replace tank ada2p1 gpt/disk2
>>> zpool replace tank ada3p1 gpt/disk3
>>>
>>> NOTE: make sure you use the correct gpt names for each partition,
as
>>> the above assumes that ada1p1 is labeled as disk1.
>>>
>>> Scot
>>>
>>>
>>>
>> Mmmh, zpool replace will resilver the drive, won't it ?
>>
>
> Yes, it will resilver the drive, but it shouldn't take as long as it
> will recognize that it is the same drive. Just wait for the resilver
> process to finish before changing the next drive.
>
>
>> Moreover, I can't use replace as when adaXp1 is used, the
corresponding
>> /dev/gpt entry disapears. Unless you mean that I can use replace
before
>> import ?
>>
>>
>
> There was a discussion about this back in July:
>
> http://lists.freebsd.org/pipermail/freebsd-current/2009-July/009440.html
>
> In that discussion, they had used glabel to label each drive, and then
> use zpool replace on the active pool to change it to use the label.
>
> Just make sure that you use the gpt name that you assigned to ada1p1,
> when replacing it.
>
> Scot
>
That does not work or there's something I'm doing wrong.
# uname -a
FreeBSD carenath.tzim.net 8.0-RELEASE FreeBSD 8.0-RELEASE #26: Wed Nov
25 23:43:22 CET 2009
tzim@carenath.tzim.net:/usr/obj/usr/src/sys/CARENATH amd64
As I said, the label is not present in /dev/gpt while used with adaXp1 (
here ada1p1 has label HD753LJ-1) :
# ls /dev/gpt
HD753LJ-4 zfs-boot
# zpool replace tank ada1p1 gpt/HD753LJ-1
cannot open 'gpt/HD753LJ-1': no such GEOM provider
If I offline the drive first, I get another error :
# zpool offline tank ada1p1
# zpool replace tank ada1p1 gpt/HD753LJ-1
invalid vdev specification
use '-f' to override the following errors:
/dev/gpt/HD753LJ-1 is part of active pool 'tank'
# zpool replace -f tank ada1p1 gpt/HD753LJ-1
invalid vdev specification
the following errors must be manually repaired:
/dev/gpt/HD753LJ-1 is part of active pool 'tank'
I know there is the solution of cleaning the disk and resilvering, but
if I could avoid this ?
Arnaud