1

I have 100 GB of data that contain a lot of folders and files.

Is there a way to create a VHD file from these folders and files?

devices
  • 29

1 Answers1

2

You would first create a VHD image of ~100GB+ and then mount it and copy the data files over onto it. An empty VHD should take up relatively little disk space IIRC but you have to make sure it isn't preallocating it if that is what you want. Why do you want to store them in a VHD anyways? Not seeing the practical use myself though that doesn't mean there isn't one.

http://technet.microsoft.com/en-us/sysinternals/ee656415.aspx could be used to create the file from selected partitions assuming you have all your data on a partition. ie if you have only one partition that means the OS is on there as well and you wouldn't want to clone that.

Enigma
  • 3,391
  • thank you @Enigma, But in my case i want to create the VHD file from a part of my partition only (from specific folders and files only) – devices May 14 '14 at 14:33
  • 1
    AFAIK that direct route isn't available. You would have to do what I mention above and or split your current partition into two to accomplish your goal. You could use a Gparted boot disk to split the partition into primary and data. – Enigma May 14 '14 at 14:40
  • But if i split my current partition into two, i am forced to copy the target folders to the new partition before converting it to VHD, so while i do this copy i has a corruption because of the huge number of folders (about millions of folders) (i have tried to use software like XCOPY but i have the same problem) so i want now to convert the target folders to a VHD file directly. Any Help! – devices May 14 '14 at 14:49
  • You may want to start a new question with regard to avoiding this potential corruption as that seems to be the problem here. If you have a spare drive large enough you could simply convert the whole thing to a VHD including system files. Have you tried copying parts at a time and not everything at once? How is a VHD going to help you here? – Enigma May 14 '14 at 15:07
  • I tried copying parts at a time and all is good but it take more more time (about couple of days !). If i can convert the directories to one VHD file the copying of this file take ~3 to 4 hours – devices May 14 '14 at 15:29
  • @devices - It would still takes 3-4 days it just would be automatic but you assume the corruption problem wouldn't be a problem ( it would be ) because the files are located on bad sectors. This is evident by the fact when you attempt to copy those files, the resulting file is corrupted, because the file is located on both good and bad sectors. – Ramhound May 14 '14 at 16:01
  • As Ramhound suggests, it would be a good idea to run a ckhdsk -R when you get a chance - that may help with the corruption issues though more details on the specifics of what those issues are would be helpful. – Enigma May 14 '14 at 16:08
  • @Ramhound - However if i have or i haven't bad sectors in my HDD the creation of VHD file resolve the problem so have you any ideas about creation of a VHD file from folders? – devices May 14 '14 at 16:11
  • The software that would theoretically accomplish this would more or less emulate the actions I already layed out. It would create a vhd file and then copy the data over onto the new file system. There is no way around that and no way to convert them in place as you may be thinking of. The partition cloning option does the same thing but skips the step of formating a new file system on the VHD and simply mirrors the existing partitions file system. – Enigma May 14 '14 at 16:13
  • @devices - What your asking for still requires the files be read which is the entire problem. – Ramhound May 14 '14 at 16:52