linux-lvm.redhat.com archive mirror
 help / color / mirror / Atom feed
From: David Teigland <teigland@redhat.com>
To: linux-lvm@harrier.ch, linux-lvm@redhat.com
Subject: Re: [linux-lvm] LVM: Metadata on ... has wrong VG name
Date: Mon, 20 Dec 2021 10:52:41 -0600	[thread overview]
Message-ID: <20211220165241.GA28533@redhat.com> (raw)
In-Reply-To: <39400.121121907140600191@us-mta-191.us.mimecast.lan>

On Sun, Dec 19, 2021 at 07:14:08AM -0500, linux-lvm@harrier.ch wrote:
>   >sudo pvscan
>    Metadata on /dev/sdd2 at 12800 has wrong VG name “fedora32 {
>    id = “gJgZM9-n2Rd-V7us-RWae-cpT6-H84E-g7dAsk”
>    seqno = 9
>    format = “lvm2”
>    status = [“RESIZEABLE”, “READ”, “WRITE”]
>    flag” expected fedora.
>    WARNING: Reading VG fedora on /dev/sdd2 failed.
>    WARNING: PV /dev/sdd2 is marked in use but no VG was found using it.
>    WARNING: PV /dev/sdd2 might need repairing.

It's not clear if there's a problem with the on-disk metadata, or if the
pvscan is confused and mixing info from the duplicated disks.  You don't
want to "fix" metadata if it's just a reporting error, so use filters to
report each device in isolation:

pvs --config 'devices/filter=["a|/dev/sdd2|", "r|.*|"]' /dev/sdd2
pvs --config 'devices/filter=["a|/dev/sda2|", "r|.*|"]' /dev/sda2

If each is disk is displayed correctly without error, then the on-disk
metadata is fine (please create a bz, or send, the output of pvs -vvvvv so
we can fix it.)  To work around it, use the same filter in lvm.conf to
limit lvm access to one disk at a time, and change the vg name, vg uuid,
pv uuid (changing all is probably unnecessary, you just want all three of
those to be unique for each disk.)

If the initial pvs commands with filters still show errors, then there are
on-disk metadata problems.  Set the lvm.conf filter to limit access to the
one disk with errors, then use the pvck command to repair it:

1. list older versions of metadata on the disk.

  # pvck --dump metadata_all /dev/sdx

2. review list, and pick a version you think is before changes, noting
   "metadata at <offset> ..."

3. save that version of metadata to a file using the offset

  # pvck --dump metadata_all --settings metadata_offset=<offset> -f metafile /dev/sdx

4. look at the metadata file created and confirm it's what you want, or
   save other files with other versions to compare them.

5. repair the PV using the file containing the metadata you want

  # pvck --repair -f metafile /dev/sdx

If this worked, then the 'pvs' command should display the disk without
errors.  While this disk remains isolated with the filter, verify the LVs
contain the data you want.  You may want to change the vg name, vg uuid,
pv uuid on this disk while it's isolated to ensure there won't be
duplicated info later.


_______________________________________________
linux-lvm mailing list
linux-lvm@redhat.com
https://listman.redhat.com/mailman/listinfo/linux-lvm
read the LVM HOW-TO at http://tldp.org/HOWTO/LVM-HOWTO/

  reply	other threads:[~2021-12-20 16:54 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-19 12:14 [linux-lvm] LVM: Metadata on ... has wrong VG name linux-lvm
2021-12-20 16:52 ` David Teigland [this message]
2021-12-26  8:23 linux-lvm
2022-01-06 19:23 ` David Teigland

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=20211220165241.GA28533@redhat.com \
    --to=teigland@redhat.com \
    --cc=linux-lvm@harrier.ch \
    --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).