LVM扩容/卷删除

[root@localhost Desktop]# vgdisplay
  --- Volume group ---
  VG Name               vg1
  System ID            
  Format                lvm2
  Metadata Areas        3
  Metadata Sequence No  3
  VG Access             read/write
  VG Status             resizable
  MAX LV                0
  Cur LV                1
  Open LV               1
  Max PV                0
  Cur PV                3
  Act PV                3
  VG Size               0.40 GiB
  PE Size               4.00 MiB
  Total PE              614
  Alloc PE / Size       50 / 200.00 MiB
  Free  PE / Size       564 / 2.20 GiB
  VG UUID               Fmf8tO-TdiW-U3nB-ug0G-ny8x-eZHG-a50dWE

在原本的400M空间上+2G

[root@localhost Desktop]# pvcreate /dev/sdc
  Writing physical volume data to disk "/dev/sdc"
  Physical volume "/dev/sdc" successfully created

 vgextend vg1 /dev/sdc      ---------将/dev/sdc 加入vg1组
  Volume group "vg1" successfully extended

一下就给/dev/vg1/lv1 +上1G大小

lvextend

lvextend -L +1G /dev/vg1/lv1

Extending logical volume lv1 to 1.20 GiB
Logical volume lv1 successfully resized

--- Logical volume ---
  LV Path                /dev/vg1/lv1
  LV Name                lv1
  VG Name                vg1
  LV UUID                eysn8s-IYuT-QImT-agV1-ZHFJ-IJDG-jMrnG9
  LV Write Access        read/write
  LV Creation host, time localhost.localdomain, 2014-11-08 01:39:45 -0800
  LV Status              available
  # open                 1
  LV Size                1.20 GiB
  Current LE             306
  Segments               2
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           253:0

 

-----删除lv

 如果挂载了 先将它umount

umount /dev/mapper/vg1-lv1

[root@localhost Desktop]# lvremove /dev/vg1/lv1
Do you really want to remove active logical volume lv1? [y/n]: y
  Logical volume "lv1" successfully removed

--删除vg

[root@localhost Desktop]# vgremove /dev/vg1
  Volume group "vg1" successfully removed

--删除pv

[root@localhost Desktop]# pvscan
  PV /dev/sdb1                      lvm2 [109.79 MiB]
  PV /dev/sdb2                      lvm2 [305.93 MiB]
  PV /dev/sdc                       lvm2 [2.00 GiB

[root@localhost Desktop]# pvremove /dev/sdb1
  Labels on physical volume "/dev/sdb1" successfully wiped

 [root@localhost Desktop]# pvscan
  PV /dev/sdb2                      lvm2 [305.93 MiB]
  PV /dev/sdc                       lvm2 [2.00 GiB]
  Total: 2 [2.30 GiB] / in use: 0 [0   ] / in no VG: 2 [2.30 GiB]

 

你可能感兴趣的:(磁盘管理)