linux – 如何从LVM2中删除坏磁盘,同时减少其他PV上的数据丢失?

前端之家收集整理的这篇文章主要介绍了linux – 如何从LVM2中删除坏磁盘,同时减少其他PV上的数据丢失?前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我有一个带有两个磁盘的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

现在一切正常!

原文链接:https://www.f2er.com/linux/402506.html

猜你在找的Linux相关文章