5

I'd like to extend my virtual disk in a Proxmox environment from 64GB to 100GB. The guest OS is Debian 10. I've extended the virtual disk in Proxmox (it now has 100GB) and restarted the guest OS.

cfdisk correctly sees that the size of the disk is now 100GiB:

                                             Disk: /dev/vda
                          Size: 100 GiB, 107374182400 bytes, 209715200 sectors
                                   Label: dos, identifier: 0x9f2b12a1

    Device           Boot               Start           End       Sectors      Size     Id Type
>>  /dev/vda1        *                   2048        499711        497664      243M     83 Linux
    /dev/vda2                          501758     134215679     133713922     63.8G      5 Extended
    └─/dev/vda5                        501760     134215679     133713920     63.8G     8e Linux LVM
    Free space                      134215680     209715199      75499520       36G

However I'm unable to extend either vda2 or vda5 with the following error messages:

  • /dev/vda2: Maximum size is 68461528064 bytes
  • /dev/vda5: Failed to resize partition #5.

Any ideas what could be wrong?

adamsfamily
  • 183
  • 9

2 Answers2

0

I had the same problem.

I solved it by creating a new partition via cfdisk and then created a new physical volume via pvcreate /dev/sda3. I added this new pv to the my volume group: vgextend /dev/VMTEMPLATE-vg /dev/sda3.

The VG should now be the correspondingly enlarged. Then I resized the logical volume: lvresize /dev/VMTEMPLATE-vg/root /dev/sda3.

Finally I adjusted the size of the filesystem: resize2fs /dev/mapper/VMTEMPLATE--vg-root.

Greenonline
  • 1,759
  • 7
  • 16
  • 21
jezzuz
  • 1
  • 1
0

In VMWare

Edit VM guest and add some disk space to the first disk and save.

Run cfdisk to utilize the free space

$ sudo cfdisk

Create a new partition from the free space. In my case it was /dev/sda3

Create new physical volume

$ sudo pvcreate /dev/sda3

Physical volume "/dev/sda3" successfully created.

Add the new physical volume to my volume group

$ sudo vgextend /dev/transfer-vg /dev/sda3

Volume group "transfer-vg" successfully extended

Resize logical volume

$ sudo lvresize /dev/transfer-vg/root /dev/sda3

Size of logical volume transfer-vg/root changed from <5.52 GiB (1413 extents) to <17.52 GiB (4485 extents). Logical volume transfer-vg/root successfully resized.

Find the name of filesystem to be resized

$ df -hT | grep mapper

/dev/mapper/transfer--vg-root ext4 5.4G 4.2G 911M 83% /

/dev/mapper/transfer-data ext4 79G 14G 61G 19% /var/www/data

resize filesystem

$ sudo resize2fs /dev/mapper/transfer--vg-root

resize2fs 1.44.1 (24-Mar-2018) Filesystem at /dev/mapper/transfer--vg-root is mounted on /; on-line resizing required old_desc_blocks = 1, new_desc_blocks = 2 The filesystem on /dev/mapper/transfer--vg-root is now 4592640 (4k) blocks long.