Resize Disk linux not working

issa2020

Active Member
Sep 9, 2020
83
4
28
Hello evrybody,

i create a VM on ubuntu and now i want add more disk on it :

my vm got 8GO and i add 20GO more

1615042443591.png


so now i boot on gparted and i extend the partition :

so this my disk :


Code:
stagiaire@plex:~$ df -h
Filesystem                         Size  Used Avail Use% Mounted on
udev                               448M     0  448M   0% /dev
tmpfs                               99M  8.3M   90M   9% /run
/dev/mapper/ubuntu--vg-ubuntu--lv  6.9G  6.9G     0 100% /
tmpfs                              491M  4.0K  491M   1% /dev/shm
tmpfs                              5.0M     0  5.0M   0% /run/lock
tmpfs                              491M     0  491M   0% /sys/fs/cgroup
/dev/sda2                          976M  214M  696M  24% /boot
/dev/loop0                          56M   56M     0 100% /snap/core18/1932
/dev/loop1                          56M   56M     0 100% /snap/core18/1944
/dev/loop2                          72M   72M     0 100% /snap/lxd/18546
/dev/loop3                          72M   72M     0 100% /snap/lxd/18772
/dev/loop4                          32M   32M     0 100% /snap/snapd/10492
/dev/loop5                          32M   32M     0 100% /snap/snapd/10707


Code:
stagiaire@plex:~$ lsblk
NAME                      MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
loop0                       7:0    0 55.4M  1 loop /snap/core18/1932
loop1                       7:1    0 55.4M  1 loop /snap/core18/1944
loop2                       7:2    0 71.3M  1 loop /snap/lxd/18546
loop3                       7:3    0 71.3M  1 loop /snap/lxd/18772
loop4                       7:4    0 31.1M  1 loop /snap/snapd/10492
loop5                       7:5    0 31.1M  1 loop /snap/snapd/10707
sda                         8:0    0   28G  0 disk
├─sda1                      8:1    0    1M  0 part
├─sda2                      8:2    0    1G  0 part /boot
└─sda3                      8:3    0   27G  0 part
  └─ubuntu--vg-ubuntu--lv 253:0    0    7G  0 lvm  /
sr0                        11:0    1  369M  0 rom


the pvresize not working :


Code:
root@plex:/home/stagiaire# pvresize /dev/sda3
  /etc/lvm/archive: mkdir failed: No space left on device
  0 physical volume(s) resized or updated / 1 physical volume(s) not resized


root@plex:/home/stagiaire#  lvresize --extents +100%FREE --resizefs  /dev/mapper/ubuntu--vg-ubuntu--lv
  /etc/lvm/archive: mkdir failed: No space left on device



do u know why i can't extend my LVM partition please
 
Last edited:
Hello so i try again :

Code:
root@plex:/home/stagiaire# dmesg | grep sda
[    0.982233] sd 2:0:0:0: [sda] 58720256 512-byte logical blocks: (30.1 GB/28.0 GiB)
[    0.983223] sd 2:0:0:0: [sda] Write Protect is off
[    0.984048] sd 2:0:0:0: [sda] Mode Sense: 63 00 00 08
[    0.984159] sd 2:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
[    0.995031]  sda: sda1 sda2 sda3
[    0.996339] sd 2:0:0:0: [sda] Attached SCSI disk
[    4.393976] EXT4-fs (sda2): mounted filesystem with ordered data mode. Opts: (null)



Code:
root@plex:/home/stagiaire# sudo fdisk -l /dev/sda | grep ^/dev
/dev/sda1     2048     4095     2048   1M BIOS boot
/dev/sda2     4096  2101247  2097152   1G Linux filesystem
/dev/sda3  2101248 58720222 56618975  27G Linux LVM



so i try to expand my partition :

Code:
root@plex:/home/stagiaire# sudo parted /dev/sda
GNU Parted 3.3
Using /dev/sda
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) p
Model: QEMU QEMU HARDDISK (scsi)
Disk /dev/sda: 30.1GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags:

Number  Start   End     Size    File system  Name  Flags
 1      1049kB  2097kB  1049kB                     bios_grub
 2      2097kB  1076MB  1074MB  ext4
 3      1076MB  30.1GB  29.0GB                     lvm

(parted) resizepart 3 100%
(parted) print
Model: QEMU QEMU HARDDISK (scsi)
Disk /dev/sda: 30.1GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags:

Number  Start   End     Size    File system  Name  Flags
 1      1049kB  2097kB  1049kB                     bios_grub
 2      2097kB  1076MB  1074MB  ext4
 3      1076MB  30.1GB  29.0GB                     lvm


I see the godd free space :

Code:
root@plex:/home/stagiaire# sudo fdisk -l /dev/sda | grep ^/dev
/dev/sda1     2048     4095     2048   1M BIOS boot
/dev/sda2     4096  2101247  2097152   1G Linux filesystem
/dev/sda3  2101248 58720222 56618975  27G Linux LVM


Linux told me no free space :

Code:
root@plex:/home/stagiaire# sudo pvresize /dev/sda3
  /etc/lvm/archive: mkdir failed: No space left on device
  0 physical volume(s) resized or updated / 1 physical volume(s) not resized


Code:
root@plex:/home/stagiaire# lvresize --extents +100%FREE --resizefs /dev/mapper/ubuntu--vg-ubuntu--lv
  /etc/lvm/archive: mkdir failed: No space left on device

my partition is still low :


Code:
root@plex:/home/stagiaire# df -h
Filesystem                         Size  Used Avail Use% Mounted on
udev                               448M     0  448M   0% /dev
tmpfs                               99M   12M   87M  13% /run
/dev/mapper/ubuntu--vg-ubuntu--lv  6.9G  6.9G     0 100% /
tmpfs                              491M  4.0K  491M   1% /dev/shm
tmpfs                              5.0M     0  5.0M   0% /run/lock
tmpfs                              491M     0  491M   0% /sys/fs/cgroup
/dev/sda2                          976M  214M  696M  24% /boot
/dev/loop0                          56M   56M     0 100% /snap/core18/1932
/dev/loop1                          56M   56M     0 100% /snap/core18/1944
/dev/loop2                          72M   72M     0 100% /snap/lxd/18546
/dev/loop3                          72M   72M     0 100% /snap/lxd/18772
/dev/loop4                          32M   32M     0 100% /snap/snapd/10492
/dev/loop5                          32M   32M     0 100% /snap/snapd/10707




what is wrong please ?

thanks
 
/etc/lvm/archive: mkdir failed: No space left on device
lvm failed because it wants to create a backup of its layout, but / is already full -> make some free space on / before you do the pvresize
 
  • Like
Reactions: issa2020
Hello!

The steps that issa2020 did worked out for me. The thing is, that I have to do these each time I would like to extend the VMs drive. Is there some update to proxmox that solves this?

We are running:
proxmox-ve: 7.1-1 (running kernel: 5.13.19-2-pve)
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!