[SOLVED] lvm resize not

ParasiticTwin

Active Member
Aug 30, 2018
19
0
41
Pittsburgh, Pennsylvania USA
Howdy,

Got my proxmox server up and running. Installed FOG and captured an image. Well, it took up almost all of what Provomox allocated default. So I go through finding out about my logical volume using this link: Ubuntu logical Volume extended

Code:
lvm> vgs
  VG        #PV #LV #SN Attr   VSize   VFree
  ubuntu-vg   1   1   0 wz--n- <46.95g    0

Code:
lvm> lvscan
  ACTIVE            '/dev/ubuntu-vg/ubuntu-lv' [<46.95 GiB] inherit

Code:
$ sudo pvdisplay
  --- Physical volume ---
  PV Name               /dev/sda3
  VG Name               ubuntu-vg
  PV Size               <46.95 GiB / not usable 2.00 MiB
  Allocatable           yes (but full)
  PE Size               4.00 MiB
  Total PE              12018
  Free PE               0
  Allocated PE          12018
  PV UUID               L08bEW-dkXC-nPba-fFQ9-mdEl-kB2Q-u3EMZY

When I follow the commands in the link, The partition has a less than sign then the partition partition size. (<46.95GiB). Obviously I am missing something here. So, first off where can I find amongst the documentation what <46.95Gib means. Then I really would prefer to allocate more space to the volume on this disk. Than just deleting the image an attempt to complete the rezize after the deletion.

TIA

Well, go figure the gui would let me resize the disk. After saving the changes, Re-running the above commands, still displays <46.95GiB
 
Last edited:
Hi @Impact tx for your reply. These are the settings for my proxmox server:

Code:
lsblk -o+FSTYPE,LABEL,MODEL
NAME    MAJ:MIN RM  SIZE RO TYPE MOUNTPOINTS FSTYPE      LABEL MODEL
sda       8:0    0  1.8T  0 disk             zfs_member  rpool WDC WD2002FYPS-01U1B0
├─sda1    8:1    0 1007K  0 part                               
├─sda2    8:2    0    1G  0 part             vfat             
└─sda3    8:3    0  1.8T  0 part             zfs_member  rpool
sdb       8:16   0  1.8T  0 disk             zfs_member  rpool TOSHIBA DT01ACA200
├─sdb1    8:17   0 1007K  0 part                               
├─sdb2    8:18   0    1G  0 part             vfat             
└─sdb3    8:19   0  1.8T  0 part             zfs_member  rpool
sdc       8:32   0  1.8T  0 disk             zfs_member  rpool WDC WD2003FYYS-18W0B0
├─sdc1    8:33   0 1007K  0 part                               
├─sdc2    8:34   0    1G  0 part             vfat             
└─sdc3    8:35   0  1.8T  0 part             zfs_member  rpool
sdd       8:48   0  1.8T  0 disk             zfs_member  rpool Hitachi HUA722020ALA331
├─sdd1    8:49   0 1007K  0 part                               
├─sdd2    8:50   0    1G  0 part             vfat             
└─sdd3    8:51   0  1.8T  0 part             zfs_member  rpool
sr0      11:0    1 1024M  0 rom                                HL-DT-ST DVD+/-RW GTA0N
zd0     230:0    0  135G  0 disk                               
├─zd0p1 230:1    0    1G  0 part             vfat             
├─zd0p2 230:2    0    2G  0 part             ext4             
└─zd0p3 230:3    0 46.9G  0 part             LVM2_member       
zd16    230:16   0    1M  0 disk

I just noticed while compiling this data for you, zd0. I guess that is the virtual disk that was setup for the fog server. hmmm. :/ I was able to increase the sized from within the VM, I think...

Code:
root@pve:~# pvs
root@pve:~#

root@pve:~# vgs
root@pve:~# 

root@pve:~# lvs
root@pve:~#

Fog Server:


Code:
fogserver:~$ lsblk -o+FSTYPE,LABEL,MODEL
NAME             MAJ:MIN RM  SIZE RO TYPE MOUNTPOINTS FSTYPE    LABEL MODEL
sda                8:0    0  135G  0 disk                             QEMU HARDD
├─sda1             8:1    0    1G  0 part /boot/efi   vfat            
├─sda2             8:2    0    2G  0 part /boot       ext4            
└─sda3             8:3    0 46.9G  0 part             LVM2_memb       
  └─ubuntu--vg-ubuntu--lv
                 252:0    0 46.9G  0 lvm  /           ext4            
sr0               11:0    1 1024M  1 rom                              QEMU DVD-R

$ sudo pvs
[sudo: authenticate] Password:          
  PV         VG        Fmt  Attr PSize   PFree
  /dev/sda3  ubuntu-vg lvm2 a--  <46.95g    0 

