Repair thin pool with read only metadata which needs check first.

Alcoinus

New Member
Mar 8, 2023
1
0
1
Hi guys,

unfortunately my disk has encountered some issues after a power loss. The metadata of data LV is in read only mode and needs checking. First of all, I have moved my VMs and CTs to a temporary second disk. As the metadata is read only, I was not able to remove the old LVs.
However, I have not a found a way to check / repair the metadata. I have tried quite a lot by now, but what I am stuck with is this:

code_language.shell:
root@proxmox:~# lvs -a
  LV              VG    Attr       LSize    Pool  Origin Data%  Meta%  Move Log Cpy%Sync Convert
  data2           data2 twi-aotz-- <228.11g              7.03   0.93
  [data2_tdata]   data2 Twi-ao---- <228.11g
  [data2_tmeta]   data2 ewi-ao----   <2.33g
  [lvol0_pmspare] data2 ewi-------   <2.33g
  vm-100-disk-0   data2 Vwi-aotz--    2.00g data2        48.21
  vm-101-disk-0   data2 Vwi-aotz--    2.00g data2        36.81
  vm-102-disk-0   data2 Vwi-aotz--    8.00g data2        18.86
  vm-103-disk-0   data2 Vwi-aotz--   32.00g data2        20.29
  vm-103-disk-1   data2 Vwi-aotz--    4.00m data2        3.12
  vm-105-disk-0   data2 Vwi-aotz--    2.00g data2        58.84
  vm-106-disk-0   data2 Vwi-aotz--    2.00g data2        44.84
  vm-107-disk-0   data2 Vwi-aotz--    4.00g data2        62.15
  vm-109-disk-0   data2 Vwi-aotz--    4.00g data2        44.13
  data            pve   twi-cotzM-  130.97g              17.95  2.09
  [data_tdata]    pve   Twi-ao----  130.97g
  [data_tmeta]    pve   ewi-ao----   <1.59g
  [lvol1_pmspare] pve   ewi-------   <1.59g
  root            pve   -wi-ao----   65.88g
  swap            pve   -wi-ao----    4.00g
  vm-100-disk-0   pve   Vwi---tz--    2.00g data
  vm-101-disk-0   pve   Vwi---tz--    2.00g data
  vm-103-disk-0   pve   Vwi---tz--    4.00m data
  vm-104-disk-0   pve   Vwi---tz--    8.00g data
  vm-106-disk-0   pve   Vwi---tz--    2.00g data
  vm-107-disk-0   pve   Vwi---tz--    4.00g data

code_language.shell:
root@proxmox:~# lvchange -an -v pve/data
  Deactivating logical volume pve/data.
  Not monitoring pve/data with libdevmapper-event-lvm2thin.so
  Unmonitored LVM-y7No6wXc6efWK3Pu2oomeSQzlY4zhd6cZ0O09cDTynRYTsl1KKIo8TOW13EuZvLW-tpool for events
  Removing pve-data (253:5)
  Removing pve-data-tpool (253:4)
  Executing: /usr/sbin/thin_check -q /dev/mapper/pve-data_tmeta
  Removing pve-data_tdata (253:3)
  Removing pve-data_tmeta (253:2)
root@proxmox:~# lvscan -a
  ACTIVE            '/dev/data2/data2' [<228.11 GiB] inherit
  ACTIVE            '/dev/data2/vm-103-disk-0' [32.00 GiB] inherit
  ACTIVE            '/dev/data2/vm-109-disk-0' [4.00 GiB] inherit
  ACTIVE            '/dev/data2/vm-105-disk-0' [2.00 GiB] inherit
  ACTIVE            '/dev/data2/vm-100-disk-0' [2.00 GiB] inherit
  ACTIVE            '/dev/data2/vm-101-disk-0' [2.00 GiB] inherit
  ACTIVE            '/dev/data2/vm-106-disk-0' [2.00 GiB] inherit
  ACTIVE            '/dev/data2/vm-107-disk-0' [4.00 GiB] inherit
  ACTIVE            '/dev/data2/vm-102-disk-0' [8.00 GiB] inherit
  ACTIVE            '/dev/data2/vm-103-disk-1' [4.00 MiB] inherit
  inactive          '/dev/data2/lvol0_pmspare' [<2.33 GiB] inherit
  ACTIVE            '/dev/data2/data2_tmeta' [<2.33 GiB] inherit
  ACTIVE            '/dev/data2/data2_tdata' [<228.11 GiB] inherit
  ACTIVE            '/dev/pve/swap' [4.00 GiB] inherit
  ACTIVE            '/dev/pve/root' [65.88 GiB] inherit
  ACTIVE            '/dev/pve/data' [130.97 GiB] inherit
  inactive          '/dev/pve/vm-100-disk-0' [2.00 GiB] inherit
  inactive          '/dev/pve/vm-101-disk-0' [2.00 GiB] inherit
  inactive          '/dev/pve/vm-104-disk-0' [8.00 GiB] inherit
  inactive          '/dev/pve/vm-106-disk-0' [2.00 GiB] inherit
  inactive          '/dev/pve/vm-107-disk-0' [4.00 GiB] inherit
  inactive          '/dev/pve/vm-103-disk-0' [4.00 MiB] inherit
  ACTIVE            '/dev/pve/data_tdata' [130.97 GiB] inherit
  ACTIVE            '/dev/pve/data_tmeta' [<1.59 GiB] inherit
  inactive          '/dev/pve/lvol1_pmspare' [<1.59 GiB] inherit

Although I tried to deactivate data, it stays active.
I can neither repair the volume, nor thin_check the metadata.

code_language.shell:
root@proxmox:~# lvconvert --repair pve/data
  Active pools cannot be repaired.  Use lvchange -an first.
root@proxmox:~# thin_check /dev/mapper/pve-data_tmeta
  syscall 'open' failed: Device or resource busy
  Note: you cannot run this tool with these options on live metadata.

Any advice on how to proceed from here?