linux-lvm.redhat.com archive mirror
 help / color / mirror / Atom feed
From: Ming-Hung Tsai <mingnus@gmail.com>
To: LVM general discussion and development <linux-lvm@redhat.com>
Subject: Re: [linux-lvm] LVM Thin - bad checksum in superblock - cannot perform operations on metadata
Date: Thu, 25 Nov 2021 17:15:12 +0800	[thread overview]
Message-ID: <CAAYit8QuXNZ0Gfd++hxm8gGoFDSiyGwoyPQ=tNPdvGzc2Cm3JQ@mail.gmail.com> (raw)
In-Reply-To: <CAA_4Ct05hULieFePu0fAEddODEN52w8MBC4nZ3UvRVBWQv-4kQ@mail.gmail.com>

Hi,

Could you try using thin_repair v0.9.0 please? The metadata could be
repaired if only the superblock was affected.

1. Check the pool configurations (transaction id, chunk size, pool size, etc.)

# lvs -o lv_name,transaction_id,chunk_size,size --units k

Taking the following output as an example, the tid is 13, and there
are 519936 data blocks (33275904/64).
```
  LV           TransId Chunk  LSize
  tp1               13 64.00k 33275904.00k
```

2. Create a blank LV for restoration. Here I use 16192 MB to keep
backward compatibility.

# lvcreate data1 --size 16192m --name tmeta_bak

3. Activate the metadata in read-only mode

# lvchange data1/thin_tmeta -ay -y

4. Repair the metadata, in which the tid, bs, and nr_blocks are values
from the first step.

# thin_repair -i /dev/mapper/data1-thin_meta -o
/dev/mapper/data1-tmeta_bak --transaction-id <tid> --data-block-size
<bs> --nr-data-blocks <nr_blocks>

5. Verify the repaired metadata

# thin_dump /dev/mapper/data1-tmeta_bak --skip-mappings
(10 devices should be listed if thin_repair runs successfully)

6. Swap the pool metadata with the repaired one

# lvchange -an data1/thin_meta
# lvconvert data1/thin --swapmetadata --poolmetadata data1/tmeta_bak

Step 2-6 above could be substituted by a single lvconvert command
below, but I would prefer doing these step-by-step.

# lvconvert --repair data1/thin --config
'global/thin_repair_options=["--transaction_id", "<tid>",
"--data-block-size", "<bs>", "--nr-data-blocks", "<nr_blocks>"]'


Ming-Hung Tsai

On Tue, Nov 23, 2021 at 3:33 PM pavel olenev <pavel.olenev@gmail.com> wrote:
>
> Hello.
> I am looking for advice on how to act in such a situation. Perhaps anyone has gone through something similar?
> We used lvm thin provisioning on one of our arrays. But after raid controller failure we got problem with activation of all thin volumes:
>
> # lvchange -a y data/thin
>   Check of pool data/thin failed (status:1). Manual repair required!
>
> I tried to use lvconvert --repair data/thin, but have this:
>
> # lvconvert --repair data/thin
> truncating metadata device to 4161600 4k blocks
> bad checksum in superblock, wanted 1494954599
>   Repair of thin metadata volume of thin pool data/thin failed (status:1). Manual repair required!

_______________________________________________
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-11-25  9:16 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-22 16:24 [linux-lvm] LVM Thin - bad checksum in superblock - cannot perform operations on metadata pavel olenev
2021-11-25  9:15 ` Ming-Hung Tsai [this message]

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='CAAYit8QuXNZ0Gfd++hxm8gGoFDSiyGwoyPQ=tNPdvGzc2Cm3JQ@mail.gmail.com' \
    --to=mingnus@gmail.com \
    --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).