有谁知道以编程方式将文件安装为“磁盘”的简单方法吗? (FAT32) 在 Windows 7 中?
我有一些自动化测试(使用 CUnit),需要在 Windows 中“安装”并探索“磁盘映像”文件(磁盘的原始副本)。我以前使用过一个名为 "FileDisk-17" 的工具/库,但这并不'似乎无法在我的 Windows 7(64 位)上运行。
更新 我应该指出,无法选择更改图像格式(即 VHD)。
关于其他(可能更好支持)用于安装文件的工具或库有什么建议吗?该项目采用 ANSI C 编码并使用 MinGW 编译。
此致!
索伦
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
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
编辑: 在 Bing 中搜索
+filedisk 64
将显示 64 位版本的 FileDisk,您可以参考该实用程序:http://www.winimage.com/misc/filedisk64.htm
此处的 FileDisk-15 已签名为 64 位:
http://www.acc.umu.se/~bosse/
我无法保证它,因为我从未使用过它而且对作者并不熟悉。
或者:
如果您有 VHD,则可以轻松地将其安装在 Windows 中:
http://technet.microsoft.com/en-us/library/cc708295(WS.10).aspx
另请参阅:
http://www.petri.co.il/mounting-vhd-files-with-vhdmount.htm
由于您有原始 DD 映像而不是 VHD,因此您需要先将其转换:
http:// www.bebits.com/app/4554
或者 qemu-img.exe 也可以执行此操作:
qemu-img.exe Convert -f raw rawdisk.img -O vpc rawdisk.vhd
或者,您可以创建一个空的VHD,并使用DD将原始映像复制到VHD,方法是将VHD作为原始设备打开。
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.
我最近遇到了这个问题,发现 ImDisk 是一个非常好的解决方案:
我在尝试卸载驱动器时确实遇到了一些小问题。我无法从 GUI 右键单击上下文菜单卸载驱动器,因为该驱动器似乎正在被 explorer.exe 进程“使用”。关闭资源管理器窗口并使用
imdisk -d -m X:
也不起作用;但是imdisk -D -m X:
(-D
“强制”卸载,无论这意味着什么)确实如此。即使驱动器在打开的资源管理器窗口中可见,此方法也有效,不会产生任何问题。但是,即使驱动器似乎已完全卸载,列出所有可用设备的imdisk -l
仍会报告\Device\ImDisk0
存在,并且如果您重新安装驱动器稍后,该文件和\Device\ImDisk1
都将出现在imdisk -l
的输出中(依此类推,有更多的卸载/重新安装周期)。当我尝试几次卸载/重新安装周期时,实际使用已安装的驱动器并没有产生任何问题,但理论上如果您在重新启动之间执行多次,可能会出现问题。ImDisk 对于从一台古老的 486 机器传输带有一个 FAT16 DOS 分区的 1.5Gb 磁盘驱动器的内容而言非常有用。
I faced this problem recently and found ImDisk to be an extremely nice solution:
I did encounter minor issues trying to unmount drives. I was unable to unmount a drive from the GUI right-click context menu as the drive appeared to be "in use" by the explorer.exe process. Closing the Explorer window and using
imdisk -d -m X:
also didn't work; howeverimdisk -D -m X:
(-D
"forces" an unmount, whatever that means) did. This worked even if the drive was visible in an open Explorer window, without appearing to create any problems. However even after the drive appeared to have fully unmounted, animdisk -l
to list all available devices would still report that\Device\ImDisk0
exists, and if you remount the drive later, both that and\Device\ImDisk1
will appear in the output ofimdisk -l
(and so on with more unmount/remount cycles). This didn't create any problems with actually using the mounted drive when I tried a few unmount/remount cycles, though it theoretically might if you perform this many times between reboots.ImDisk was invaluable for transferring the contents of a 1.5Gb disk drive with one FAT16 DOS partition from an ancient 486 machine.