From: "Alexander 'Leo' Bergolth" <leo@strike.wu.ac.at>
To: linux-lvm@redhat.com
Subject: [linux-lvm] unable to recover from degraded raid1 with thin pool (was: activation mode=degraded doesn't work with thin pool)
Date: Thu, 19 Oct 2017 13:45:51 +0200 [thread overview]
Message-ID: <378f8596-dfae-2557-a53f-b614940bba22@strike.wu.ac.at> (raw)
In-Reply-To: <59E60975.2000001@strike.wu.ac.at>
On 10/17/2017 03:45 PM, Alexander 'Leo' Bergolth wrote:
> I just tested lv activation with a degraded raid1 thin pool.
> Unfortunately it looks like activation mode=degraded only works for
> plain raid1 lvs. If you add a thin pool, lvm won't activate it in
> degraded mode. (Unless you specify --activationmode partial, which is
> IMHO rather dangerous.)
Unfortunately I cannot even replace a faulty PV if a thin pool is present.
lvm thinks that the thin pool is a partial (not just degraded) LV, so
removing the missing PV would also remove the thin pool! (see below)
Is there any way to work around this problem?
Cheers,
--leo
P.S.: I filed a bugreport for this:
https://bugzilla.redhat.com/show_bug.cgi?id=1504044
-------------------- 8< --------------------
# pvcreate /dev/vdb
Physical volume "/dev/vdb" successfully created.
# pvcreate /dev/vdc
Physical volume "/dev/vdc" successfully created.
# vgcreate vg_test /dev/vdb /dev/vdc
Volume group "vg_test" successfully created
# lvcreate --type raid1 -m 1 -n thinmeta -L100m vg_test /dev/vdb /dev/vdc
Logical volume "thinmeta" created.
# lvcreate --type raid1 -m 1 -n Thin -L2g vg_test /dev/vdb /dev/vdc
Logical volume "Thin" created.
# lvconvert -y --type thin-pool --poolmetadata vg_test/thinmeta vg_test/Thin
Thin pool volume with chunk size 64.00 KiB can address@most 15.81
TiB of data.
WARNING: Converting logical volume vg_test/Thin and vg_test/thinmeta
to thin pool's data and metadata volumes with metadata wiping.
THIS WILL DESTROY CONTENT OF LOGICAL VOLUME (filesystem etc.)
Converted vg_test/Thin_tdata to thin pool.
# vgchange -a n vg_test
0 logical volume(s) in volume group "vg_test" now active
### add global_filter = [ "r|^/dev/vdc$|" ] to lvm.conf
# systemctl restart lvm2-lvmetad.service
# pvscan --cache
# pvs
WARNING: Device for PV na0HS1-ZcQt-bnt0-tFfB-Zl20-irIg-FffGxH not
found or rejected by a filter.
PV VG Fmt Attr PSize PFree
/dev/vda2 vg_sys lvm2 a-- <12.00g <2.00g
/dev/vdb vg_test lvm2 a-- <12.00g 9.79g
[unknown] vg_test lvm2 a-m <12.00g 9.89g
# vgchange -a y vg_test
WARNING: Device for PV na0HS1-ZcQt-bnt0-tFfB-Zl20-irIg-FffGxH not
found or rejected by a filter.
Refusing activation of partial LV vg_test/Thin. Use '--activationmode
partial' to override.
0 logical volume(s) in volume group "vg_test" now active
# vgchange -a y --activationmode=partial vg_test
PARTIAL MODE. Incomplete logical volumes will be processed.
WARNING: Device for PV na0HS1-ZcQt-bnt0-tFfB-Zl20-irIg-FffGxH not
found or rejected by a filter.
1 logical volume(s) in volume group "vg_test" now active
### removing the missing PV would also remove my thin pool!
# vgreduce --removemissing vg_test
WARNING: Device for PV na0HS1-ZcQt-bnt0-tFfB-Zl20-irIg-FffGxH not
found or rejected by a filter.
WARNING: Partial LV Thin needs to be repaired or removed.
WARNING: Partial LV Thin_tmeta needs to be repaired or removed.
WARNING: Partial LV Thin_tdata needs to be repaired or removed.
WARNING: Partial LV Thin_tmeta_rimage_1 needs to be repaired or removed.
WARNING: Partial LV Thin_tmeta_rmeta_1 needs to be repaired or removed.
WARNING: Partial LV Thin_tdata_rimage_1 needs to be repaired or removed.
WARNING: Partial LV Thin_tdata_rmeta_1 needs to be repaired or removed.
There are still partial LVs in VG vg_test.
To remove them unconditionally use: vgreduce --removemissing --force.
WARNING: Proceeding to remove empty missing PVs.
-------------------- 8< --------------------
>
> Is this the intended behavior?
>
> -------------------- 8< --------------------
> # lvcreate --type raid1 -m 1 -n thinmeta -L100m vg1 /dev/sda2 /dev/sdb2
> Logical volume "thinmeta" created.
> # lvcreate --type raid1 -m 1 -n Thin -L2g vg1 /dev/sda2 /dev/sdb2
> Logical volume "Thin" created.
> # lvconvert -y --type thin-pool --poolmetadata vg1/thinmeta vg1/Thin
> Thin pool volume with chunk size 64.00 KiB can address at most 15.81 TiB of data.
> WARNING: Converting logical volume vg1/Thin and vg1/thinmeta to thin pool's data and metadata volumes with metadata wiping.
> THIS WILL DESTROY CONTENT OF LOGICAL VOLUME (filesystem etc.)
> Converted vg1/Thin_tdata to thin pool.
>
> # vgchange -a n vg1
> 0 logical volume(s) in volume group "vg1" now active
>
> ### filter one leg of the raid: global_filter = [ "r|^/dev/sdb2|" ]
> # systemctl restart lvm2-lvmetad.service
> # pvscan --cache
>
> # vgchange -a y
> WARNING: Device for PV WzDZS1-Hj9B-RZCa-uhOc-pY9L-1rLN-GB5Zs1 not found or rejected by a filter.
> Refusing activation of partial LV vg1/Thin. Use '--activationmode partial' to override.
> 0 logical volume(s) in volume group "vg1" now active
> -------------------- 8< --------------------
>
> (--activationmode partial works)
>
> I am using lvm2-2.02.171-8.el7.x86_64.
>
> Cheers,
> --leo
>
--
e-mail ::: Leo.Bergolth (at) wu.ac.at
fax ::: +43-1-31336-906050
location ::: IT-Services | Vienna University of Economics | Austria
next prev parent reply other threads:[~2017-10-19 11:45 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-17 13:45 [linux-lvm] activation mode=degraded doesn't work with thin pool Alexander 'Leo' Bergolth
2017-10-19 11:45 ` Alexander 'Leo' Bergolth [this message]
2017-10-20 21:06 ` [linux-lvm] unable to recover from degraded raid1 with thin pool (was: activation mode=degraded doesn't work with thin pool) Gionatan Danti
2017-10-23 13:26 ` [linux-lvm] unable to recover from degraded raid1 with thin pool Alexander 'Leo' Bergolth
2017-10-27 10:13 ` Alexander 'Leo' Bergolth
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=378f8596-dfae-2557-a53f-b614940bba22@strike.wu.ac.at \
--to=leo@strike.wu.ac.at \
--cc=linux-lvm@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).