De acordo com as Leis 12.965/2014 e 13.709/2018, que regulam o uso da Internet e o tratamento de dados pessoais no Brasil, ao me inscrever na newsletter do portal DICAS-L, autorizo o envio de notificações por e-mail ou outros meios e declaro estar ciente e concordar com seus Termos de Uso e Política de Privacidade.
Colaboração: Renato Rudnicki
Data de Publicação: 04 de abril de 2012
Caso seu LVM esteja sem espaço para expandir partições, uma solução é adicionar outro disco ao Volume Group e então expandir a partição desejada.
[root@bacula log]# df -h Filesystem Size Used Avail Use% Mounted on /dev/mapper/VolGroup00-LogVol00 3.9G 3.6G 99M 98% / /dev/xvda1 99M 14M 81M 15% /boot tmpfs 1.0G 0 1.0G 0% /dev/shm 10.0.2.244:/DataVolume/backup 1.8T 1.6T 267G 86% /backup
[root@bacula log]# vgdisplay -s "VolGroup00" 7.88 GB [7.88 GB used / 0 free]
[root@bacula log]# lvdisplay --- Logical volume --- LV Name /dev/VolGroup00/LogVol00 VG Name VolGroup00 LV UUID ihlQed-fJQ9-ysfa-naJR-Nzzg-q9Qn-47c3EO LV Write Access read/write LV Status available # open 1 LV Size 4.00 GB Current LE 128 Segments 1 Allocation inherit Read ahead sectors auto - currently set to 256 Block device 253:0 --- Logical volume --- LV Name /dev/VolGroup00/LogVol01 VG Name VolGroup00 LV UUID 8SvsWD-mRMp-LRLe-zecX-cdGF-EZ6G-FO1lsp LV Write Access read/write LV Status available # open 1 LV Size 3.88 GB Current LE 124 Segments 1 Allocation inherit Read ahead sectors auto - currently set to 256 Block device 253:1
# pvcreate /dev/xvdb1 Physical volume "/dev/xvdb1" successfully created
vgextend VolGroup00 /dev/xvdb1
[root@bacula log]# pvdisplay -s Device "/dev/xvda2" has a capacity of 0 Device "/dev/xvdb1" has a capacity of 8.00 GB
[root@bacula log]# vgextend VolGroup00 /dev/xvdb1 Volume group "VolGroup00" successfully extendedRepare no campo
Free PE / Size
, existe 8GB livres que corresponde ao novo
disco adicionado.
[root@bacula log]# lvextend -L +7.9G /dev/VolGroup00/LogVol00 Extending logical volume LogVol00 to 11.00 GB Logical volume LogVol00 successfully resized
[root@bacula log]# resize2fs /dev/VolGroup00/LogVol00 resize2fs 1.39 (29-May-2006) Filesystem at /dev/VolGroup00/LogVol00 is mounted on /; on-line resizing required Performing an on-line resize of /dev/VolGroup00/LogVol00 to 2883584 (4k) blocks. The filesystem on /dev/VolGroup00/LogVol00 is now 2883584 blocks long.
[root@bacula log]# df -h Filesystem Size Used Avail Use% Mounted on /dev/mapper/VolGroup00-LogVol00 11G 3.6G 6.6G 36% / /dev/xvda1 99M 14M 81M 15% /boot tmpfs 1.0G 0 1.0G 0% /dev/shm 10.0.2.244:/DataVolume/backup 1.8T 1.6T 267G 86% /backupInformações retiradas daqui: http://www.fogonacaixadagua.com.br/2009/02/adicionando-um-novo-disco-a-um-volume-lvm2-online/ e manpage
Caso tenha expandido o Logical Volume errado, você pode corrigir isso usando o lvreduce:
[root@bacula log]# lvreduce -L -7.8G /dev/VolGroup00/LogVol01 Rounding up size to full physical extent 7.8 GB WARNING: Reducing active and open logical volume to 3.91 GB THIS MAY DESTROY YOUR DATA (filesystem etc.) Do you really want to reduce LogVol01? [y/n]: y Reducing logical volume LogVol01 to 3.91 GB Logical volume LogVol01 successfully resized
This policy contains information about your privacy. By posting, you are declaring that you understand this policy:
This policy is subject to change at any time and without notice.
These terms and conditions contain rules about posting comments. By submitting a comment, you are declaring that you agree with these rules:
Failure to comply with these rules may result in being banned from submitting further comments.
These terms and conditions are subject to change at any time and without notice.
Comentários