2

First timer here. I've searched around here, but haven't found a question like the one I have. Apologies if I missed it.

The challenge at hand: produce a "raw disk image file" from a given WIM file. What I am pursuing so far is to use imagex.exe with the "/apply" operation to take the WIM and lay it down in a directory on a server. That seems to produce all the necessary "stuff" I need in that directory.

How would I take that content and produce a "raw disk image file"? I'm told the definition of "raw disk image file" is a block-by-block copy of the disk image, which I hope is the output of the "imagex.exe /apply" command I use currently, but stored in a single file I can hand back to another system in our solution.

imagex.exe /apply image.wim 1 R:\WimImagePoint

I would like to take the contents of R:\WimImagePoint and produce the elusive (to me) "raw disk image file". ISO is not what they want, nor is anything requiring winPE.

Any pointers? External utilities' references are welcome. Would like to avoid unmanaged code solutions as much as possible, but will entertain them if that's the only route.

Also, I am not married to the idea of imagex /apply as the starting point, it's just the comfort zone so far.

7
  • funny how you don't feel the need to explain what a "wmi file" is, while you don't know what a raw image is... for me, the opposite would be the case. now, it appears that wim comes from some kind of backup/snapshot program...? does it do it's business on file-level or disk/filesystem level? (your /apply operation appears to extract a set of files into a directory?) now, to create a raw image from a directory of files, you would need a tool that can make an (empty) image accessible as a drive, so you can copy to it, but i doubt that that's what "they" want...
    – r00t
    Commented Dec 20, 2010 at 20:47
  • if you have win7 or w2k8r2 use DISM. Are you trying to create an imbedded image or are you trying to do something like wim2vhd?
    – tony roth
    Commented Dec 20, 2010 at 22:06
  • @r00t: Not using "wmi file". WMI is an entirely different topic. The WIM files are maintained in a repository in a Linux/Python/Java world. "They" (the Linux/Python/Java part of this solution) want to send me the WIM file and have me translate that into a raw disk file -- and, yes, I am still not quite sure what that is -- still getting info from "them". :)
    – joebalt
    Commented Dec 20, 2010 at 23:54
  • @tr: not trying to create an embedded image. Just looking to produce this single file that is a block-by-block representation of the disk as it should be to boot. Ultimate destination is to be used in the production of a VMWare vmdk file.
    – joebalt
    Commented Dec 20, 2010 at 23:57
  • also @tr: I am using 2008 R2 with the WAIK installed. What part of DISM do you suggest I use to accomplish the task?
    – joebalt
    Commented Dec 21, 2010 at 1:46

2 Answers 2

2

Here's what I wound up doing (submitting answer to my own question to help the greater good, I hope):

Use diskpart.exe with the following commands in a text file:

create vdisk file=E:\Temp\RawDisk\2003R2_amd64\2003_R2_amd64.vhd maximum=10000 type=expandable
select vdisk file=E:\Temp\RawDisk\2003R2_amd64\2003_R2_amd64.vhd
attach vdisk
create partition primary
assign letter=v
format fs=ntfs quick label=vhd
active
exit

Then, I used the /apply option off of imagex.exe to apply the WIM file to this logical volume:

imagex.exe /apply 2003_R2_amd64.WIM 1 V:\

Then, used either bootsect.exe (server 2003) or bcdboot.exe (server 2008 and 2008 R2). This example is for 2003:

"C:\Program Files\Windows AIK\Tools\PETools\amd64\bootsect.exe" /NT52 V:

Then, ran diskpart.exe again with these commands in a text file:

select vdisk file=E:\Temp\RawDisk\2003R2_amd64\2003_R2_amd64.vhd
detach vdisk

Then, we ran some homegrown VHD to VMDK code and all is well. I suspect you can take this VHD and convert it using standard tools as well.

Hope this helps the greater good.

1

You can make a block-for-block copy using dd for Windows, but I don't think that's what you need here. I'm guessing that a "raw" file would include all the file system information, e.g. the FAT32 file allocation table, and the WIM won't have that.

Try using wim2vhd then convert vhd2raw using a tool that can do that. Sounds like maybe VBoxConvert or qemu-img can help with the second step.

EDIT

By the looks of these screenshots, StarWind V2V Converter might be the easiest way for the second step.

4
  • Mikel, if I had 15 reputation, I would +1 this answer. :) Not marking it as my final answer due to the V2V software's performance, though. I took a 1.7GB VHD (expandable to 30GB), and the V2V software created a .IMG file that was 30GB in size -- so, it does not appear to compensate for unused disk space in an expandable VHD configuration.
    – joebalt
    Commented Dec 21, 2010 at 13:48
  • Still searching for a command line utility, or source code to take me from the WIM straight to the raw disk file.
    – joebalt
    Commented Dec 21, 2010 at 13:49
  • Due to transfer over the wire of the resultant disk image file, not compensating for actual space used is an issue.
    – joebalt
    Commented Dec 21, 2010 at 14:04
  • well you could write your own if you had the vmdk sdk which I think is freely available. I'd get the source code from the wim2vhd and pick the wim components from it and then the vmdk sdk components for its respective use..
    – tony roth
    Commented Dec 22, 2010 at 14:57

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .