Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 26 May 2017 08:36:21 -0700
From:      Freddie Cash <fjwcash@gmail.com>
To:        =?UTF-8?Q?=C5=81ukasz_W=C4=85sikowski?= <lukasz@wasikowski.net>
Cc:        =?UTF-8?Q?Karli_Sj=C3=B6berg?= <karli@inparadise.se>,  FreeBSD Filesystems <freebsd-fs@freebsd.org>
Subject:   Re: Problem with zpool remove of log device
Message-ID:  <CAOjFWZ5RmWsA9onzo4PfSnq625soKtbpr80L3Egh7qGaz4UMbw@mail.gmail.com>
In-Reply-To: <c123b065-efea-3147-a145-ae2b53876148@wasikowski.net>
References:  <7fc4a6f3-df1b-47b4-9399-0dd6614ddf94@email.android.com> <c123b065-efea-3147-a145-ae2b53876148@wasikowski.net>

next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, May 26, 2017 at 4:10 AM, =C5=81ukasz W=C4=85sikowski <lukasz@wasiko=
wski.net>
wrote:

> W dniu 2017-05-26 o 12:46, Karli Sj=C3=B6berg pisze:
> >
> >
> > Den 26 maj 2017 12:43 em skrev =C5=81ukasz W=C4=85sikowski <lukasz@wasi=
kowski.net
> >:
> >
> >     W dniu 2017-05-26 o 12:37, Karli Sj=C3=B6berg pisze:
> >
> >     > Den 26 maj 2017 12:30 em skrev =C5=81ukasz W=C4=85sikowski :
> >     >
> >     > W dniu 2017-05-26 o 12:20, Karli Sj=C3=B6berg pisze:
> >     > >
> >     > >
> >     > > Den 26 maj 2017 11:47 fm skrev =C5=81ukasz W=C4=85sikowski :
> >     > >
> >     > > Hi,
> >     > >
> >     > > I cant remove log device from pool - operation ends ok, but log
> >     device
> >     > > is still in the pool (bug?).
> >     > >
> >     > > # uname -a
> >     > > FreeBSD xxx.yyy.com 11.0-STABLE FreeBSD 11.0-STABLE #0 r316543:
> >     > Thu Apr
> >     > > 6 08:22:43 CEST 2017 root@xxx.yyy.com:/usr/obj/usr/src/sys/YYY
> amd64
> >     > >
> >     > > # zpool status tank
> >     > > pool: tank
> >     > > state: ONLINE
> >     > > status: One or more devices are configured to use a non-native
> block
> >     > > size.
> >     > > Expect reduced performance.
> >     > > action: Replace affected devices with devices that support the
> >     > > configured block size, or migrate data to a properly configured
> >     > > pool.
> >     > > scan: scrub repaired 0 in 22h21m with 0 errors on Thu May 25
> >     > > 02:26:36 2017
> >     > > config:
> >     > >
> >     > > NAME STATE READ WRITE CKSUM
> >     > > tank ONLINE 0 0 0
> >     > > mirror-0 ONLINE 0 0 0
> >     > > ada2p3 ONLINE 0 0 0
> >     > > ada3p3 ONLINE 0 0 0
> >     > > logs
> >     > > mirror-1 ONLINE 0 0 0
> >     > > gpt/tankssdzil0 ONLINE 0 0 0 block size:
> >     > > 512B configured, 4096B native
> >     > > gpt/tankssdzil1 ONLINE 0 0 0 block size:
> >     > > 512B configured, 4096B native
> >     > >
> >     > > errors: No known data errors
> >     > >
> >     > > When I try to remove log device operation ends without errors:
> >     > >
> >     > > # zpool remove tank mirror-1; echo $?
> >     > > 0
> >     > >
> >     > >
> >     > > You are missing the actual disk you want to remove from the
> mirror:
> >     > > # zpool remove tank gpt/tankssdzil1
> >     >
> >     > # zpool remove tank gpt/tankssdzil0
> >     > cannot remove gpt/tankssdzil0: operation not supported on this ty=
pe
> >     > of pool
> >     >
> >     >
> >     > Yeah, that's because you're booting off of it right? Boot from CD
> or
> >     > whatev, should work. Or if it was the "bootfs" zpool option, can'=
t
> >     > remember, but it's something along those lines. Really silly, but
> >     anyway...
> >
> >     Yes, it's root-on-zfs. But as I said on other box with similar
> >     configuration it works. Strange.
> >
> >     It's production box so boot from CD is not an easy option. I'll
> check it
> >     during next service window. Thank you for your help.
> >
> >
> > AFAIR you just need to null the bootfs zpool option, remove the log dis=
k
> > and then reset bootfs to what it was before.
>
> No luck.
>
> # zpool get bootfs
> NAME       PROPERTY  VALUE          SOURCE
> tank       bootfs    tank/ROOTFS    local
> tankssd    bootfs    -              default
>
> # zpool set bootfs=3D'' tank
>
> # zpool get bootfs tank
> NAME    PROPERTY  VALUE   SOURCE
> tank    bootfs    -       default
>
> # zpool remove tank mirror-1; echo $?
> 0
>
> # zpool status tank
>   pool: tank
>  state: ONLINE
> status: One or more devices are configured to use a non-native block size=
.
>         Expect reduced performance.
> action: Replace affected devices with devices that support the
>         configured block size, or migrate data to a properly configured
>         pool.
>   scan: scrub repaired 0 in 22h21m with 0 errors on Thu May 25 02:26:36
> 2017
> config:
>
>         NAME                   STATE     READ WRITE CKSUM
>         tank                 ONLINE       0     0     0
>           mirror-0             ONLINE       0     0     0
>             ada2p3             ONLINE       0     0     0
>             ada3p3             ONLINE       0     0     0
>         logs
>           mirror-1             ONLINE       0     0     0
>             gpt/tankssdzil0  ONLINE       0     0     0  block size:
> 512B configured, 4096B native
>             gpt/tankssdzil1  ONLINE       0     0     0  block size:
> 512B configured, 4096B native
>
> errors: No known data errors
>
>
> # zpool remove tank gpt/tankssdzil0; echo $?
> cannot remove gpt/tankssdzil0: operation not supported on this type of po=
ol
> 1
>

=E2=80=8BYou have your log devices in a mirror vdev.  First you need to "br=
eak" the
mirror:

# zpool detach tank =E2=80=8Bgpt/tankssdzil1

That will make the log vdev into a single-disk vdev, and then you can
remove it:

# zpool remove tank =E2=80=8Bgpt/tankssdzil0

After that, you should be able to re-enable the bootfs option and reboot to
make sure everything is still working.

--=20
Freddie Cash
fjwcash@gmail.com



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