Resize Ubuntu Disk on Proxmox
Last updated: 2024-06-11
Guides
Proxmox
- Resize the hard drive on the target machine
- Specify how much to extend the drive by, not the new drive size!
- Click Resize disk
Partition mgmt the Ubuntu VM
-
Enter superuser mode
sudo su
-
Run
fdisk -l
to see the existing partition. We want to identify the main one.
Output:
Device Start End Sectors Size Type
/dev/sda1 227328 71720926 71493599 34.1G Linux filesystem
/dev/sda14 2048 10239 8192 4M BIOS boot
/dev/sda15 10240 227327 217088 106M EFI System
Looking at above /dev/sda1
is the partition we want.
- Run the parted command with the partition in question
parted [PARTITION IN QUESTION]
ex:parted /dev/sda1
Output:
root@k8s-02:/home/serveradmin# parted /dev/sda1
GNU Parted 3.4
Using /dev/sda1
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted)
- Run
print
in the (parted) menu
(parted) print
Model: Unknown (unknown)
Disk /dev/sda1: 36.6GB
Sector size (logical/physical): 512B/512B
Partition Table: loop
Disk Flags:
Number Start End Size File system Flags
1 0.00B 36.6GB 36.6GB ext4
-
Resize the partition 1 as indicated above with
resizepart 1
-
Type
Yes
(parted) resizepart 1
Warning: Partition /dev/sda1 is being used. Are you sure you want to continue?
Yes/No?
-
Type 100%
End? [36.6GB]? 100%
-
Type
quit
-
Now we need to resize the file system
resize2fs /dev/sda1
-
Check to see if it works:
df -h