Resizing a disk in Proxmox VM involves a few steps: resizing the virtual disk in Proxmox, then resizing the filesystem within the guest OS. Here’s how you can do it:
Step 1: Resize the Disk in Proxmox
- Shut down the VM:
qm shutdown <VMID>
- Resize the disk:
qm resize <VMID> <DISK> +<SIZE>
Replace <VMID>
with your VM ID, <DISK>
with the disk you want to resize (e.g., scsi0
), and <SIZE>
with the amount you want to add (e.g., 10G
for 10 GB).
Step 2: Resize the Filesystem within the Guest OS
- Start the VM:
qm start <VMID>
- Log into the VM and open a terminal.
- Rescan the partition table (if using
parted
):
sudo parted /dev/<DISK> resizepart <PARTITION_NUMBER> 100%
Replace <DISK>
with the disk name (e.g., sda
), and <PARTITION_NUMBER>
with the partition number (e.g., 1
).
- Resize the filesystem (for
ext4
):
sudo resize2fs /dev/<DISK><PARTITION_NUMBER>
Replace <DISK>
with the disk name (e.g., sda
), and <PARTITION_NUMBER>
with the partition number (e.g., 1
).