5.4. 从​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​中​​​​​​​删​​​​​​​除​​​​​​​磁​​​​​​​盘​​​​​​​

本​​​​​​​示​​​​​​​例​​​​​​​告​​​​​​​诉​​​​​​​您​​​​​​​如​​​​​​​何​​​​​​​从​​​​​​​现​​​​​​​有​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​中​​​​​​​删​​​​​​​除​​​​​​​磁​​​​​​​盘​​​​​​​,您​​​​​​​可​​​​​​​以​​​​​​​替​​​​​​​换​​​​​​​磁​​​​​​​盘​​​​​​​,也​​​​​​​可​​​​​​​以​​​​​​​用​​​​​​​这​​​​​​​个​​​​​​​磁​​​​​​​盘​​​​​​​作​​​​​​​为​​​​​​​不​​​​​​​同​​​​​​​卷​​​​​​​的​​​​​​​一​​​​​​​部​​​​​​​分​​​​​​​。​​​​​​​要​​​​​​​删​​​​​​​除​​​​​​​磁​​​​​​​盘​​​​​​​,您​​​​​​​必​​​​​​​须​​​​​​​首​​​​​​​先​​​​​​​将​​​​​​​ LVM 物​​​​​​​理​​​​​​​卷​​​​​​​中​​​​​​​的​​​​​​​扩​​​​​​​展​​​​​​​移​​​​​​​动​​​​​​​到​​​​​​​不​​​​​​​同​​​​​​​的​​​​​​​磁​​​​​​​盘​​​​​​​或​​​​​​​者​​​​​​​一​​​​​​​组​​​​​​​磁​​​​​​​盘​​​​​​​中​​​​​​​。​​​​​​​

5.4.1. 将​​​​​​​扩​​​​​​​展​​​​​​​移​​​​​​​动​​​​​​​到​​​​​​​现​​​​​​​有​​​​​​​物​​​​​​​理​​​​​​​卷​​​​​​​中​​​​​​​

在​​​​​​​本​​​​​​​示​​​​​​​例​​​​​​​中​​​​​​​,逻​​​​​​​辑​​​​​​​卷​​​​​​​是​​​​​​​在​​​​​​​卷​​​​​​​组​​​​​​​ myvg 中​​​​​​​的​​​​​​​四​​​​​​​个​​​​​​​物​​​​​​​理​​​​​​​卷​​​​​​​中​​​​​​​进​​​​​​​行​​​​​​​分​​​​​​​配​​​​​​​的​​​​​​​。​​​​​​​
[root@tng3-1]# pvs -o+pv_used
  PV         VG   Fmt  Attr PSize  PFree  Used
  /dev/sda1  myvg lvm2 a-   17.15G 12.15G  5.00G
  /dev/sdb1  myvg lvm2 a-   17.15G 12.15G  5.00G
  /dev/sdc1  myvg lvm2 a-   17.15G 12.15G  5.00G
  /dev/sdd1  myvg lvm2 a-   17.15G  2.15G 15.00G
我​​​​​​​们​​​​​​​想​​​​​​​要​​​​​​​移​​​​​​​动​​​​​​​ /dev/sdb1 的​​​​​​​扩​​​​​​​展​​​​​​​,以​​​​​​​便​​​​​​​可​​​​​​​以​​​​​​​将​​​​​​​其​​​​​​​从​​​​​​​卷​​​​​​​组​​​​​​​中​​​​​​​删​​​​​​​除​​​​​​​。​​​​​​​
如​​​​​​​果​​​​​​​在​​​​​​​卷​​​​​​​组​​​​​​​的​​​​​​​其​​​​​​​它​​​​​​​物​​​​​​​理​​​​​​​卷​​​​​​​中​​​​​​​没​​​​​​​有​​​​​​​足​​​​​​​够​​​​​​​的​​​​​​​剩​​​​​​​余​​​​​​​扩​​​​​​​展​​​​​​​,您​​​​​​​可​​​​​​​以​​​​​​​在​​​​​​​您​​​​​​​想​​​​​​​要​​​​​​​删​​​​​​​除​​​​​​​的​​​​​​​设​​​​​​​备​​​​​​​中​​​​​​​执​​​​​​​行​​​​​​​不​​​​​​​带​​​​​​​选​​​​​​​项​​​​​​​的​​​​​​​ pvmove 命​​​​​​​令​​​​​​​,那​​​​​​​么​​​​​​​扩​​​​​​​展​​​​​​​就​​​​​​​会​​​​​​​被​​​​​​​分​​​​​​​配​​​​​​​到​​​​​​​其​​​​​​​它​​​​​​​设​​​​​​​备​​​​​​​中​​​​​​​。​​​​​​​
[root@tng3-1 ~]# pvmove /dev/sdb1
  /dev/sdb1: Moved: 2.0%
 ...
  /dev/sdb1: Moved: 79.2%
 ...
  /dev/sdb1: Moved: 100.0%
完​​​​​​​成​​​​​​​ pvmove 命​​​​​​​令​​​​​​​后​​​​​​​,扩​​​​​​​展​​​​​​​的​​​​​​​分​​​​​​​配​​​​​​​如​​​​​​​下​​​​​​​:
[root@tng3-1]# pvs -o+pv_used
  PV         VG   Fmt  Attr PSize  PFree  Used
  /dev/sda1  myvg lvm2 a-   17.15G  7.15G 10.00G
  /dev/sdb1  myvg lvm2 a-   17.15G 17.15G     0
  /dev/sdc1  myvg lvm2 a-   17.15G 12.15G  5.00G
  /dev/sdd1  myvg lvm2 a-   17.15G  2.15G 15.00G
使​​​​​​​用​​​​​​​ vgreduce 命​​​​​​​令​​​​​​​从​​​​​​​卷​​​​​​​组​​​​​​​中​​​​​​​删​​​​​​​除​​​​​​​物​​​​​​​理​​​​​​​卷​​​​​​​ /dev/sdb1。​​​​​​​
[root@tng3-1 ~]# vgreduce myvg /dev/sdb1
  Removed "/dev/sdb1" from volume group "myvg"
[root@tng3-1 ~]# pvs
  PV         VG   Fmt  Attr PSize  PFree
  /dev/sda1  myvg lvm2 a-   17.15G  7.15G
  /dev/sdb1       lvm2 --   17.15G 17.15G
  /dev/sdc1  myvg lvm2 a-   17.15G 12.15G
  /dev/sdd1  myvg lvm2 a-   17.15G  2.15G
现​​​​​​​在​​​​​​​可​​​​​​​以​​​​​​​物​​​​​​​理​​​​​​​删​​​​​​​除​​​​​​​这​​​​​​​个​​​​​​​磁​​​​​​​盘​​​​​​​或​​​​​​​者​​​​​​​将​​​​​​​其​​​​​​​分​​​​​​​配​​​​​​​给​​​​​​​其​​​​​​​它​​​​​​​用​​​​​​​户​​​​​​​。​​​​​​​