0

I have looked at some guides, but I'm confused and worried about messing up my VM. I expanded the disk size to 15gb from 10gb. So now I have 5gb unallocated space. When I right click on sda1, I don't have the option to deactivate it like some guides say I need to be able to do. Here's a screen shot of my partition setup. Any help appreciated.

This is what my partitions look like currently:

VM Partitions

2 Answers 2

1

The unallocated space needs to be adjacent to the partition that you want to expand. In this case you will need to move sda2 to the end of the disk, and then you will be able to expand sda1 to encompass the unallocated space.

You do not need to deactivate sda1 before enlarging it. If you wanted to shrink sda1, you would need to take sda1 offline first, but since this is your Linux disk, you can't take it offline. To do that, you would need to boot your VM from a live USB or CD, and choose 'Try Ubuntu`

0
1

It is possible to grow the hard drive in Virtual Box, as you had already found out. After that you will have to partition the drive with gparted from a live session and maybe join partitions. This has been adressed before. See the following questions:

For your layout it means you would have to remove your swap partition (sda2 and sda5) before you can join the adjacent space.

All of these procedures take considerable time and will put you data at risk. You will have to make a backup first. Because you then would already have a backup it would be much much faster to just create a new virtual hard drive where you can restore your backup and keep going.

You can even create a new virtual drive, attach it to your existing virtual machine, and copy your data over.

enter image description here

A new hard drive should be made a dynamically allocated disk (this is the default for new drives in Virtual Box). This means they will grow on demand up to the maximum size you gave it. The actual physical size will be much lower. So when creating a 100 GB dynamically allocated drive it may only use 8 GB of physical space or less.

enter image description here

This will enable you to be generous with space. You present 15 GB is rather small and may soon become too small when using it.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .