Split volumes on a VHD?
Hi,

I have one 300Gb VHD file containing C: (O/S 100Gb) and D: (data 200Gb). How can I extract
each of those volumes so that they reside on individual VHD's?

So, i want to go from this:

1 x 300Gb VHD C: (O/S 100Gb) and D: (data 200Gb)

to 

1 x 100Gb VHD C: (O/S)
1 x 200Gb VHD D: (data)

Is there a tool to do this or via powershell?

Thanks
February 17th, 2015 4:31am

Hi,

You can try to use "disk2vhd" in a virtual machine.

Regards, Terry | My Blog: http://tls1.cc
This posting is provided AS IS with no warranties, and confers no rights.

Free Windows Admin Tool Kit Click here and download it now
February 17th, 2015 7:51am

Hi,

You can try to use "disk2vhd" in a virtual machine.

Regards, Terry | My Blog: http://tls1.cc
This posting is provided AS IS with no warranties, and confers no rights.

February 17th, 2015 12:45pm

Thanks

Are there any other ways to do this, as DSK2VHD does not always work?


Free Windows Admin Tool Kit Click here and download it now
February 18th, 2015 3:33am

Hi D.Brenner,

Would it be possible to just mount the 300GB disk, create a new .vhd for the data partition, mount the new .vhd and then robocopy the content from the old data partition to the new vhd. 

Then delete the old data partition and extend the system partition to take up the whole of the old .vhd or shrink the old .vhd to just be the side of the system drive. This would leave you with two .vhd.

Kind regards Michael

 

February 18th, 2015 9:57am

Hi D.Brenner,

Would it be possible to just mount the 300GB disk, create a new .vhd for the data partition, mount the new .vhd and then robocopy the content from the old data partition to the new vhd. 

Then delete the old data partition and extend the system partition to take up the whole of the old .vhd or shrink the old .vhd to just be the side of the system drive. This would leave you with two .vhd.

Kind regards Michael

 

Free Windows Admin Tool Kit Click here and download it now
February 18th, 2015 2:52pm

Hi D.Brenner,

>>Are there any other ways to do this, as DSK2VHD does not always work?

In Disk2VHD , you can just select the partition D then "copy" D drive to a new VHD which contains the partition information of original VHD , you can shoutdown the VM then mount the original vhd then delete the D partition also mount the new VHD then delete C partition .

After this you will get two disk contain C and D partition .

In addition , you can try to mount the VM's VHD file to host , then create a new vhd through hyper-v manager , during create new vhd wizard you can select copy from the source disk , then please follow the steps above to delete the partition you do not want .

(before this please backup that VM first )

Michael's suggestion is easy and useful .

Best Regards,

El

February 18th, 2015 7:14pm

Hi D.Brenner,

Elton_Ji - thanks for the comment. 

One extra thing to add is that its also possible to create a .vhd file from disk manager so if not on the Hyper-v host and on another member server or windows client, its still possible to mount the source vhd and create a new. 

Kind regards Michael 

Free Windows Admin Tool Kit Click here and download it now
February 19th, 2015 3:36am

Hi,

Thanks for your updates. The issues that I have encountered with Disk2VHD are
to do with the exporting of multiple partitions located on logical/physical drive.

In some situations, for reasons that I have not yet figured out, when using Disk2VHD,
if you have 2 volumes (as mentioned above) such as C and D, even if you only select one
volume to be exported to a VHD, Disk2VHD still copies the space that the 2nd volume (D)
ocupys as part of the export. But, this does not always happen. Sometimes Disk2VHD exports
just the partition you want exported. 

This is the reason that I was looking for an alternative to Disk2VHD, such as some other 
product or maybe powershell.
March 2nd, 2015 10:05am

Robocopy was mentioned.  Create another VHD and robocopy the contents of the D: partition to the new VHD.  Validate that the information is correct.  Delete the D: partition on the original VHD.  Shrink the original VHD that contained both C: and D: partitions to be the size you want it.
Free Windows Admin Tool Kit Click here and download it now
March 2nd, 2015 7:03pm

