Como posso redimensionar meu volume lógico no CentOS6?

3

Eu aumentei o tamanho provisionado no Vsphere para 32GB e usei o gparted para redimensionar o VG para 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

Mas não tenho certeza sobre como redimensionar o LV e não perder dados.

  --- 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

Como posso redimensionar meu volume lógico?

    
por the dave 08.02.2014 / 18:02

1 resposta

3

O crescimento de um volume quase nunca resultaria em perda de dados. É extremamente confiável. (Mas você recentemente verificou backups, não é? Nunca há garantia.)

Para aumentar para todo o seu espaço disponível:

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

Ou para crescer para um valor absoluto / relativo:

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

O significado é um pouco diferente. Mas é assim que costumo usar as duas opções. Você pode ler mais na página man.

-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.

o homem lvresize

    
por 08.02.2014 / 18:41