Search code examples
cwindows-7windows-7-x64cunit

Does anyone know of an easy way to programatically mount a file as a "disk" (FAT32) in Windows 7?


I have some automated test (using CUnit) which require a "disk-image"-file (raw copy of a disk) to be "mounted" in windows and explored. I have previously used a tool/library called "FileDisk-17" , but this doesn't seem to work on my Windows 7 (64bit).

Update I should point out, that changing the image-format (to say VHD) is not at option.

Any suggestions as to other (perhaps better supported) tools or libraries for mouting the file? The project is coded in ANSI C and compiled using MinGW.

Best regards!

Søren


Solution

  • Edit: Searching Bing for +filedisk 64 brings up a 64bit build of FileDisk, the utility you refer to:

    http://www.winimage.com/misc/filedisk64.htm

    And FileDisk-15 signed for 64bit here:

    http://www.acc.umu.se/~bosse/

    I can't vouch for it as I have never used it and am not familiar with the author.

    Alternatively:

    If you have a VHD, you can mount that in windows easily:

    http://technet.microsoft.com/en-us/library/cc708295(WS.10).aspx

    See also:

    http://www.petri.co.il/mounting-vhd-files-with-vhdmount.htm

    Since you have a raw DD image not a VHD, you will need to convert it first:

    http://www.bebits.com/app/4554

    Or qemu-img.exe can also do this:

    qemu-img.exe convert -f raw rawdisk.img -O vpc rawdisk.vhd

    Alternatively, you can create an empty VHD, and use DD to copy the raw image to the VHD, by opening the VHD as a raw device.