Increasing VDI file size on VirtualBox part 2: merging partitions with GParted


Second part of the tutorial how to resize VDI file that covers instruction how to extend old partition using GParted.

In previous article I’ve described how I increased the size of .vdi file but still the new free space was missing. Once I’ve launched Ubuntu’s Disk Utility everything become clear. Space was there but it was unallocated and my primary partition remain the same size.

Problem was that behind my primary partition there was a Linux swap partition. I couldn’t just simply extend the size of partition and also I didn’t want two separate partitions. So, what I have done? I deleted swap, extended size of partition and recreated swap at the end of it. Below is the detailed list of all steps.

1. Download GParted live cd . I’ve used version 0.6.1-2.

2. Mount ISO file in VirtualBox CD-ROM and start the machine.

3. Using GParted delete linux-swap partition and extended partition that contains it.

4. Resize primary partition leaving some space (5%) for swap at the end of the disk.

5. Create new Extended Partition inside free space.

6. Create new Logical Partition inside newly created one and select linux-swap as a file system.

7. Press apply and enjoy the success.

8. Shutdown virtual machine and unmount GParted live CD. (You don’t need image for this one, do you? 🙂 )

Rate article
Add a comment