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

前端之家收集整理的这篇文章主要介绍了linux – 如何从LVM2中删除坏磁盘,同时减少其他PV上的数据丢失?前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我有一个带有两个磁盘的LVM2卷.较大的磁盘变得腐败,所以我不能pvmove.
从组中删除它以保存其他磁盘中的大多数数据的最佳方法是什么?
这是我的pvdisplay输出
  1. Couldn't find device with uuid WWeM0m-MLX2-o0da-tf7q-fJJu-eiGl-e7UmM3.
  2. --- Physical volume ---
  3. PV Name unknown device
  4. VG Name media
  5. PV Size 1,82 TiB / not usable 1,05 MiB
  6. Allocatable yes (but full)
  7. PE Size 4,00 MiB
  8. Total PE 476932
  9. Free PE 0
  10. Allocated PE 476932
  11. PV UUID WWeM0m-MLX2-o0da-tf7q-fJJu-eiGl-e7UmM3
  12.  
  13. --- Physical volume ---
  14. PV Name /dev/sdb1
  15. VG Name media
  16. PV Size 931,51 GiB / not usable 3,19 MiB
  17. Allocatable yes (but full)
  18. PE Size 4,00 MiB
  19. Total PE 238466
  20. Free PE 0
  21. Allocated PE 238466
  22. PV UUID oUhOcR-uYjc-rNTv-LNBm-Z9VY-TJJ5-SYezce

所以我想删除未知设备(系统中不存在).
没有新磁盘可以做到这一点吗?文件系统是ext4.

解决方法

  1. # pvdisplay
  2. Couldn't find device with uuid EvbqlT-AUsZ-MfKi-ZSOz-Lh6L-Y3xC-KiLcYx.
  3. --- Physical volume ---
  4. PV Name /dev/sdb1
  5. VG Name vg_srvlinux
  6. PV Size 931.51 GiB / not usable 4.00 MiB
  7. Allocatable yes (but full)
  8. PE Size 4.00 MiB
  9. Total PE 238466
  10. Free PE 0
  11. Allocated PE 238466
  12. PV UUID xhwmxE-27ue-dHYC-xAk8-Xh37-ov3t-frl20d
  13.  
  14. --- Physical volume ---
  15. PV Name unknown device
  16. VG Name vg_srvlinux
  17. PV Size 465.76 GiB / not usable 3.00 MiB
  18. Allocatable yes (but full)
  19. PE Size 4.00 MiB
  20. Total PE 119234
  21. Free PE 0
  22. Allocated PE 119234
  23. PV UUID EvbqlT-AUsZ-MfKi-ZSOz-Lh6L-Y3xC-KiLcYx
  24.  
  25.  
  26.  
  27. # vgreduce --removemissing --force vg_srvlinux
  28.  
  29.  
  30. Couldn't find device with uuid EvbqlT-AUsZ-MfKi-ZSOz-Lh6L-Y3xC-KiLcYx.
  31. Removing partial LV LogVol00.
  32. Logical volume "LogVol00" successfully removed
  33. Wrote out consistent volume group vg_srvlinux
  34.  
  35. # pvdisplay
  36.  
  37. --- Physical volume ---
  38. PV Name /dev/sdb1
  39. VG Name vg_srvlinux
  40. PV Size 931.51 GiB / not usable 4.00 MiB
  41. Allocatable yes
  42. PE Size 4.00 MiB
  43. Total PE 238466
  44. Free PE 238466
  45. Allocated PE 0
  46. PV UUID xhwmxE-27ue-dHYC-xAk8-Xh37-ov3t-frl20d

现在一切正常!

猜你在找的Linux相关文章