Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 167
  • Last Modified:

Expanding a Partition on OS drive within VM

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
April33
Asked:
April33
  • 9
  • 4
  • 3
  • +2
2 Solutions
 
CompProbSolvCommented:
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
 
April33Author Commented:
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
 
CompProbSolvCommented:
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
What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

 
CompProbSolvCommented:
You should be able to do a backup of the Data drive and restore it to the new VHD.
0
 
Senior IT System EngineerIT ProfessionalCommented:
Hi April,

You can use: http://gparted.org/ to expand the VM disk after the Hyper-V disk is extended.
0
 
April33Author Commented:
ohhhh, I understand what you are saying.  I will think on this and maybe try it tonight.
0
 
April33Author Commented:
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
 
Senior IT System EngineerIT ProfessionalCommented:
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
 
Senior IT System EngineerIT ProfessionalCommented:
0
 
PowerEdgeTechIT ConsultantCommented:
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
 
Philip ElderTechnical Architect - HA/Compute/StorageCommented:
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
 
April33Author Commented:
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
 
CompProbSolvCommented:
"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
 
April33Author Commented:
Thanks for your input CompProbSolv.
0
 
Philip ElderTechnical Architect - HA/Compute/StorageCommented:
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
 
April33Author Commented:
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
 
Philip ElderTechnical Architect - HA/Compute/StorageCommented:
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
 
April33Author Commented:
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
 
April33Author Commented:
Thanks!
0
 
April33Author Commented:
Thanks, I thought was closed a long time ago.  Sorry for the delay
0

Featured Post

Nothing ever in the clear!

This technical paper will help you implement VMware’s VM encryption as well as implement Veeam encryption which together will achieve the nothing ever in the clear goal. If a bad guy steals VMs, backups or traffic they get nothing.

  • 9
  • 4
  • 3
  • +2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now