[SOLVED] VM not utilizing whole disk space

MrNimbus

New Member
Oct 17, 2023
5
1
3
Hey guys,
I setup proxmox a couple of month ago and only now find out that I probably made some mistakes.

My usecase:
Proxmox is installed on a 256GB SSD. I added a 4TB SSD. For now I only need one VM where I run all my services in Docker (nextcloud, immich, wireguard and much more). My plan was to use the small SSD only for proxmox and use the 4TB only for my main VM. I seem to have messed up as my VM only has 98GB:
1697494762880.png

This is the VM:
1697494849619.png

This is the 4TB SSD where my VM seems to be running on:
1697494978381.png
1697495009774.png

When I remember correctly I assigned 1TB to the VM when I created it. Why are only 98GB available in the VM tho? And how can I change that so that the VM has access to the whole 4TB?

Did I messed up something entirely?


I am quite lost as I thought I followed the setup quite textbook-like. Maybe someone can help me how to fix this or guide me to some resources.

Thanks a lot in advance!
 
Hi,

can you please post the output of the following commands inside the VM?
- lsblk
- pvs
- vgdisplay
- lvdisplay

As the disk size is correct from the PVE side, I'd say that Ubuntu simply created the LVM with 100GB space and not used the full disk. The above should confirm that.
 
  • Like
Reactions: MrNimbus
Hi,

so yeah, that confirms it - while the disk is 1TB as you specified, the Ubuntu installer seems to allocate only a part of the disk. Doesn't surprise me all that much tho that Ubuntu does such non-sensical things.

Below procedure is of course on your own risk, so take a backup before! Just to be on the safe side.

In any case, to resize the root partition to it's full size:
Code:
pvresize /dev/mapper/ubuntu--vg-ubuntu--lv /dev/sda3
lvresize /dev/ubuntu-vg/ubuntu-lv /dev/sda3
resize2fs /dev/mapper/ubuntu--vg-ubuntu--lv
That should 1) resize the volume group to the partition size, than 2) grow the logical volume to that size too and 3) finally resize the filesystem to the new size.

The last step assumes you used ext4 as root filesystem, which I guessed based on that you used a standard Ubuntu install.
 
That resolved my problem thank you very much!
If I now wanted to increase the VM disk space even more (more than the originally allocated 1TB) I need to increase the hard disk size on the VM settings and probably run the 3 commands again am I right?
1697887887156.png
Not sure if this is the best solution
 
Hi all!
Returning this topic.

I have this scenario and commands above don't work. I assume is because my case is quite different from the user @Dunuin

1715551052176.png

Is it possible to resize sda2 with the 210G of sda3 ?.

When i want to run first command i got this.

1715551214285.png

Thanks a lot!

PD: The commands above help me out in another scenario quite well!.

Regards!
 
Those are partitions and not LVs. You need to work with the partitioning tool of your choice. Easiest would be to boot a gparted ISO for a GUI.
 
Those are partitions and not LVs. You need to work with the partitioning tool of your choice. Easiest would be to boot a gparted ISO for a GUI.
Uhm ok...is ubuntu server, so no GUI.

Any clue about what procedure to follow?.

Regards!
 
Gparted is its own Live Linux, so it doesn't matter what OS you are running. Boot the VM from that ISO and you will have a GUI.
 
Newbie here - I upgraded my 256GB SSD to a 1TB drive but proxmox is not registering the new storage space.

lsblk:
1741100520091.png

pvs:
1741100531167.png

vgdisplay:
1741100543761.png


