Resizing a virtual disk - windows host and linux guest

Discussions about using Linux guests in VirtualBox.
Post Reply
thosrtanner
Posts: 7
Joined: 18. Feb 2019, 10:52

Resizing a virtual disk - windows host and linux guest

Post by thosrtanner »

I've read around the forums and managed to resize my main disk.

Except it hasn't.

I've run vboxmanage --resize to increase the size.

Then I've booted a gparted image, and resized the drive to the new size.

However, whenever I boot my main image, the drive still comes up at the old size.

If I look at the drive in the settings page of virtualbox, it shows 'virtual size' as the new increased size, actual size as the old size. And df -k says it's the old size.

I reboot gparted and go to configure the disk, it has the drive fully allocated at the new size, with the yellow band going about half way across the disk and then all white to the end of it.

I did this once succesfully but I'm at a bit of a loss as to how to continue now
mpack
Site Moderator
Posts: 39156
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: Resizing a virtual disk - windows host and linux guest

Post by mpack »

Hopefully you read the FAQ: How to resize a Virtual Drive.

I suspect the stuff about snapshots is relevant (third post).
thosrtanner
Posts: 7
Joined: 18. Feb 2019, 10:52

Re: Resizing a virtual disk - windows host and linux guest

Post by thosrtanner »

I definitely started the process out by making a new clone to avoid the snapshot problem (and free up some disk space...)
mpack
Site Moderator
Posts: 39156
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: Resizing a virtual disk - windows host and linux guest

Post by mpack »

Well, there aren't that many things to understand here.

First, if VirtualBox says that the drive size is X, then the drive size is X. That only leaves: mounting the wrong VDI in the VM, or guest filesystem configuration problems.
thosrtanner
Posts: 7
Joined: 18. Feb 2019, 10:52

Re: Resizing a virtual disk - windows host and linux guest

Post by thosrtanner »

I found my answer here:https://unix.stackexchange.com/question ... 01d0fd5da6

Worked fine (and without multiple extra reboots too!)

It might be worth adding that to the FAQ?
mpack
Site Moderator
Posts: 39156
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: Resizing a virtual disk - windows host and linux guest

Post by mpack »

That doesn't seem like FAQ material to me. We don't generally get down and dirty about the specifics of certain guest tools, only about VirtualBox itself.

None of this is VirtualBox specific. In the real world if you transferred a disk image onto a larger drive then you'd meet the same problem: telling your guest OS how to use the new space.
thosrtanner
Posts: 7
Joined: 18. Feb 2019, 10:52

Re: Resizing a virtual disk - windows host and linux guest

Post by thosrtanner »

gparted is not virtualbox specific either but it's in the faq.

And my setup isn't special. I have a "disk" with 2 partitions, and I expanded the 2nd one. I did this once before with no issue, but the 2nd expansion seemed to need the extra intervention.
mpack
Site Moderator
Posts: 39156
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: Resizing a virtual disk - windows host and linux guest

Post by mpack »

thosrtanner wrote:gparted is not virtualbox specific either but it's in the faq.
A description of how to use GParted is not in the FAQ. It is simply mentioned as a popular tool to use at that point.

What is in the FAQ is this:
FAQ wrote: Note 1: The only step that VirtualBox is concerned with is step 1. After that you need to seek additional information on the partition manager you wish to use from the vendor of the partition manager.
thosrtanner
Posts: 7
Joined: 18. Feb 2019, 10:52

Re: Resizing a virtual disk - windows host and linux guest

Post by thosrtanner »

Step 2: Extend the primary partition to include the new drive space.
Download the GParted Live CD
is pretty specific. As opposed to 'Use a partition manager such as GParted'

All I'm asking for a small addition to the faq that suggests you may need to run this extra utiility to get your guest linux O/S to recognise the extra space. Rather than have people hunt round the internet. I understand virtualbox is only concerned with step 1, but this one little extra step is hard to find and fairly important.
mpack
Site Moderator
Posts: 39156
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: Resizing a virtual disk - windows host and linux guest

Post by mpack »

thosrtanner wrote: All I'm asking for a small addition to the faq that suggests you may need to run this extra utiility to get your guest linux O/S to recognise the extra space.
Which is precisely what the FAQ already does. It's the sole reason there is a step 2 in the FAQ.

I see no value in continuing this ping pong any further. I'm not changing the FAQ, and I'm not expecting you to agree.
Post Reply