linux-lvm.redhat.com archive mirror
 help / color / mirror / Atom feed
From: Zdenek Kabelac <zkabelac@redhat.com>
To: LVM general discussion and development <linux-lvm@redhat.com>,
	Dennis Schridde <devurandom@gmx.net>
Subject: Re: [linux-lvm] cache_check --clear-needs-check-flag does not clear needs_check flag?
Date: Wed, 9 Dec 2020 12:05:13 +0100	[thread overview]
Message-ID: <a2927a4a-006e-6b5b-3597-d7b592e21ec7@redhat.com> (raw)
In-Reply-To: <4384449.LvFx2qVVIh@monk>

Dne 06. 12. 20 v 22:01 Dennis Schridde napsal(a):
> Hello!
> 
> A cached logical volume of mine cannot be activated anymore:
> 
> $ sudo vgchange -ay
>     device-mapper: reload ioctl on   (253:6) failed: Invalid argument
>     0 logical volume(s) in volume group "vg_ernie" now active
> 
> 
> dmesg logs:
> 
> device-mapper: cache: 253:6: unable to switch cache to write mode until
> repaired.
> device-mapper: cache: 253:6: switching cache to read-only mode
> device-mapper: table: 253:6: cache: Unable to get write access to metadata,
> please check/repair metadata.
> device-mapper: ioctl: error adding target to table
> 
> 
> The code in question seems to be: https://github.com/torvalds/linux/blob/v5.8/
> drivers/md/dm-cache-target.c#L957-L964
> 
> 
> Hence I set out to check the cache and, if it is clean, clear the needs_check
> flag:
> 
> $ sudo lvchange -ay vg_ernie/lv_cache
> Do you want to activate component LV in read-only mode? [y/n]: y
>     Allowing activation of component LV.

As said - by component activation you will get 'read-only' volume
thus you cannot do 'in-place' changes this way.


> 
> A bit puzzling is that the status of the needs_check flag appears to be
> "unknown":
> 
> $ sudo lvs -a -o +lv_check_needed
>     LV                        VG          Attr          LSize    Pool
> Origin                  Data%   Meta%   Move Log Cpy%Sync Convert CheckNeeded
>     [lv_cache]            vg_ernie CRi-a-C--- 232.88g
> unknown
>     lv_system             vg_ernie Cwi---C---   <1.82t [lv_cache]
> [lv_system_corig]
> unknown
>     [lv_system_corig] vg_ernie owi---C---   <1.82t
> unknown
> 
> 
> The live system I am running these commands from is a Fedora 33:
> 
> $ uname -a
> Linux localhost-live 5.8.15-301.fc33.x86_64 #1 SMP Thu Oct 15 16:58:06 UTC
> 2020 x86_64 x86_64 x86_64 GNU/Linux
> 
> $ sudo lvm version
>     LVM version:       2.03.10(2) (2020-08-09)
>     Library version: 1.02.173 (2020-08-09)
>     Driver version:   4.42.0

It seems you are using  'cvol' instead of 'cpool' solution which has been 
evolving and you will need a newer lvm2 version.

If you want to using caching with the version of lvm2 you have - you will
need to use cpools  (which are a bit faster anyway).

Regards

Zdenek

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


  parent reply	other threads:[~2020-12-09 11:06 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-06 21:01 [linux-lvm] cache_check --clear-needs-check-flag does not clear needs_check flag? Dennis Schridde
2020-12-08 22:19 ` Dennis Schridde
2020-12-09 11:05 ` Zdenek Kabelac [this message]
2020-12-09 19:06   ` Dennis Schridde
2020-12-09 19:30     ` David Teigland
2020-12-09 19:57       ` Dennis Schridde
2020-12-09 20:45         ` David Teigland
2020-12-09 23:52           ` David Teigland
2020-12-09 20:15       ` Dennis Schridde

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=a2927a4a-006e-6b5b-3597-d7b592e21ec7@redhat.com \
    --to=zkabelac@redhat.com \
    --cc=devurandom@gmx.net \
    --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).