Increase the size of an existing Windows partition

Discussions about using Windows guests in VirtualBox.
drs@dcneuro.net
Posts: 96
Joined: 29. Oct 2013, 18:10

Increase the size of an existing Windows partition

Post by drs@dcneuro.net »

I am not clear on how to increase the size of an already up and running Windows virtual machine running in OS. I know it can be done but I just don't understand how to do it.
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: Increase the size of an existing Windows partition

Post by Perryg »

s3igell
Posts: 7
Joined: 15. Feb 2015, 06:14

Re: Increase the size of an existing Windows partition

Post by s3igell »

The procedure specified using VBoxManage modifyhd works just fine for the VB side of the equation.
The increased size of the .VDI can be confirmed using the VirtualBox Manager Details Storage display.

BUT...

That does not increase the Unpartitioned Space which Win10 Disk Management sees - the entirety of that VDI "Free Space" is not Populated/Committed - but rather Win10 Disk Mgmt still sees the Disk as the size that it was initially Pre-Expanded when originally built as a New VM. Interestingly, neither does the "Boot to GPartEd-Live ISO and Edit Partition there" trick so frequently espoused work either.

In my case:
Built a Win10 Virtual Machine using the Default suggestions of "Dynamic" disk and "25GB".
Win10 Installer saw that as 25GB of Space, and built a very small "System Reserved" Partition and then the "C:" Partition as 24.66GB.
VM shows 17.2GB Actual Size used of 25GB Virtual Size. And Win10 shows 20.8GB used within the C: Partition.

Now that Win 10 has a new Build available that requires 8GB+ of Free Space to Install, I've used VBoxManage modifyhd to increase the VDI to 36GB.
VM shows 17.2GB Actual Size used of 36GB Virtual Size.
Win10 Disk Manager sees ONLY 1MB of Free Space on the Virtual Drive. GPartED sees ONLY 1GB on the Virtual Drive.

If multiple Partition Managers originating from multiple OS's still see the same "restriction", then there must be some Step that is being missed within the VB Implementation/Management of the Dynamic Disk.

What am I missing ??
socratis
Site Moderator
Posts: 27329
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: Increase the size of an existing Windows partition

Post by socratis »

Perryg wrote:there must be some Step that is being missed within the VB Implementation/Management of the Dynamic Disk.
Please post the exact VBoxManage command that you used to resize the guest HD and the exact response that you got. Also, do you use snapshots by any chance? I just tried it with and without snapshots (tricky), with GParted and native in Windows 10 with no problems.
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
s3igell
Posts: 7
Joined: 15. Feb 2015, 06:14

Re: Increase the size of an existing Windows partition

Post by s3igell »

Well, since the Resize to 36GB was successful before Researching and Posting to this thread...

I needed to perform another Resize - to 40GB:

Code: Select all

C:\Users\Shane\VirtualBox VMs>"c:\Program Files\Oracle\VirtualBox\VBoxManage.exe
" modifyhd "C:\Users\Shane\VirtualBox VMs\Windows 10 Tech Preview\Windows 10 Tec
h Preview.vdi" --resize 40960
0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%

C:\Users\Shane\VirtualBox VMs>
Upon completion, and restarting the VM, still the same issue - Win 10 Disk Management Console and GParted-Live see the Disk as only the original 25GB.

What did you do specifically with Gparted and/or Win 10 Disk Mgmt ??
socratis
Site Moderator
Posts: 27329
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: Increase the size of an existing Windows partition

Post by socratis »

s3igell wrote:Well, since the Resize to 36GB was successful
Wait a minute. What do you mean "successful"? I thought that this right here was your problem; you couldn't resize it from 25 to 36 GB. How did you and successful meet?
s3igell wrote:What did you do specifically with Gparted and/or Win 10 Disk Mgmt ??
Nothing. Absolutely nothing. They both saw the extra space. I extended the original to occupy the free space and done.

