web-dev-qa-db-fra.com

LVM thin pool n'est pas activé

Il y avait un orage, le serveur sous Ubuntu 16.04 éteint malgré UPS. Sur le serveur, le dossier d'échange (/srv/data) est sous samba. Le /srv/data monte un volume mince vg /thinpool/data à partir de LVM.

Après un orage, le groupe de volumes (vg) et le volume (données) en particulier ont cessé d'être activés. J'ai essayé lvconvert --repair vg /thinpool n'a pas aidé, essayé d'utiliser vgcfrestore pour restaurer la méta, l'effet est le même. J'ai beaucoup besoin des données, il n'y a pas de sauvegardes. J'appelle le gourou 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
Anton Sobolev

La solution de contournement consiste à éviter les méta de pool (uniquement lorsque cela est possible: vous avez de l’espace libre dans VG et lorsque la méta convient), par exemple:

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

Voir: Taille méta fixe .

0
Anton Sobolev