Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Bug#1057679: lvm2: LVM cache gets marked completely dirty on every boot when used for filesystem root

54 views
Skip to first unread message

progserega

unread,
Dec 6, 2023, 9:50:04 PM12/6/23
to
Package: lvm2
Version: 2.03.16-2
Severity: normal

Dear Maintainer,

*** Reporter, please consider answering these questions, where appropriate ***

* I create logical volume 'root_deb' on hdd and its writeback cache on ssd (nvme). And also I create logical volume 'home' and its cache on nvme.
* All works. But after reboot PC - I get big value CacheDirtyBlocks for root_deb logical volume. After some tome (~30 minutes) cache synced - and it work again propertly. But next reboot - get big dirty value for root_deb again. For 'home' no such bug. Only for root logical volume.
* I think that dirty value after reboot do not big (~12 Gb) - as in my situation.

LVM configuration:
lvs -v
LV VG #Seg Attr LSize Maj Min KMaj KMin Pool Origin Data% Meta% Move Cpy%Sync Log Convert LV UUID LProfile
media vg_media 4 -wi-ao---- <1,36t -1 -1 253 0 IOK4Zv-sm7h-Rcsx-QAXp-ZChT-dw50-Sketa1
boot vg_root 1 -wi-ao---- 200,00m -1 -1 253 12 b0tdbO-f12D-TSHc-Szda-YQKJ-iudc-Z0h2cc
home vg_root 1 Cwi-aoC--- 300,00g -1 -1 253 4 [home_cache_data_cpool] [home_corig] 5,88 0,24 0,07 D9NZx2-yX2M-KvBJ-1q0e-RP7J-cTyS-1ZOBns
root20 vg_root 1 -wi-ao---- 60,00g -1 -1 253 7 YUkX03-ZVEe-Lplv-mU4a-uqlx-2a0E-naaQKv
root_deb vg_root 1 Cwi-aoC--- 60,00g -1 -1 253 11 [root_cache_data_cpool] [root_deb_corig] 30,72 1,13 0,00 KZ1UYo-h9le-haHu-rgPR-6IEQ-jS9O-1bbAbq
swap vg_root 1 -wi-ao---- 4,00g -1 -1 253 5 MnyACP-ZRRX-LVMv-8kwX-Ff20-Kmrb-s1XIpo
swap2 vg_root 1 -wi-ao---- 10,00g -1 -1 253 6

-- System Information:
Debian Release: 12.2
APT prefers stable-updates
APT policy: (500, 'stable-updates'), (500, 'stable-security'), (500, 'stable')
Architecture: amd64 (x86_64)

Kernel: Linux 6.1.0-13-amd64 (SMP w/28 CPU threads; PREEMPT)
Locale: LANG=ru_RU.UTF-8, LC_CTYPE=ru_RU.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages lvm2 depends on:
ii dmeventd 2:1.02.185-2
ii dmsetup 2:1.02.185-2
ii libaio1 0.3.113-4
ii libblkid1 2.38.1-5+b1
ii libc6 2.36-9+deb12u3
ii libdevmapper-event1.02.1 2:1.02.185-2
ii libedit2 3.1-20221030-2
ii libselinux1 3.4-1+b6
ii libsystemd0 252.17-1~deb12u1
ii libudev1 252.17-1~deb12u1
ii sysvinit-utils [lsb-base] 3.06-4

Versions of packages lvm2 recommends:
ii thin-provisioning-tools 0.9.0-2

lvm2 suggests no packages.

-- no debconf information

Installed:
ii lvm2 2.03.16-2 amd64 Linux Logical Volume Manager
ii thin-provisioning-tools 0.9.0-2 amd64 Tools for handling thinly provisione

progserega

unread,
Dec 7, 2023, 5:30:04 AM12/7/23
to

Change policy cache from writeback to writethrough - not change situation. After reboot - again 100% dirty cache and big I/O.

signature.asc

Bastian Blank

unread,
Dec 7, 2023, 1:10:05 PM12/7/23
to
On Thu, Dec 07, 2023 at 12:30:20PM +1000, progserega wrote:
> * I create logical volume 'root_deb' on hdd and its writeback cache on ssd (nvme). And also I create logical volume 'home' and its cache on nvme.
> * All works. But after reboot PC - I get big value CacheDirtyBlocks for root_deb logical volume. After some tome (~30 minutes) cache synced - and it work again propertly. But next reboot - get big dirty value for root_deb again. For 'home' no such bug. Only for root logical volume.
> * I think that dirty value after reboot do not big (~12 Gb) - as in my situation.

I assume this happens because the blockdevice is not cleanly unmounted
during shutdown. Please test "dracut" as initramfs generator. This
should support a shutdown mode that does not have that problem.

Bastian

--
No one wants war.
-- Kirk, "Errand of Mercy", stardate 3201.7

progserega

unread,
Dec 25, 2023, 8:10:05 AM12/25/23
to

Thank you very match, Bastian Blank!

Dracut help fix this issue: 0. add cache to root logical volume.

  1. I install dracut (it remove initramfs-tools)
  2. add modules lvm and mdadm to dracut
  3. update all initrd-images by dracut
  4. add GRUB_CMDLINE_LINUX="rd.md=1 rd.md.conf=1 rd.auto=1" to /etc/default/grub (becouse system not boot after switch to dracut in my case) for init mdadm by initramfs at boot.
  5. dpgk-reconfigure grub-pc
  6. reboot twice
  7. after all reboot - dirty cache for root lv was normal.

dracut + some tuning = fix dirty cache "bug" on root.

But I think this problem was not in lvmcache, but in initramfs-tools, which not correct unmount root? So lvmcache simply show this problem... And without lvmcache but with initramfs-tools - at any reboot root was not correctly unmount?

--

0 new messages