有谁知道以编程方式将文件安装为“磁盘”的简单方法吗? (FAT32) 在 Windows 7 中?

发布于 2024-10-22 17:20:35 字数 331 浏览 5 评论 0原文

我有一些自动化测试(使用 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

我的鱼塘能养鲲 2024-10-29 17:20:35

编辑: 在 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.

谁的年少不轻狂 2024-10-29 17:20:35

我最近遇到了这个问题,发现 ImDisk 是一个非常好的解决方案:

  • 免费,具有可用的源代码和非常灵活的开源许可证
  • 简单的设置(我已经看到 filedisk64(在接受的答案中)被描述为具有“技术”设置)
  • 简单的 GUI 和命令行访问
  • 在 Windows 7 64 位上工作
  • 似乎很高兴安装 Windows 识别的任何类型的文件系统(在我的例子中,FAT16)
  • 适用于包含以下内容的文件
    • 原始分区
    • 整个原始磁盘(即包括 MBR 和一个或多个分区;可以选择要挂载的分区)
    • VHD 文件(事实证明,这些文件只是原始分区或附​​加了 512 字节页脚的磁盘!)
  • 还可以创建 RAM 驱动器——最初是空的,或者基于现有的磁盘映像! (我必须说非常整洁!)

我在尝试卸载驱动器时确实遇到了一些小问题。我无法从 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:

  • Free, with source available and a very flexible open source license
  • Trivial setup (I have seen filedisk64 (in the accepted answer) described as having a "technical" setup)
  • Straightforward GUI and command-line access
  • Worked on Windows 7 64-bit
  • Seems to happily mount any kind of filesystem recognised by Windows (in my case, FAT16)
  • Works with files containing
    • Raw partitions
    • Entire raw disks (i.e. including the MBR and one or more partitions; which partition to mount can be selected)
    • VHD files (which it turns out are just raw partitions or disks with a 512-byte footer appended!)
  • Also can create RAM drives -- either initially empty or based on an existing disk image! (Very neat I must say!)

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; however imdisk -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, an imdisk -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 of imdisk -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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文