Thanks for the ideas. I am suprised that there are no tools that you can use to do this sort of maintenance on a VHD, as sometimes you don't have the option of moving data and creating new VHD's etc as suggested (thinking of things like Exch/SQL/3rd party stuff that could be installed on these partitions). 
March 3rd, 2015 12:23pm

Robocopy is a tool.  :)  How would you do that with a physical disk?  I would do it pretty much the same way as what I suggest for the VHD.  I don't know what sort of 'special sauce' you expect from a VHD, but just think of them as physical disks when it comes to tools.
Free Windows Admin Tool Kit Click here and download it now
March 3rd, 2015 5:50pm

Yes Robocopy is great, and would does work as suggested, but what we are trying to do in this scenario is at a lower level :)

The aim is to split a 1 x 300Gb VHD C: (O/S 100Gb) and D: (data 200Gb)
in to 1 x 100Gb VHD C: (O/S) and 1 x 200Gb VHD D: (data) while keeping
the data within each 100% intact and as it was, so that the Server sees no
change (no data moved, databases reinstalled etc). 

So what we are looking for is something that can do what SCVMM does, but is inexpensive
or free (eg DSK2VHD). Maybe there is not anything

March 4th, 2015 11:13am

The end result, no matter the tool, is exactly the same.  If you want to end up with two distinct virtual hard drives, I don't see that SCVMM or DSK2VHD presents you with anything different than robocopy.

Or, you can set up an evaluation copy of SCVMM and try it there.  But it will take longer to set that up than to perform the robocopy steps.  In either case, you end up with two virtual hard disks that need to be assigned to the same VM.

None of the methods should affect any of the installed software because everything is still pointing to C: and D:.  (Of course the typical caveat applies of try it in a lab unless you want to make your production environment your lab).

Free Windows Admin Tool Kit Click here and download it now
March 4th, 2015 8:08pm

Hi, yes there are lots of ways to do this, but in this instance we are trying to find a way to do it as per: 

The aim is to split a 1 x 300Gb VHD C: (O/S 100Gb) and D: (data 200Gb)
in to 1 x 100Gb VHD C: (O/S) and 1 x 200Gb VHD D: (data) while keeping
the data within each 100% intact and as it was, so that the Server sees no
change (no data moved, databases reinstalled etc). 

To clarify on a key issue here, the data MUST stay in the same physical location on the disk(VHD), hence copying data is not an option

In this instance, we don't want to copy data or create new VHD's. We just need (for business reasons), to split one VHD in to 2 directly. Maybe there just is no way to do this...

March 11th, 2015 1:07pm

The aim is to split a 1 x 300Gb VHD C: (O/S 100Gb) and D: (data 200Gb)
in to 1 x 100Gb VHD C: (O/S) and 1 x 200Gb VHD D:

In this instance, we don't want to copy data or create new VHD's. We just need (for business reasons), to split one VHD in to 2 directly

Your two statements contradict each other.  First you say you want to have two separate VHDs.  They you say you do not want to create new VHDs.  It is completely impossible to have two VHDs from one VHD.  How would you accomplish that with a physical disk?  VHDs are not magic.  They follow the same rules as the physical disks.  If I have a physical disk with two partitions and I want to separate that into two separate disks, I have to copy some data.  That can be a copy or a backup, but the data has to be moved from one disk to another.  The same applies to virtual disks.

the data within each 100% intact and as it was, so that the Server sees no
change (no data moved, databases reinstalled etc). 

The data will remain intact if proper tools are used to move the data.  I simply do not understand how you can expect to create a second virtual hard disk to contain the data from another virtual hard disk without moving the data to the second disk.  If done properly the server will see no change.

Free Windows Admin Tool Kit Click here and download it now
March 11th, 2015 2:41pm

We have managed to do this using the latest copy of Disk2VHD. So, it is actually possible, without having to copy files etc. Thanks for your help Michael.
  • Edited by D.Brenner Thursday, March 12, 2015 11:10 AM
March 11th, 2015 2:59pm

Hi, care to explain how ?

I have been doing robocopy splitting VHD's for ages.

Free Windows Admin Tool Kit Click here and download it now
July 17th, 2015 12:26pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics