如何在CentOS6中调整逻辑卷的大小?

前端之家收集整理的这篇文章主要介绍了如何在CentOS6中调整逻辑卷的大小?前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我将Vsphere客户端的配置大小增加到32GB,并使用gparted将VG的大小调整为32GB
--- Physical volume ---
  PV Name               /dev/sda2
  VG Name               vg_proxy
  PV Size               31.51 GiB / not usable 2.00 MiB
  Allocatable           yes
  PE Size               4.00 MiB
  Total PE              8066
  Free PE               3072
  Allocated PE          4994

但我不确定如何调整LV的大小而不会丢失数据.

--- Logical volume ---
  LV Path                /dev/vg_proxy/lv_root
  LV Name                lv_root
  VG Name                vg_proxy
  LV UUID                h9c0HO-xRQn-jX6q-4GGi-0nkt-2rnt-DNy3gR
  LV Write Access        read/write
  LV Creation host,time proxy,2013-12-23 15:23:20 -0800
  LV Status              available
  # open                 1
  LV Size                17.51 GiB
  Current LE             4482
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto 


  - currently set to     256

如何调整逻辑卷的大小?

增加数量几乎不会导致数据丢失.它非常可靠. (但是,你最近验证过备份,不是吗?从来没有保证.)

要扩展到所有可用空间:

lvresize -rl +100%FREE /dev/vg_proxy/lv_root

或者,增长到绝对/相对值:

lvresize -rL 30G /dev/vg_proxy/lv_root
lvresize -rL +5G /dev/vg_proxy/lv_root

意思有些不同.但是,这就是我通常使用这两个选项的方式.您可以在手册页中阅读更多内容.

-l,–extents [+|-]LogicalExtentsNumber[%{VG|LV|PVS|FREE|ORIGIN}]
Change or set the logical volume size in units of logical extents. With the + or – sign the value is added to or subtracted from the actual size of the logical volume and without it,the value is taken as an absolute one. The number can also be expressed as a percentage of the total space in the Volume Group with the suffix %VG,relative to the existing size of the Logical Volume with the suffix %LV,as a percentage of the remaining free space of the PhysicalVolumes on the command line with the suffix %PVS,as a percentage of the remaining free space in the Volume Group with the suffix %FREE,or (for a snapshot) as a percentage of the total space in the Origin Logical Volume with the suffix %ORIGIN. The resulting value is rounded downward for the substraction otherwise it is rounded upward.

-L,–size [+|-]LogicalVolumeSize[bBsSkKmMgGtTpPeE]
Change or set the logical volume size in units of megabytes. A size suffix of M for megabytes,G for gigabytes,T for terabytes,P for petabytes or E for exabytes is optional. With the + or – sign the value is added or subtracted from the actual size of the logical volume and rounded to the full extent size and without it,the value is taken as an absolute one.

man lvresize

原文链接:https://www.f2er.com/centos/373320.html

猜你在找的CentOS相关文章