You still didn't answer my question about snapshots...
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
s3igell
Posts: 7
Joined: 15. Feb 2015, 06:14

Re: Increase the size of an existing Windows partition

Post by s3igell »

socratis wrote:
s3igell wrote:Well, since the Resize to 36GB was successful
Wait a minute. What do you mean "successful"? I thought that this right here was your problem; you couldn't resize it from 25 to 36 GB. How did you and successful meet?
There are 2 parts to Extending the Win 10 Partition: Extending the Virtual Disk and Extending the Partition within that Virtual Disk.
The 1st part has been Successful - at least per VirtualBox (VBoxManage and VirtualBox Manager both see the Dynamic Disk Size has been Expanded to the Specified 40GB Limit).
The 2nd part has never been Successful - Win 10 Disk Manager or Gparted Live are NOT recognizing the Virtual Disk as anything larger than the Original 25GB of Dynamic Disk Size.
socratis wrote:
s3igell wrote:What did you do specifically with Gparted and/or Win 10 Disk Mgmt ??
Nothing. Absolutely nothing. They both saw the extra space. I extended the original to occupy the free space and done.
There is my Problem. Neither tool is recognizing that there is any Extra Space allowed per the Dynamic Disk showing only 25GB Space and of that only 1MB is seen as Free Space (the 25GB Size is the same as when the Virtual Disk was originally Created and Mounted to this VM).
socratis wrote:You still didn't answer my question about snapshots...
Sorry, missed that one...
YES, I'm using Snapshots for this VM. I've currently got a linear "tree" of 5 successive Snapshots.

Does this have something to do with my Problem ?? If so, what are the steps to resolve ??
socratis
Site Moderator
Posts: 27329
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: Increase the size of an existing Windows partition

Post by socratis »

I knew it... You're resizing the base image, not your current state of affairs. What you need to do it to resize your last snapshot. As it says in the linked thread above:
Note 3: In 4.3.0 the devs fixed a bug which had previously made it impossible to resize a snapshot. Since then it is possible, but not recommended for non-experts.
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
s3igell
Posts: 7
Joined: 15. Feb 2015, 06:14

Re: Increase the size of an existing Windows partition

Post by s3igell »

socratis wrote:I knew it... You're resizing the base image, not your current state of affairs. What you need to do it to resize your last snapshot. As it says in the linked thread above:
Note 3: In 4.3.0 the devs fixed a bug which had previously made it impossible to resize a snapshot. Since then it is possible, but not recommended for non-experts.
OK. So, where does one find such "expert" details ??

The VirtualBox docs fail to mention any such difficulties.
They describe the workings of Snapshots as being the rather expected "traditional" Immutable Base plus Difference Data written since the Snapshot.
As you are saying the modifyhd change is applied to the Base Image, and that Base Image should be where all Basic Size Parameters are Authoritative (else Updated Copies of such Parameters should be present in the Snapshot for which that Parameter was Changed), one would have assumed (OK - there it is) that the modifyhd Command and the VDI Snapshot Structure were properly handling the modification of such Disk Parameters.

So, again, What am I missing ??
And, more importantly, How does one successfully Expand a VDI Dynamic Disk with Snapshots in play ??

I chose this modifyhd route, rather than simply abandoning this Win 10 Preview VDI for one Created with a Larger Starting Size because I wanted to Learning Experience... I guess I'm getting one...
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: Increase the size of an existing Windows partition

Post by Perryg »

You would resize the last (newest) snapshot. Remember that if and when you try to open an older state ( snapshot ) you will not see the increased size, but then again you would not see anything installed in the last snapshot there either.
socratis
Site Moderator
Posts: 27329
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: Increase the size of an existing Windows partition

Post by socratis »

I had already told him that, but it seems that only half of my replies are reaching the destination ;)

@s3igell
Experts means that you understand what a snapshot is and how it behaves. That means that you have to invest time and energy in reading the manuals and experimenting with things that you do not care if they break or not. Build a test VM and experiment at will. That's the only way I know that you can master a topic. Reading and applying what you've read. Rinse and repeat.
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
s3igell
Posts: 7
Joined: 15. Feb 2015, 06:14

