Skip to main content

Increasing disk space on the OVA

in Disk Management
Authors list
Published: Nov 30, 2023|Last updated: Feb 13, 2024

If you are using the Deskpro OVA, your VM should take up all available disk space assigned to it and allocate it to the root partition when your server is restarted. This means that you can shutdown your OVA, assign more space to the existing disk then boot it back up again.

When the OVA restarts, it will allocate the additional space to root, which will allow your Deskpro instances to use the space.

Question

What do I do if I've grown the disk and restarted, but nothing happens?

If you experience an issue where you have grown your disk, but the disk space has not automatically allocated, first check to confirm that Ubuntu is aware of the additional space.

With the command fdisk -l, check to confirm that the size of the disk is fully allocated to the partitions.

Disk /dev/sda: 164 GiB, 176093659136 bytes, 343932928 sectors Disk model: Virtual disk 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: gpt Disk identifier: 458C6C7B-6113-49A3-855B-F35173DDFF88 Device Start End Sectors Size Type /dev/sda1 2048 4095 2048 1M BIOS boot /dev/sda2 4096 134215679 134211584 64G Linux filesystem
copy

In the example above, the disk (/dev/sda) has 164 GiB available, but the largest partition (/dev/sda2) is only 64G.

If you see something similar to the above, you may need to manually allocate the additional disk space to the partition using the parted tool.

parted /dev/sda
copy

This should start the GNU Parted prompt for the disk /dev/sda. The following commands need to be entered into the (parted) prompt.

First, confirm the current partition table with the command print

(parted) print Model: VMware Virtual disk (scsi) Disk /dev/sda: 176GB Sector size (logical/physical): 512B/512B Partition Table: gpt Disk Flags: Number Start End Size File system Name Flags 1 1049kB 2097kB 1049kB bios_grub 2 2097kB 68.7GB 68.7GB ext4
copy

In the above example, the partition numbers match the partitions from fdisk -l, so you want to move the end of partition 2 to the end of the disk. The easiest way to do this is to run the command resizepart <partition> <end>. In this context, the command will be resizepart 2 100%:

(parted) resizepart 2 100%
copy

You can confirm that the partition has resized by running the print command again. You can now see that the Size of partition 2 has grown to the full size of the disk.

(parted) print Model: VMware Virtual disk (scsi) Disk /dev/sda: 176GB Sector size (logical/physical): 512B/512B Partition Table: gpt Disk Flags: Number Start End Size File system Name Flags 1 1049kB 2097kB 1049kB bios_grub 2 2097kB 176GB 176GB ext4
copy

The partition has now been resized. Run the command quit to leave the (parted) prompt

You now need to grow the filesystem, which can be done with the command resize2fs

resize2fs /dev/sda2
copy
Filesystem Size Used Avail Use% Mounted on tmpfs 392M 1.5M 390M 1% /run /dev/sda2 162G 55G 100G 36% /
copy

This will resize the filesystem on the partition to take up 100% of available space.

You can confirm this by running the command df -h

Filesystem Size Used Avail Use% Mounted on tmpfs 392M 1.5M 390M 1% /run /dev/sda2 162G 55G 100G 36% /
copy

The partition mounted on root (/) should now be the full size of the disk, and more disk space should be available for Deskpro to use.

HelpfulUnhelpful

1 of 1 people found this page helpful

next pageGrowing your disk on Azure
previous pageIncreasing your disk space (Ubuntu)

Please log in or register to submit a comment.