服务器具有带有几个卷的 Thin LVM:
vm-130-disk-0 - was deleted and need to be restored.
vm-137-disk-0 - was NOT deleted.
尝试恢复在删除之前创建的 /etc/lvm/archive/pve_00336-2034680334.vg:
# vgcfgrestore --force --file /etc/lvm/archive/pve_00336-2034680334.vg pve
# vgimport pve
# lvchange -ay /dev/pve/vm-130-disk-0
Thin pool pve-data-tpool (254:6) transaction_id is 324, while expected 311.
...
# lvs -a
LV VG Attr LSize Pool Origin Data% Meta%
data pve twi---tz-- 1.57t # NOT activated pool data
[data_tdata] pve Twi-a----- 1.57t # OK a=Activated
[data_tmeta] pve ewi-a----- 16.00g # OK a=Activated
root pve -wi-a----- 10.00g # OK a=Activated
vm-130-disk-0 pve Vwi---tz-- 32.00g data # NOT activated deleted volume
vm-137-disk-0 pve Vwi---tz-- 22.00g data # NOT activated non-deleted volume
...
好吧,这里我们失败了,因为 tmeta 和 tpool 之间的事务不匹配。互联网上大多数回答的人都有镜像情况:tpool=312 和 tmeta=324,看起来像 .vg 文件中的 transaction_id 修复对他们有帮助。让我们尝试修复 .vg 文件并激活:
Changed by hands transaction_id from 311 to 324 in /etc/lvm/archive/pve_00336-2034680334.vg ..
# vgcfgrestore --force --file /etc/lvm/archive/pve_00336-2034680334.vg pve
# vgimport pve
# lvchange -ay /dev/pve/vm-130-disk-0
device-mapper: reload ioctl on (254:19) failed: No data available
In debug log appears: pve-vm--130--disk--0: Skipping NODE_DEL [trust_udev]
# lvs -a
LV VG Attr LSize Pool Origin Data% Meta%
data pve twi-aotz-- 1.57t 5.86 0.44 # OK
[data_tdata] pve Twi-a----- 1.57t # OK
[data_tmeta] pve ewi-a----- 16.00g # OK
root pve -wi-a----- 10.00g # OK
vm-130-disk-0 pve Vwi---tz-- 32.00g data # NOT activated deleted volume
vm-137-disk-0 pve Vwi-a-tz-- 22.00g data 67.91 # OK activated non-deleted volume
...
已删除卷的“无可用数据”。伤心。AFAIK tpool 有 transaction_id=324,我需要以某种方式将 tpool 回滚到 312。不知道怎么做。
我可以用什么激活 pve/vm-130-disk-0 ?
# lvm version
LVM version: 2.02.168(2) (2016-11-30)
Library version: 1.02.137 (2016-11-30)
Driver version: 4.35.0
# uname -a
Linux adminslotlogicrestoreasap 4.9.0-11-amd64 #1 SMP Debian 4.9.189-3+deb9u2 (2019-11-11) x86_64 GNU/Linux
谢谢阅读!我将不胜感激任何建议。