LVM 精简池未激活

LVM 精简池未激活

雷雨天气,Ubuntu 16.04 下的服务器尽管有 UPS 也关机了。在服务器上,exchange 文件夹 ( /srv/data) 位于 samba 下。从 LVM/srv/data安装一个精简卷 vg 。/thinpool/data

雷雨过后,卷组 (vg) 和卷 (data) 特别停止激活。我试过了,lvconvert --repair vg /thinpool没有帮助,尝试使用vgcfrestore恢复元数据,效果是一样的。我非常需要数据,没有备份。我打电话给 LVM 大师!

  lvchange -aey vg
  device-mapper: resume ioctl on (252:2) failed: Invalid argument
  Unable to resume vg-thinpool-tpool (252:2)
  device-mapper: resume ioctl on (252:2) failed: Invalid argument
  Unable to resume vg-thinpool-tpool (252:2)

lvs -a
  LV               VG   Attr       LSize   Pool     Origin Data%  Meta%  Move Log Cpy%Sync Convert
  data             vg   Vwi---tz-- 950.00g thinpool                                               
  [lvol0_pmspare]  vg   ewi-------  16.00g                                                        
  thinpool         vg   twi---tz--   1.79t                                                        
  [thinpool_tdata] vg   Twi-a-----   1.79t                                                        
  [thinpool_tmeta] vg   ewi-ao----  16.00g

lvchange -ay -v vg/data
    Using logical volume(s) on command line.
    Activating logical volume "data" exclusively.
    activation/volume_list configuration setting defined: Checking the list to match vg/data
    Loading vg-thinpool_tmeta table (252:0)
    Suppressed vg-thinpool_tmeta (252:0) identical table reload.
    Loading vg-thinpool_tdata table (252:1)
    Suppressed vg-thinpool_tdata (252:1) identical table reload.
    Executing: /usr/sbin/thin_check -q /dev/mapper/vg-thinpool_tmeta
    Creating vg-thinpool-tpool
    Loading vg-thinpool-tpool table (252:3)
    Resuming vg-thinpool-tpool (252:3)
  device-mapper: resume ioctl on (252:3) failed: Недопустимый аргумент
  Unable to resume vg-thinpool-tpool (252:3)
    Removing vg-thinpool-tpool (252:3)

lvconvert --repair vg/thinpool -v
    activation/volume_list configuration setting defined: Checking the list to match vg/lvol1_pmspare
    Creating vg-lvol1_pmspare
    Loading vg-lvol1_pmspare table (252:2)
    Resuming vg-lvol1_pmspare (252:2)
    activation/volume_list configuration setting defined: Checking the list to match vg/thinpool_tmeta
    Executing: /usr/sbin/thin_repair  -i /dev/mapper/vg-thinpool_tmeta -o /dev/mapper/vg-lvol1_pmspare
truncating metadata device to 4161600 4k blocks
    Piping: /usr/sbin/thin_dump /dev/mapper/vg-lvol1_pmspare
  Transaction id 6466 from pool "vg/thinpool" does not match repaired transaction id 6468 from /dev/mapper/vg-lvol1_pmspare.
    Removing vg-thinpool_tmeta (252:0)
    Removing vg-lvol1_pmspare (252:2)
    Preparing pool metadata spare volume for Volume group vg.
    Archiving volume group "vg" metadata (seqno 13499).
    Creating logical volume lvol2
    Creating volume group backup "/etc/lvm/backup/vg" (seqno 13500).
    Activating logical volume "lvol2" locally.
    activation/volume_list configuration setting defined: Checking the list to match vg/lvol2
    Creating vg-lvol2
    Loading vg-lvol2 table (252:0)
    Resuming vg-lvol2 (252:0)
    Initializing 4,00 KiB of logical volume "vg/lvol2" with value 0.
    Temporary logical volume "lvol2" created.
    Removing vg-lvol2 (252:0)
    Renaming lvol2 as pool metadata spare volume lvol2_pmspare.
  WARNING: If everything works, remove "vg/thinpool_meta0".
  WARNING: Use pvmove command to move "vg/thinpool_tmeta" on the best fitting PV.

答案1

解决此问题的方法是逃避池元数据(仅在可能的情况下:VG 中有可用空间,并且元数据可以容纳),例如:

thin_dump /dev/mapper/vg02-pool0_tmeta > lvm_meta_dum
lvcreate -n pool0meta2 -L 12G vg02
thin_restore -i lvm_meta_dump -o /dev/mapper/vg02-pool0meta2
lvconvert --thinpool vg02/pool0 --poolmetadata vg02/pool0meta2

看:修复元尺寸

相关内容