1

Topic: Troubles expanding disk space (Virtual machine disk space expansion)

The problem boils down to the subject: My virtual machine (VirtualBox fixed space) is running out of disk space, so I expanded it's virtual storage. Here are the exact steps I took:

1. Exported the virtual disk image and imported into VMWare (I decided to migrate to VMWare). I also did some cleaning up, such as uninstall some VBox stuff and installing VMWare Tools.
2. I expanded the disk space from 35 GB to 80 GB.
3. I install GParted (to be able to allocate the space).
4. I opened GParted successfully. I see four partitions: /dev/sda1 under ext4, mounted at /, with 33 gbs. I also see an unallocated partition with 45 gbs, and two smaller partitions under the file systems 'extended' and 'linux-swap'. I right click the /dev/sda1 (33gb partition) and click 'Resize/Move'.
5. Minimum size: 33791 MiB. Maximum size: 33791 MiB. I cannot drag the slider in either direction to resize the partition.
6. I figure that I cannot resize a partition since I'm booted into the very partition I'm trying to modify. I open my windows Disk Management tool (my computer runs native Windows)
7. I don't see any additional partitions. This makes sense, since these are virtual drives we're talking about. But now I'm in a catch 22 where I can only detect the partition when I'm booted into the very partition I need to modify.

Any help on how I can allocate the free space for my partition is appreciated.

2

Re: Troubles expanding disk space (Virtual machine disk space expansion)

I assume your disk layout is like this:

Partition     File system   Mount point   Size
sda1          ext4          /             33 GiB
sda4          extended                     2 GiB
> sda5        linux-swap                   2 GiB
unallocated   unallocated                 45 GiB

GParted is showing the physical layout on disk.  So sda4 (extended) and sda5 (linux-swap) partitions are directly after sda1 (ext4) and are preventing it being extended.  They have to be moved first.

Here are the steps required:
1. Grow sda4 (extended) to the right as much as possible.  Apply operations.
2. If sda5 (linux-swap) is busy, Swapoff.
3. Move sda5 (linux-swap) to the right as much as possible.
4. Move the start of sda4 (extended) to the right as much as possible.  Apply operations.
5. Swapon sda5 (linux-swap) if you Swapoff'ed it in step 2.
6. Grow sda1 (ext4, /) to the right as much as possible.  Apply operations.