Solved

Expanding a Partition on OS drive within VM

Posted on 2016-08-29
20
74 Views
Last Modified: 2016-10-31
We are running a server with a couple Hyper-V VMs.  When I created one of the VM I allocated too small of a space to the OS partition thinking I can Expand it later........  Seems I was wrong!  Extend Partition is not an option for the C: Partition.

I tried moving the Page File to the D: Partition and still could not Extend C:.

I downloaded EaseUS Partition Master and tried using it without success.  

The VM Drive is a MBR type running 2012 Server R2 and when I created the VM I did a Gen1, IDE Drive, if that info helps.

I attached a screen shot for Disk Management.

Thanks for you help!
0
Comment
Question by:April33
  • 9
  • 4
  • 3
  • +2
20 Comments
 
LVL 20

Expert Comment

by:CompProbSolv
ID: 41775578
The common advice is to not partition a VM VHD drive.  Can you create another VHD for the data partition (I'm assuming you have an OS and a Data partition), copy the data there, delete the data partition on the existing VM, and then expand C: into that space?
0
 

Author Comment

by:April33
ID: 41775594
CompProbSolv, thanks for the fast response!
You are right on the layout C: OS  and D: Data+programs

I have a couple gotcha's:

1. I installed some programs like SQL 2014 with 3 DB's on the D: partitions since the space was too small on the C:

2. I am running 2012 Server R2 Std which gives a license for 2 VM's and that's what I am currently running.  I don't want to give more money to Microsoft.
0
 
LVL 20

Expert Comment

by:CompProbSolv
ID: 41775597
I'm not talking about adding VMs, just VHDs.  Those don't require extra licenses.  Have one for the OS and one for Data.
0
 
LVL 20

Expert Comment

by:CompProbSolv
ID: 41775599
You should be able to do a backup of the Data drive and restore it to the new VHD.
0
 
LVL 7

Expert Comment

by:Senior IT System Engineer
ID: 41775605
Hi April,

You can use: http://gparted.org/ to expand the VM disk after the Hyper-V disk is extended.
0
 

Author Comment

by:April33
ID: 41775606
ohhhh, I understand what you are saying.  I will think on this and maybe try it tonight.
0
 

Author Comment

by:April33
ID: 41775612
ITSystemEngineer,

Have you used gparted within a VM to expand the OS drive successfully before?

Are there an caveat's I should be made aware?
0
 
LVL 7

Expert Comment

by:Senior IT System Engineer
ID: 41775615
April,
Yes I have.

As long as you have extend the Hyper-V disk before and then you can can mount the .ISO  (bootable) and then boot into it.

Note, this is was during the Windows server 2003 VM era where on the fly extend is not possible.
0
 
LVL 7

Expert Comment

by:Senior IT System Engineer
ID: 41775616
0
 
LVL 32

Expert Comment

by:PowerEdgeTech
ID: 41775622
Another solution is to use: http://www.dell.com/support/home/us/en/04/Drivers/DriversDetails?driverid=R64398
This is no different from the built-in Windows Disk Management functionality ... you still have to have Unpartitioned Space directly to the right of the partition you wish to extend. This utility was designed for 2003, which did not have Extend functionality built in.
0
Control application downtime with dependency maps

Visualize the interdependencies between application components better with Applications Manager's automated application discovery and dependency mapping feature. Resolve performance issues faster by quickly isolating problematic components.

 
LVL 38

Accepted Solution

by:
Philip Elder earned 250 total points
ID: 41775625
Create a new VHDX file in Hyper-V Manager and attach it to the running VM (if Gen2). If the VM is Gen1 then shut it down and add the newly created VHDX to one of the open IDE spots.

Boot the VM, log on, then shut down any services that pull from the D: partition.

Open Disk Management and change the drive letter for the current D: drive to Z:.

Format and set the newly attached VHDX as the new D: drive.

Either use XCopy, or we would use BeyondCompare, with NTFS permissions copy enabled to COPY _all_ data from Z: to D:.

Test, test, and test some more.

Once you are confident that the setup is working then DELETE the Z: partition.

Extend the OS C: partition into the free space.

Done.

NOTE: Back up the VM before, during each step, and after!

I have an EE article on Some Hyper-V Hardware and Software Best Practices that may be of further help.
0
 

Author Comment

by:April33
ID: 41777038
You guys gave me a lot of suggestions.  I'm not sure which one would work best for my situation?

I will be away for a week and a half, so I think I will limp along until I return and then over the weekend try one of the proposed solutions.

I just started implementing Veeam backups last night.  I also want to test these out before moving forward incase thing go sideways.

Thanks guys!
0
 
LVL 20

Assisted Solution

by:CompProbSolv
CompProbSolv earned 250 total points
ID: 41777055
"I'm not sure which one...": the suggestions here are generally following the same path laid out in detail in Philip's last post.  The good part is if you back up the existing vhdx file then the process is very safe.  If you have enough spare disk space then the process is fairly straightforward.
0
 

Author Comment

by:April33
ID: 41777066
Thanks for your input CompProbSolv.
0
 
LVL 38

Expert Comment

by:Philip Elder
ID: 41777141
Veeam is good stuff. You can rest assured that your VMs are backed up.

Depending on edition the host would need to be set up and Veeam installed in order to restore the VMs. It just works.
0
 

Author Comment

by:April33
ID: 41777191
I am new to Veeam so I am still learning their software.  I am making the switch from StorageCraft.  Veeam software seems to be really good.
0
 
LVL 38

Expert Comment

by:Philip Elder
ID: 41777264
We do both. For smaller deployments we run with ShadowProtect. For larger deployments and cluster settings we run with Veeam since it is host based.
0
 

Author Comment

by:April33
ID: 41793698
So I ended up creating another Vhdx as you suggested and attached as IDE drive within the VM.  I used a RoboCopy script to copy the data from one partition to the other.

I had to disable the PageFile (reboot), which was located on the D: drive and disable SQL and Other Services that were running on the D: drive.  Then I was able the flip flop the drive letters of the old D and new Z drives.

Rebooted the VM and tested SQL and other Apps that are now running on their own Vhdx.
Once they checked out good, I deleted the old partition and then was able to Expand the C: drive to 140GB!

I believe this is mission accomplished.

Thanks for everyone's input and help!
0
 

Author Comment

by:April33
ID: 41809891
Thanks!
0
 

Author Closing Comment

by:April33
ID: 41867772
Thanks, I thought was closed a long time ago.  Sorry for the delay
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Hyper-convergence systems have taken the IT world by storm and have quickly started to change our point of view of how the data center should and could be architected. In this article, I’ll explain the benefits of employing a hyper-converged system …
Ever notice how you can't use a new drive in Windows without having Windows assigning a Disk Signature?  Ever have a signature collision problem (especially with Virtual Machines?)  This article is intended to help you understand what's going on and…
This tutorial will walk an individual through the process of installing the necessary services and then configuring a Windows Server 2012 system as an iSCSI target. To install the necessary roles, go to Server Manager, and select Add Roles and Featu…
This Micro Tutorial will teach you how to reformat your flash drive. Sometimes your flash drive may have issues carrying files so this will completely restore it to manufacturing settings. Make sure to backup all files before reformatting. This w…

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now