Re: Increase the size of an existing Windows partition

Post by s3igell »

socratis wrote:I had already told him that, but it seems that only half of my replies are reaching the destination ;)

@s3igell
Experts means that you understand what a snapshot is and how it behaves. That means that you have to invest time and energy in reading the manuals and experimenting with things that you do not care if they break or not. Build a test VM and experiment at will. That's the only way I know that you can master a topic. Reading and applying what you've read. Rinse and repeat.
Thank you for the Dressing Down!!

Simply because of my low Post count on this Forum, one needent assume that I am a Newbie to either the environments of Data Storage Management nor Large-scale Software Development/Testing/Documentation/Deployment Environments.

In fact, I DO have a rather decent Understanding of how Snapshots are Designed, Implemented, and Used within the both Software and Hardware Industries, having Managed BOTH for several DataCenters and rather Large Companies.
I also DID read EVERYTHING that could be found through the VirtualBox Docs - VBoxManager and VBoxManage Docs and Man Pages and this Forum as well as Google Searches. While there were numerous details about the Instancing and Dependency structures of Snapshots, there was nowhere that I could find any detail about Where within the VB Snapshot implementation the canonical Virtual Disk Logical Size was stored. Nor was there any explicit instruction detailing how Snapshots were to be addressed within the VBoxManage modifyhd command structure.

With regard to an Implementation of Snapshot that relies directly upon cascading references through a stack of Differencing sets, one would expect that either the successful change of a Parameter such as the Logical Size at the root-level Image would cascade forward implicitly else be explicitly written forward through the Snapshot tree else failing all else would be Disallowed as "Invalid" or "Structurally Corrupting". VBoxManage modifyhd does in fact successfully perform the change of that Logical Size parameter at the root-level Image (and confirm via showhdinfo and via VBoxManager), yet fails to communicate forward that change - potentially setting up for some rather nasty and Invalid Snapshot structures. This should have been Found and Called-Out as a Design-level Issue during Regression Testing of either Snapshot or "modifyhd --resize" (whichever was implemented last).
s3igell
Posts: 7
Joined: 15. Feb 2015, 06:14

Re: Increase the size of an existing Windows partition

Post by s3igell »

The Good News is that, once I received the comment from @Perryg regarding the need to perform the VboxManage modifyhd --resize against the current Snapshot Node File, I've been able to overcome the Original Issue - Extending the Virtual File Logical Size parameter within the VDI structure such that one can then Extend the Partition within the Win 10 VM.

I've still to do some additional testing, before deciding whether to apply modify --resize to each of the Snapshot files within this VDI tree or to pursue Flattening the VDI with clonehd (or otherwise Flatten by Deleting the individual Snapshots through the VBox Manager).

Any experience on how successfully clonehd handles Snapshotted VDIs ??
(See, I'm learning to not Assume all combinations are successfully handled...)
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: Increase the size of an existing Windows partition

Post by Perryg »

I am not sure that you can merge the snapshots after a resize of an individual snapshot. Never tired. I would think that all of the differencing images would need to be the exact same size before it would work though. If it were me and I wanted to have a flat image ( all snapshots merged ) I would clone the guest using CloneVDI Tool
s3igell
Posts: 7
Joined: 15. Feb 2015, 06:14

Re: Increase the size of an existing Windows partition

Post by s3igell »

Perryg wrote:I am not sure that you can merge the snapshots after a resize of an individual snapshot. Never tired. I would think that all of the differencing images would need to be the exact same size before it would work though. If it were me and I wanted to have a flat image ( all snapshots merged ) I would clone the guest using CloneVDI Tool
Thanks...
Reading through the 64-page Thread... But this looks Promising... (even if Vbox Manager has similar Functionality minus the Compaction...)
Post Reply