[server] 다른 PV에서 데이터 손실을 줄이면서 LVM2에서 불량 디스크를 제거하는 방법은 무엇입니까?

두 개의 디스크가있는 LVM2 볼륨이 있습니다. 더 큰 디스크가 손상되었으므로 pvmove를 사용할 수 없습니다. 다른 디스크에서 가장 많은 데이터를 저장하기 위해 그룹에서 제거하는 가장 좋은 방법은 무엇입니까? 내 pvdisplay 출력은 다음과 같습니다.

Couldn't find device with uuid WWeM0m-MLX2-o0da-tf7q-fJJu-eiGl-e7UmM3.
  --- Physical volume ---
  PV Name               unknown device
  VG Name               media
  PV Size               1,82 TiB / not usable 1,05 MiB
  Allocatable           yes (but full)
  PE Size               4,00 MiB
  Total PE              476932
  Free PE               0
  Allocated PE          476932
  PV UUID               WWeM0m-MLX2-o0da-tf7q-fJJu-eiGl-e7UmM3

  --- Physical volume ---
  PV Name               /dev/sdb1
  VG Name               media
  PV Size               931,51 GiB / not usable 3,19 MiB
  Allocatable           yes (but full)
  PE Size               4,00 MiB
  Total PE              238466
  Free PE               0
  Allocated PE          238466
  PV UUID               oUhOcR-uYjc-rNTv-LNBm-Z9VY-TJJ5-SYezce

그래서 알 수없는 장치 (시스템에없는)를 제거하고 싶습니다. 새 디스크없이이 작업을 수행 할 수 있습니까? 파일 시스템은 ext4입니다.



답변

# pvdisplay
Couldn't find device with uuid EvbqlT-AUsZ-MfKi-ZSOz-Lh6L-Y3xC-KiLcYx.
  --- Physical volume ---
  PV Name               /dev/sdb1
  VG Name               vg_srvlinux
  PV Size               931.51 GiB / not usable 4.00 MiB
  Allocatable           yes (but full)
  PE Size               4.00 MiB
  Total PE              238466
  Free PE               0
  Allocated PE          238466
  PV UUID               xhwmxE-27ue-dHYC-xAk8-Xh37-ov3t-frl20d

  --- Physical volume ---
  PV Name               unknown device
  VG Name               vg_srvlinux
  PV Size               465.76 GiB / not usable 3.00 MiB
  Allocatable           yes (but full)
  PE Size               4.00 MiB
  Total PE              119234
  Free PE               0
  Allocated PE          119234
  PV UUID               EvbqlT-AUsZ-MfKi-ZSOz-Lh6L-Y3xC-KiLcYx



# vgreduce --removemissing --force vg_srvlinux


  Couldn't find device with uuid EvbqlT-AUsZ-MfKi-ZSOz-Lh6L-Y3xC-KiLcYx.
  Removing partial LV LogVol00.
  Logical volume "LogVol00" successfully removed
  Wrote out consistent volume group vg_srvlinux

# pvdisplay

 --- Physical volume ---
  PV Name               /dev/sdb1
  VG Name               vg_srvlinux
  PV Size               931.51 GiB / not usable 4.00 MiB
  Allocatable           yes
  PE Size               4.00 MiB
  Total PE              238466
  Free PE               238466
  Allocated PE          0
  PV UUID               xhwmxE-27ue-dHYC-xAk8-Xh37-ov3t-frl20d

이제는 모두 잘 작동합니다!


답변

로부터 vgreduce매뉴얼 페이지

   --removemissing
          Removes all missing physical volumes from the volume group, if there are no  logical  volumes
          allocated  on  those.  This resumes normal operation of the volume group (new logical volumes
          may again be created, changed and so on).

          If this is not possible (there are logical volumes referencing the missing physical  volumes)
          and  you  cannot or do not want to remove them manually, you can run this option with --force
          to have vgreduce remove any partial LVs.

          Any logical volumes and dependent snapshots that were partly on the missing disks get removed
          completely. This includes those parts that lie on disks that are still present.

          If  your  logical  volumes  spanned several disks including the ones that are lost, you might
          want to try to salvage data first by  activating  your  logical  volumes  with  --partial  as
          described in lvm (8).


답변