Solved

Expanding a Partition on OS drive within VM

Posted on 2016-08-29
20
88 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
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

How to update Firmware and Bios in Dell Equalogic PS6000 Arrays and Hard Disks firmware update.
This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
This video teaches viewers how to encrypt an external drive that requires a password to read and edit the drive. All tasks are done in Disk Utility. Plug in the external drive you wish to encrypt: Make sure all previous data on the drive has been …
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…

919 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

12 Experts available now in Live!

Get 1:1 Help Now