$ sudo vgs
  VG        #PV #LV #SN Attr   VSize   VFree
  ubuntu-vg   1   1   0 wz--n- <46.95g    0 

$ sudo lvs
  LV        VG        Attr       LSize   Pool Origin Data%  Meta%  Move Log Cpy%Sync Convert
  ubuntu-lv ubuntu-vg -wi-ao---- <46.95g    

Hope this helps

Tx again
 
zd* are indeed ZVOLs. You can have lsblk ignore them via -e230. I you resize a disk from the PVE side you only increase the virtual disk. There's still a partition table, a PV, a LV and a file system to be extended.

Make a backup and run this inside the VM to extend all the parts to their fullest
Bash:
apt -yU install cloud-guest-utils

# Partition (table)
growpart /dev/sda 3

# PV
pvresize /dev/sda3

# Extend LV and file system (-r flag) with 100% of the unallocated space of the VG
lvextend -rl +100%FREE /dev/ubuntu-vg/ubuntu-lv
There's a lot of tools/ways to do the first part such as fdisk, cfdisk, sfdisk, gdisk, cgdisk, sgdisk, parted and many others.
I usually use the cfdisk TUI (no need to install anything) to extend the partition (table) but this is easier to explain as it's non-interactive.
Verify the changes with the same commands but also check df -hT for the file system. The < is called a rounding indicator in the docs.
 
Last edited:
zd* are indeed ZVOLs. You can have lsblk ignore them via -e230. I you resize a disk from the PVE side you only increase the virtual disk. There's still a partition table, a PV, a LV and a file system to be extended.

Make a backup and run this inside the VM to extend all the parts to their fullest
Bash:
apt -yU install cloud-guest-utils

# Partition (table)
growpart /dev/sda 3

# PV
pvresize /dev/sda3

# Extend LV and file system (-r flag) with 100% of the unallocated space of the VG
lvextend -rl +100%FREE /dev/ubuntu-vg/ubuntu-lv
There's a lot of tools/ways to do the first part such as fdisk, cfdisk, sfdisk, gdisk, cgdisk, sgdisk, parted and many others.
I usually use the cfdisk TUI (no need to install anything) to extend the partition (table) but this is easier to explain as it's non-interactive.
Verify the changes with the same commands but also check df -hT for the file system. The < is called a rounding indicator in the docs.
Tx I'll give that a try.


Welp,

--Deleted--

The package installed. The procedure appears to have completed:

Code:
$ df -h
Filesystem                         Size  Used Avail Use% Mounted on
tmpfs                              679M  1.1M  678M   1% /run
/dev/mapper/ubuntu--vg-ubuntu--lv   23G   23G     0 100% /
tmpfs                              1.7G     0  1.7G   0% /dev/shm
efivarfs                           256K  114K  138K  46% /sys/firmware/efi/efivars
none                               1.0M     0  1.0M   0% /run/credentials/systemd-journald.service
none                               1.0M     0  1.0M   0% /run/credentials/systemd-resolved.service
tmpfs                              1.7G     0  1.7G   0% /tmp
/dev/sda2                          2.0G   97M  1.7G   6% /boot
/dev/sda1                          1.1G  6.4M  1.1G   1% /boot/efi
none                               1.0M     0  1.0M   0% /run/credentials/systemd-networkd.service
none                               1.0M     0  1.0M   0% /run/credentials/getty@tty1.service
tmpfs                              340M  8.0K  340M   1% /run/user/1000

Okay

I just ran:

Code:
sudo lvextend -rl +100%FREE /dev/ubuntu-vg/ubuntu-lv

cfdisk selected partition: /dev/sda3
arrowed over to resize and wahla!
it returned the changes I needed. :)

~$ df -hT
Filesystem Type Size Used Avail Use% Mounted on
tmpfs tmpfs 679M 1.1M 678M 1% /run
/dev/mapper/ubuntu--vg-ubuntu--lv ext4 130G 23G 103G 18% /
tmpfs tmpfs 1.7G 0 1.7G 0% /dev/shm
efivarfs efivarfs 256K 114K 138K 46% /sys/firmware/efi/efivars
none tmpfs 1.0M 0 1.0M 0% /run/credentials/systemd-journald.service
none tmpfs 1.0M 0 1.0M 0% /run/credentials/systemd-resolved.service
tmpfs tmpfs 1.7G 0 1.7G 0% /tmp
/dev/sda2 ext4 2.0G 97M 1.7G 6% /boot
/dev/sda1 vfat 1.1G 6.4M 1.1G 1% /boot/efi
none tmpfs 1.0M 0 1.0M 0% /run/credentials/systemd-networkd.service
none tmpfs 1.0M 0 1.0M 0% /run/credentials/getty@tty1.service
tmpfs tmpfs 340M 8.0K 340M 1% /run/user/1000

And it shows up in proxmox with the new disk size.

Thanks I'll mark this solved. ooops check that at least for a moment.

