VirtualBox System disk size

Discussions related to using VirtualBox on Windows hosts.
Post Reply
MrBurawski
Posts: 2
Joined: 2. Dec 2021, 16:47

VirtualBox System disk size

Post by MrBurawski »

Hello,
I have the following problem, which I am unable to resolve even after browsing solutions on internet for about 5 days.
I am using VirtualBox on Windows 10. My virtual machine is running the Ubuntu LTS 20.04. It was initially created with 8 GB of space (dynamically allocated) and now I need to resize the disk size.
I have resized the disk size using VirtualMediaManager for each snapshot of the state of machine. I have also resized the disk patition using the "parted" command from linux terminal, I have checked it with Gparted, where my dev/sda2 appears to have the total increased size of 25 878 Mb. However, it seems that the ubuntu system itself doesn't see any free space. It shows that only 8gigs are available for /dev/sda2 when running the command "df -h".
Please let me know what can be the problem and what can I do in this situation? Do I have to change the disk (or snapshots') UUID?
Kind regards
MrBurawski
Posts: 2
Joined: 2. Dec 2021, 16:47

Re: VirtualBox System disk size

Post by MrBurawski »

Solved. Booting from gparted live CD, i have noticed that the new space was unallocated to a partition. A simple check command which i ran on the dev/sda2 fixed it and now the space is allocated.
mpack
Site Moderator
Posts: 39156
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: VirtualBox System disk size

Post by mpack »

8GB? That was never going to work. Even my old Win98 PC had 6GB of disk space.

Anyway, it sounds like you've done everything except account for the repartitioning. It's unclear from your post to what extent you've looked at partioning, so I'm going to address two possibilities: (a) you have not addressed it at all, (b) you looked but the partition can't be increased.

(a) You have not addressed partitioning at all. Most OS will not automatically use extra disk space just because it finds it available: it has no way of knowing why you added that space. If you want your OS to use that space then you usually have to tell it. That means running a partition manager inside the guest OS. For Ubuntu a good choice is GParted, it provides an understandable graphical display of current partitioning.

(b) It's possible you already tried to increase the main partition size and failed. That would be because although the disk is bigger the old partitions are still where they were, and perhaps your main partition can't be expanded because it would overlap another partition. You need to inspect the situation and move aside any partitions that get in the way, leaving all the unpartitioned space to the right of your main partition, which is now free to expand into that area - after you tell it to (see (a)).
 Edit:  I see you posted again while I was composing this. I'll leave it since the content may be useful to others. 
Post Reply