Skip to content

Instantly share code, notes, and snippets.

@laineantti
Created November 4, 2018 22:37
  • Star 46 You must be signed in to star a gist
  • Fork 19 You must be signed in to fork a gist
Star You must be signed in to star a gist
Embed
What would you like to do?
Proxmox - Resize pve-root
# Check disk space before
df -h
# Delete local-lvm storage in gui
lvremove /dev/pve/data
lvresize -l +100%FREE /dev/pve/root
resize2fs /dev/mapper/pve-root
# Check disk space after
df -h
@john-shine
Copy link

Warning! This will destroy all your VMs, check before you do it.

@ililminati
Copy link

ililminati commented Mar 9, 2023

Não consegui resolver com segurança meu problema com o método acima, então, fiz o seguinte:

  1. Com comando vgs verifiquei que pve ainda tinha espaço livre:
    root@pve2:~# vgs
 VG       #PV #LV #SN Attr   VSize    VFree
  pve        1   3   0 wz--n- <223.07g 7.30g
  1. Confirmei a informação com o comando:
    # vgdisplay pve
    Free PE / Size 1869 / 7.30 GiB

  2. Depois, com o comando abaixo, me certifiquei do tamanho da minha LV
    # lvdisplay pve-root

Free PE / Size 1869 / 7.30 GiB

  1. Depois redimensionei minha LV em mais 7Gigas
    lvextend -r -L +7G /dev/pve/root

  2. Confirmei que ela havia sido redimensionada com o comando abaixo:
    lvdisplay /dev/pve/root

  3. E para garantir, verifiquei com o comando abaixo:
    lvdisplay /dev/pve/root

Me inspirei no poste abaixo para essa solução, espero que ajude!
https://learn.microsoft.com/pt-br/azure/virtual-machines/linux/how-to-resize-encrypted-lvm

@askiiart
Copy link

askiiart commented Jul 10, 2023

To recreate pve data using 100GB of space: lvcreate -L 100GB -n data pve

You can find how much space is free with vgdisplay (under "FREE PE / Size")

Note that you might need to decrease the size by a tiny bit from what is listed there, due to rounding. For example, on my server, vgdisplay showed 267.79 GB free, but I had to use 267.78 GB for lvcreate.

@dcolley
Copy link

dcolley commented Jul 29, 2023

I found this document that helped me loads.
The main problem was that LV data took up all the space.
https://docs.google.com/document/d/1_5FFYUGwXQEjNosfBXgn838CdqcUExJrFc5ktqLu52c/edit

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment