-1

I need to mount a VHD file at grub2 command prompt.

I tries using "loopback" command as shown below:

grub > insmod ntfs
grub > insmod ntldr
grub > loopback loop (hd0,1)/test.vhd
grub > ls (loop)/
error: unknown filesystem

I tried both "static" and "dynamic" vhd and both VHD file had ntfs partitioned data.

I guess VHD files have some header data which makes the filesystem not recognizable after "loopback" mount. I am able to mount and access "iso" files using same set of commands.

Is my guess correct? If so, is there a way to overcome this issue?

Fazlin
  • 2,285
  • 17
  • 29

3 Answers3

0

Well, your guess is half right:

Whilst VHD supports a linear "fixed" storage model, which actually is just the raw data as it would be stored on a "real" hard drive, followed by a VHD footer, this is most probably not usually the case; VHD supports dynamically resizing images, which of course aren't linear internally, so you can't simply boot into that.

Marcus Müller
  • 34,677
  • 4
  • 53
  • 94
0

I was finally able to get the data from the loop mounted data with following change in the above pasted grub command.

grub > insmod ntfs
grub > loopback loop (hd0,1)/test.vhd
grub > ls (loop,1)/

The file "test.vhd" was a single partitioned VHD file.

NOTE: Only "fixed" or "static" model VHDs work. I could not get it working with "dynamic" VHD (as suggested by @Marcus Müller )

Thanks for the help. Hope this helps somebody.

Fazlin
  • 2,285
  • 17
  • 29
-1

To use VHD disks on grub2 need:

insmod part_msdos
insmod ntfs
loopback loop /point/where/disk.vhd tdisk=VHD
ls (loop,msdos1)/
Michael Petch
  • 46,082
  • 8
  • 107
  • 198
Xander
  • 1