Guide: Expanding Linux VM Partitions (Proxmox)
This guide assumes you have already increased the disk size in the Proxmox Web UI and now need to reflect those changes within the Ubuntu guest OS.
1. Initial Verification
First, confirm that the kernel sees the new "physical" space.
# List all block devices
lsblk
What to look for: Does
sdashow 150G whilesda2still shows 49G?If it doesn't see 150G: Run this to force a rescan:
echo 1 | sudo tee /sys/class/block/sda/device/rescan
2. Expand the Partition (The "Fence")
A disk is the "land," and a partition is the "fence." We need to move the fence to the edge of the new land.
Install the Utility
If you don't have growpart, install it (you may need to delete some logs first if you are at 100%):
sudo apt update && sudo apt install cloud-guest-utils -y
Run Growpart
# Syntax: sudo growpart /dev/[disk_name] [partition_number]
sudo growpart /dev/sda 2
3. Expand the Filesystem (The "House")
Now that the fence is moved, we tell the filesystem to occupy the new space.
For EXT4 (Most Common)
sudo resize2fs /dev/sda2
For XFS
sudo xfs_growfs /
4. Special Case: LVM (Logical Volume Manager)
If your df -h shows a path like /dev/mapper/ubuntu--vg-ubuntu--lv, your Ubuntu installation uses LVM. You have extra layers to expand.
Resize Physical Volume (PV):
sudo pvresize /dev/sda2Extend Logical Volume (LV):
sudo lvextend -l +100%FREE /dev/ubuntu-vg/ubuntu-lvResize the Filesystem:
sudo resize2fs /dev/mapper/ubuntu--vg-ubuntu--lv
5. Final Confirmation
Verify that your root partition now reflects the new size.
df -h
[!TIP]
Post-Expansion: Once space is available, restart your Docker containers. Jellyfin should now start successfully since the 2GiB "safety check" will pass.
docker start jellyfin