From: Dennis Schridde <devurandom@gmx.net>
To: linux-lvm@redhat.com
Subject: [linux-lvm] cache_check --clear-needs-check-flag does not clear needs_check flag?
Date: Sun, 06 Dec 2020 22:01:37 +0100 [thread overview]
Message-ID: <4384449.LvFx2qVVIh@monk> (raw)
[-- Attachment #1.1: Type: text/plain, Size: 4362 bytes --]
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.
$ sudo cache_check /dev/vg_ernie/lv_cache
examining superblock
examining mapping array
examining hint array
examining discard bitset
$ sudo cache_check --clear-needs-check-flag /dev/vg_ernie/lv_cache
examining superblock
examining mapping array
examining hint array
examining discard bitset
$ sudo lvchange -an vg_ernie/lv_cache
But the problem persists:
$ sudo vgchange -ay
device-mapper: reload ioctl on (253:6) failed: Invalid argument
0 logical volume(s) in volume group "vg_ernie" now active
I tried again in read/write mode, in case that would make a difference /
silently fail:
$ sudo lvchange -ay vg_ernie/lv_cache
Do you want to activate component LV in read-only mode? [y/n]: n
$ sudo cache_check --clear-needs-check-flag /dev/vg_ernie/lv_cache
examining superblock
examining mapping array
examining hint array
examining discard bitset
$ sudo lvchange -an vg_ernie/lv_cache
With the same results:
$ sudo vgchange -ay
device-mapper: reload ioctl on (253:6) failed: Invalid argument
0 logical volume(s) in volume group "vg_ernie" now active
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
Configuration: ./configure --build=x86_64-redhat-linux-gnu --
host=x86_64-redhat-linux-gnu --program-prefix= --disable-dependency-tracking
--prefix=/usr --exec-prefix=/usr --bindir=/usr/bin --sbindir=/usr/sbin --
sysconfdir=/etc --datadir=/usr/share --includedir=/usr/include --libdir=/usr/
lib64 --libexecdir=/usr/libexec --localstatedir=/var --sharedstatedir=/var/lib
--mandir=/usr/share/man --infodir=/usr/share/info --with-default-dm-run-dir=/
run --with-default-run-dir=/run/lvm --with-default-pid-dir=/run --with-
default-locking-dir=/run/lock/lvm --with-usrlibdir=/usr/lib64 --enable-fsadm
--enable-write_install --with-user= --with-group= --with-device-uid=0 --with-
device-gid=6 --with-device-mode=0660 --enable-pkgconfig --enable-cmdlib --
enable-dmeventd --enable-blkid_wiping --with-cluster=internal --enable-
cmirrord --with-udevdir=/usr/lib/udev/rules.d --enable-udev_sync --with-
thin=internal --with-cache=internal --enable-lvmpolld --enable-lvmlockd-dlm --
enable-lvmlockd-dlmcontrol --enable-lvmlockd-sanlock --enable-dbus-service --
enable-notify-dbus --enable-dmfilemapd --with-writecache=internal --with-
vdo=internal --with-vdo-format=/usr/bin/vdoformat --disable-silent-rules
Is it possible that `cache_check --clear-needs-check-flag does not clear
needs_check flag` does not actually clear the needs_check flag in my case?
Any help to get the system back online (without data loss, if possible) is
appreciated!
Best regards,
Dennis
[-- Attachment #1.2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 659 bytes --]
[-- Attachment #2: Type: text/plain, Size: 197 bytes --]
_______________________________________________
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/
next reply other threads:[~2020-12-06 21:07 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-12-06 21:01 Dennis Schridde [this message]
2020-12-08 22:19 ` [linux-lvm] cache_check --clear-needs-check-flag does not clear needs_check flag? Dennis Schridde
2020-12-09 11:05 ` Zdenek Kabelac
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=4384449.LvFx2qVVIh@monk \
--to=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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.