Code:
fogserver:~$ sudo pvs
  PV         VG        Fmt  Attr PSize    PFree
  /dev/sda3  ubuntu-vg lvm2 a--  <131.95g    0
fogserver:~$ sudo vgs
  VG        #PV #LV #SN Attr   VSize    VFree
  ubuntu-vg   1   1   0 wz--n- <131.95g    0
fogserver:~$  sudo lvs
  LV        VG        Attr       LSize    Pool Origin Data%  Meta%  Move Log Cpy%Sync Convert
  ubuntu-lv ubuntu-vg -wi-ao---- <131.95g

the above is good. However, when I go to the servers' terminal zd0 still displays 46.0GB size. Does it take some time for it to sync?

pve:~# lsblk -o+FSTYPE,LABEL,MODEL
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS FSTYPE LABEL MODEL
sda 8:0 0 1.8T 0 disk zfs_member rpool WDC WD2002FYPS-01
├─sda1 8:1 0 1007K 0 part
├─sda2 8:2 0 1G 0 part vfat
└─sda3 8:3 0 1.8T 0 part zfs_member rpool
sdb 8:16 0 1.8T 0 disk zfs_member rpool TOSHIBA DT01ACA20
├─sdb1 8:17 0 1007K 0 part
├─sdb2 8:18 0 1G 0 part vfat
└─sdb3 8:19 0 1.8T 0 part zfs_member rpool
sdc 8:32 0 1.8T 0 disk zfs_member rpool WDC WD2003FYYS-18
├─sdc1 8:33 0 1007K 0 part
├─sdc2 8:34 0 1G 0 part vfat
└─sdc3 8:35 0 1.8T 0 part zfs_member rpool
sdd 8:48 0 1.8T 0 disk zfs_member rpool Hitachi HUA722020
├─sdd1 8:49 0 1007K 0 part
├─sdd2 8:50 0 1G 0 part vfat
└─sdd3 8:51 0 1.8T 0 part zfs_member rpool
sr0 11:0 1 1024M 0 rom HL-DT-ST DVD+/-RW
zd0 230:0 0 135G 0 disk
├─zd0p1 230:1 0 1G 0 part vfat
├─zd0p2 230:2 0 2G 0 part ext4
└─zd0p3 230:3 0 46.9G 0 part LVM2_member
zd16 230:16 0 1M 0 disk








The volume appears to have returned to its original size..
 
Last edited:
Please don't fullquote entire posts. Try to clean up with apt autopurge or use cfdisk to resize sda3 then. The commands are shown at the bottom. Don't forget to write and confirm. I need to see all the steps you did and their outputs to tell you anything. As explained, this procedure has multiple parts and I only see the file system one here.
 
Last edited:
Okay I got perhaps a little ahead of myself...

Code:
$ sudo vgdisplay
  --- Volume group ---
  VG Name               ubuntu-vg
  System ID             
  Format                lvm2
  Metadata Areas        1
  Metadata Sequence No  9
  VG Access             read/write
  VG Status             resizable
  MAX LV                0
  Cur LV                1
  Open LV               1
  Max PV                0
  Cur PV                1
  Act PV                1
  VG Size               <131.95 GiB
  PE Size               4.00 MiB
  Total PE              33778
  Alloc PE / Size       33778 / <131.95 GiB
  Free  PE / Size       0 / 0   <<<<?
  VG UUID               hR10YR-oF0f-A7pT-xNL2-5NGA-peLH-QX61FN

Code:
$ sudo lvdisplay
  --- Logical volume ---
  LV Path                /dev/ubuntu-vg/ubuntu-lv
  LV Name                ubuntu-lv
  VG Name                ubuntu-vg
  LV UUID                wmGpJy-XC3j-wNjk-Qref-97x9-J09e-lMX8CR
  LV Write Access        read/write
  LV Creation host, time ubuntu-server, 2026-08-02 19:59:19 +0000
  LV Status              available
  # open                 1
  LV Size                <131.95 GiB
  Current LE             33778
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     16384
  Block device           252:0

Code:
sudo pvdisplay
  --- Physical volume ---
  PV Name               /dev/sda3
  VG Name               ubuntu-vg
  PV Size               <131.95 GiB / not usable 2.98 MiB
  Allocatable           yes (but full) <<<<<
  PE Size               4.00 MiB
  Total PE              33778
  Free PE               0
  Allocated PE          33778
  PV UUID               L08bEW-dkXC-nPba-fFQ9-mdEl-kB2Q-u3EMZY

As you may already can tell, I am a neophyte with proxmox. I am seeing the above full message and at the top of the screen, Free PV size is 0/0. Have I messed something up?
 
Verify the changes with the same commands but also check df -hT for the file system
Probably not but no need to complicate it with another set of commands. Stick to what I shared earlier.
 
Last edited: