Resize disk of debian vm on proxmox...

idic

Member
Mar 13, 2020
7
1
23
51
I'm not sure if this is really appropriate to post here or if it should be in a general Linux forum but I'm piggybacking on this thread.

I'm sort of having the same issue but on debian. however, the original install created more partitions that are messing this simple steps up from above.

I resized the disk in Proxmox from 54GB to 150GB and it is showing within the vm properly.

Code:
root@ggdocker01:~# fdisk -l
Disk /dev/vda: 150 GiB, 161061273600 bytes, 314572800 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x71a7b632

Device     Boot     Start       End   Sectors Size Id Type
/dev/vda1  *         2048 113248255 113246208  54G 83 Linux
/dev/vda2       113250302 125827071  12576770   6G  5 Extended
/dev/vda5       113250304 125827071  12576768   6G 82 Linux swap / Solaris

However, I'm not sure how to extend the file system as the other partitions are in the way.

Code:
root@ggdocker01:~# parted
GNU Parted 3.2
Using /dev/vda
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) print
Model: Virtio Block Device (virtblk)
Disk /dev/vda: 161GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags:

Number  Start   End     Size    Type      File system     Flags
 1      1049kB  58.0GB  58.0GB  primary   ext4            boot
 2      58.0GB  64.4GB  6439MB  extended
 5      58.0GB  64.4GB  6439MB  logical   linux-swap(v1)

(parted) resizepart
Partition number? 1
Warning: Partition /dev/vda1 is being used. Are you sure you want to continue?
Yes/No? yes
End?  [58.0GB]? 143GB
Error: Can't have overlapping partitions.
(parted) quit

Is this an easy-ish fix?

Also, for future VM's is it best to put the data partition at the end so this issue doesn't come up again?

Thnx
 
put the data partition at the is always recommended for future resizing, as I can see, the extended partition is only used as swap, you can tray swapoff the partition, remove the logical and extended partition, resize the first one al leave some space for create a new swap or use all the space and create a swapfile, dont forget update the fstab file for the swap changes.

To avoid the "parted" way, you can tray growpart , this package is part of the cloud-guest-utils packages:

https://manpages.debian.org/stretch/cloud-guest-utils/growpart.1.en.html
 
  • Like
Reactions: idic

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!