扩展虚拟机VM的磁盘空间(LVM)

xiaoxiao2021-02-28  22

[root@localhost ~]# pvdisplay

  Couldn't find device with uuid KkvdjR-tzB5-lNCn-lOvv-CZBm-OazH-J6Wsfn.

  --- Physical volume ---

  PV Name               /dev/sda2

  VG Name               VolGroup

  PV Size               49.51 GiB / not usable 3.00 MiB

  Allocatable           yes (but full)

  PE Size               4.00 MiB

  Total PE              12674

  Free PE               0

  Allocated PE          12674

  PV UUID               RagRBO-ezkf-MKQl-NewK-02it-mHNS-ILAw8c

   

  --- Physical volume ---

  PV Name               unknown device

  VG Name               VolGroup

  PV Size               200.00 GiB / not usable 4.00 MiB

  Allocatable           yes

  PE Size               4.00 MiB

  Total PE              51199

  Free PE               51199

  Allocated PE          0

  PV UUID               KkvdjR-tzB5-lNCn-lOvv-CZBm-OazH-J6Wsfn

   

  --- Physical volume ---

  PV Name               /dev/sdb5

  VG Name               VolGroup

  PV Size               200.00 GiB / not usable 1.31 MiB

  Allocatable           yes

  PE Size               4.00 MiB

  Total PE              51199

  Free PE               51199

  Allocated PE          0

  PV UUID               Jhdkxc-6Asc-r3rR-ctyk-qrHD-A90W-FXXxGw

[root@localhost ~]# vgdisplay

  Couldn't find device with uuid KkvdjR-tzB5-lNCn-lOvv-CZBm-OazH-J6Wsfn.

  --- Volume group ---

  VG Name               VolGroup

  System ID             

  Format                lvm2

  Metadata Areas        2

  Metadata Sequence No  5

  VG Access             read/write

  VG Status             resizable

  MAX LV                0

  Cur LV                2

  Open LV               2

  Max PV                0

  Cur PV                3

  Act PV                2

  VG Size               449.50 GiB

  PE Size               4.00 MiB

  Total PE              115072

  Alloc PE / Size       12674 / 49.51 GiB

  Free  PE / Size       102398 / 399.99 GiB

  VG UUID               D4EAjJ-vslQ-s5Rk-pfDb-CoQ0-Z6SO-svSS6z

执行 vgreduce --removemissing VolGroup即可修复 PV Name =unknown device

[root@localhost ~]# vgreduce --removemissing VolGroup

  Couldn't find device with uuid KkvdjR-tzB5-lNCn-lOvv-CZBm-OazH-J6Wsfn.

  Wrote out consistent volume group VolGroup

[root@localhost ~]# pvdisplay

  --- Physical volume ---

  PV Name               /dev/sda2

  VG Name               VolGroup

  PV Size               49.51 GiB / not usable 3.00 MiB

  Allocatable           yes (but full)

  PE Size               4.00 MiB

  Total PE              12674

  Free PE               0

  Allocated PE          12674

  PV UUID               RagRBO-ezkf-MKQl-NewK-02it-mHNS-ILAw8c

   

  --- Physical volume ---

  PV Name               /dev/sdb5

  VG Name               VolGroup

  PV Size               200.00 GiB / not usable 1.31 MiB

  Allocatable           yes

  PE Size               4.00 MiB

  Total PE              51199

  Free PE               51199

  Allocated PE          0

  PV UUID               Jhdkxc-6Asc-r3rR-ctyk-qrHD-A90W-FXXxGw

   

[root@localhost ~]# vgdisplay

  --- Volume group ---

  VG Name               VolGroup

  System ID             

  Format                lvm2

  Metadata Areas        2

  Metadata Sequence No  6

  VG Access             read/write

  VG Status             resizable

  MAX LV                0

  Cur LV                2

  Open LV               2

  Max PV                0

  Cur PV                2

  Act PV                2

  VG Size               249.50 GiB

  PE Size               4.00 MiB

  Total PE              63873

  Alloc PE / Size       12674 / 49.51 GiB

  Free  PE / Size       51199 / 200.00 GiB

  VG UUID               D4EAjJ-vslQ-s5Rk-pfDb-CoQ0-Z6SO-svSS6z

[root@localhost ~]# lvextend -L 240G /dev/VolGroup/lv_root

  Extending logical volume lv_root to 240.00 GiB

  Logical volume lv_root successfully resized

[root@localhost ~]# resize2fs -p /dev/VolGroup/lv_root

resize2fs 1.41.12 (17-May-2010)

Filesystem at /dev/VolGroup/lv_root is mounted on /; on-line resizing required

old desc_blocks = 3, new_desc_blocks = 15

Performing an on-line resize of /dev/VolGroup/lv_root to 62914560 (4k) blocks.

The filesystem on /dev/VolGroup/lv_root is now 62914560 blocks long.

[root@localhost ~]# vgdisplay

  --- Volume group ---

  VG Name               VolGroup

  System ID             

  Format                lvm2

  Metadata Areas        2

  Metadata Sequence No  7

  VG Access             read/write

  VG Status             resizable

  MAX LV                0

  Cur LV                2

  Open LV               2

  Max PV                0

  Cur PV                2

  Act PV                2

  VG Size               249.50 GiB

  PE Size               4.00 MiB

  Total PE              63873

  Alloc PE / Size       62432 / 243.88 GiB

  Free  PE / Size       1441 / 5.63 GiB

  VG UUID               D4EAjJ-vslQ-s5Rk-pfDb-CoQ0-Z6SO-svSS6z

转载请注明原文地址: https://www.6miu.com/read-2150239.html

最新回复(0)