lvdisplay:
Code:
root@homeserver:~# lvdisplay
  --- Logical volume ---
  LV Name                data
  VG Name                pve
  LV UUID                oLfgcF-qbEH-Bj0d-Pxcd-NF8X-MKEd-0AYsy5
  LV Write Access        read/write (activated read only)
  LV Creation host, time proxmox, 2024-08-01 21:57:46 +0200
  LV Pool metadata       data_tmeta
  LV Pool data           data_tdata
  LV Status              available
  # open                 0
  LV Size                157.23 GiB
  Allocated pool data    49.15%
  Allocated metadata     2.90%
  Current LE             40251
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           252:5
  
  --- Logical volume ---
  LV Path                /dev/pve/swap
  LV Name                swap
  VG Name                pve
  LV UUID                FTD2UZ-4XnE-z1MN-DYAC-8Qp0-dj5x-n85Eou
  LV Write Access        read/write
  LV Creation host, time proxmox, 2024-08-01 21:57:38 +0200
  LV Status              available
  # open                 2
  LV Size                8.00 GiB
  Current LE             2048
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           252:0
  
  --- Logical volume ---
  LV Path                /dev/pve/root
  LV Name                root
  VG Name                pve
  LV UUID                RGFYw9-He19-2TKL-Mtbd-6nMD-XKT7-q76mdV
  LV Write Access        read/write
  LV Creation host, time proxmox, 2024-08-01 21:57:38 +0200
  LV Status              available
  # open                 1
  LV Size                <69.37 GiB
  Current LE             17758
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           252:1
  
  --- Logical volume ---
  LV Path                /dev/pve/vm-100-disk-0
  LV Name                vm-100-disk-0
  VG Name                pve
  LV UUID                0GQmRe-JZlj-XsA4-rKTF-DYkL-rPJi-d8TfeB
  LV Write Access        read/write
  LV Creation host, time homeserver, 2024-08-02 02:33:03 +0200
  LV Pool name           data
  LV Status              available
  # open                 0
  LV Size                50.00 GiB
  Mapped size            1.90%
  Current LE             12800
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           252:6
  
  --- Logical volume ---
  LV Path                /dev/pve/vm-10443-disk-0
  LV Name                vm-10443-disk-0
  VG Name                pve
  LV UUID                gpemZI-rfFI-q0w7-7VUY-vOS8-E4hH-QD4FAO
  LV Write Access        read/write
  LV Creation host, time homeserver, 2024-08-04 00:32:37 +0200
  LV Pool name           data
  LV Status              available
  # open                 1
  LV Size                24.00 GiB
  Mapped size            34.57%
  Current LE             6144
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           252:9
  
  --- Logical volume ---
  LV Path                /dev/pve/vm-10443-disk-1
  LV Name                vm-10443-disk-1
  VG Name                pve
  LV UUID                qFaS9e-Bn8r-C8dI-pBta-35nd-bubT-ITUT4x
  LV Write Access        read/write
  LV Creation host, time homeserver, 2024-08-04 00:32:37 +0200
  LV Pool name           data
  LV Status              available
  # open                 1
  LV Size                16.00 GiB
  Mapped size            4.20%
  Current LE             4096
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           252:10
  
  --- Logical volume ---
  LV Path                /dev/pve/vm-102-disk-0
  LV Name                vm-102-disk-0
  VG Name                pve
  LV UUID                UMjaHz-e7eO-s4gR-EezB-L5Hz-YnBY-xAG7kx
  LV Write Access        read/write
  LV Creation host, time homeserver, 2024-12-27 19:41:45 +0100
  LV Pool name           data
  LV Status              available
  # open                 1
  LV Size                4.00 MiB
  Mapped size            0.00%
  Current LE             1
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           252:11
  
  --- Logical volume ---
  LV Path                /dev/pve/vm-102-disk-1
  LV Name                vm-102-disk-1
  VG Name                pve
  LV UUID                w6vNcd-HIcf-LYXi-xfmY-Xdgl-f2i7-gFqj2u
  LV Write Access        read/write
  LV Creation host, time homeserver, 2024-12-27 19:41:46 +0100
  LV Pool name           data
  LV Status              available
  # open                 1
  LV Size                92.00 GiB
  Mapped size            41.78%
  Current LE             23552
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           252:12
  
  --- Logical volume ---
  LV Path                /dev/pve/vm-104-disk-0
  LV Name                vm-104-disk-0
  VG Name                pve
  LV UUID                UUpRXk-Defi-c4F7-Yrse-90E4-bk2Q-lM5ytZ
  LV Write Access        read/write
  LV Creation host, time homeserver, 2025-02-15 22:10:39 +0100
  LV Pool name           data
  LV Status              available
  # open                 1
  LV Size                30.00 GiB
  Mapped size            96.40%
  Current LE             7680
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           252:13


Help is greatly appreciated :)