Re: LVM cachepool inconsistency after power event

Ming Hung Tsai <[email protected]>
Newsgroups gmane.linux.lvm.general
Message-ID <CALjSBEt0TdOr4jL4JhCKrRCfO+LiT_0tNaQYfQ9mLgQNjhq8Aw@mail.gmail.com>
On Thu, Oct 7, 2021 at 3:57 PM Krzysztof Chojnowski <[email protected]> wrote:
>
> On Tue, Oct 5, 2021 at 6:57 PM Ming Hung Tsai <[email protected]> wrote:
>>
>> On Tue, Oct 5, 2021 at 11:54 PM Zdenek Kabelac <[email protected]> wrote:
>>
>> > lvconvert --repair should be able to handle this case - although likely
>> > without 'smart' placement' of fixed metadata (pvmove needed after metadata fix)
>
> I tried running lvconvert --repair earlier (please see the 1st of my mails) and even trough the operation finished successfully (as in the $? == 0) I couldn't activate the volume afterwards.
>
>>
>> cache_repair might not handle this case perfectly. If possible, you
>> could upload the "original" metadata somewhere for me to take a look,
>> by dd it into a binary file.
>
> Unfortunately I deleted the original metadata volume when I was trying to remove the cached volume.
> So right now, I guess, the question is how do I remove the cached volume, as the repair doesn't seem to be possible.

Hi,

You could simply detach the cache:
sudo lvconvert vg0/tpg1-wdata --splitcache

Or alternatively, reinitialize the cache by swapping the metadata with
a blank one, which bypasses cache_check examination and then steps to
metadata formatting:
sudo lvcreate vg0 --size 40m --name cmeta_bak
sudo lvconvert vg0/wdata_cachepool_cpool --swapmetadata --poolmetadata cmeta_bak

then you should be able to activate the tpg1-wdata.

BTW, could you help provide the reproducing steps? I guess that you
performed a power cut soon after creating the cache. Thanks.


Ming-Hung Tsai

_______________________________________________
linux-lvm mailing list
[email protected]
https://listman.redhat.com/mailman/listinfo/linux-lvm
read the LVM HOW-TO at http://tldp.org/HOWTO/LVM-HOWTO/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.