Skip to contentSkip to conversation

disk images & driver geometry

Qemu-devel Christopher Friedt 3 participants 6 messages Aug 9, 2007 – Aug 31, 2007

lore
Share & tools
lore
#0 lore raw

Hi everyone,

has there been any work done in the last few months towards hard disk geometry, so that partition tables / mbr's in raw hard disk files can be stored for later use?

That's something that would be tremendously useful with the -hda option, so that one could use a file for a virtual disk and expect qemu to recognize the partition information from it. Usually if one does a typical install with a linux distro, the linux install will format the main hard disk to have 3 partitions (boot,root,swap), but if it's just a file then that partition / mbr info isn't really recognized by qemu.

I've been out of the loop w/ what's happening on the bleeding edge with qemu for a few months, so I thought I'd just ask here.

~/Chris

#1 lore raw

sorry, that subject should have read 'drive geometry'

Quoted 13 lines · Christopher Friedt

Hi everyone,

has there been any work done in the last few months towards hard disk geometry, so that partition tables / mbr's in raw hard disk files can be stored for later use?

That's something that would be tremendously useful with the -hda option, so that one could use a file for a virtual disk and expect qemu to recognize the partition information from it. Usually if one does a typical install with a linux distro, the linux install will format the main hard disk to have 3 partitions (boot,root,swap), but if it's just a file then that partition / mbr info isn't really recognized by qemu.

I've been out of the loop w/ what's happening on the bleeding edge with qemu for a few months, so I thought I'd just ask here.

~/Chris

#2 lore raw
In reply to Christopher Friedt
Quoted 5 lines · Christopher Friedt

Hi everyone,

has there been any work done in the last few months towards hard disk geometry, so that partition tables / mbr's in raw hard disk files can be stored for later use?

That's something that would be tremendously useful with the -hda option, so that one could use a file for a virtual disk and expect qemu to recognize the partition information from it. Usually if one does a typical install with a linux distro, the linux install will format the main hard disk to have 3 partitions (boot,root,swap), but if it's just a file then that partition / mbr info isn't really recognized by qemu.

I have no idea what you're talking about. QEMU doesn't care whether you use a physical disk or a file. It handles geometry the same way.

Is there a concrete example that doesn't work that you think should?

Regards,

Anthony Liguori

Quoted 6 lines

I've been out of the loop w/ what's happening on the bleeding edge with qemu for a few months, so I thought I'd just ask here.

~/Chris

#3 lore raw
Quoted 3 lines · Anthony Liguori

I have no idea what you're talking about. QEMU doesn't care whether you use a physical disk or a file. It handles geometry the same way.

Is there a concrete example that doesn't work that you think should?

Yes, a simple example is running CentOS after a typical install from a hard disk image.

If Qemu is started with the installation cdrom (-cdrom CentOS-1of4*.iso) the installation creates several partitions on the virtual disk, including /boot, and a logical disk containing /. The first 512 Bytes of the disk image are assumed to be the MBR of the disk, which is where the installation will write the boot loader.

After installation, qemu is started with

qemu -hda centos.img -boot c

and it hangs after saying 'booting from hard disk'

If anyone knows a way to work around this, please don't hesitate to offer a suggestion.

~/Chris

#4 lore raw
Quoted 15 lines · Christopher Friedt
Quoted 4 lines · Anthony Liguori

I have no idea what you're talking about. QEMU doesn't care whether you use a physical disk or a file. It handles geometry the same way.

Is there a concrete example that doesn't work that you think should?

Yes, a simple example is running CentOS after a typical install from a hard disk image.

If Qemu is started with the installation cdrom (-cdrom CentOS-1of4*.iso) the installation creates several partitions on the virtual disk, including /boot, and a logical disk containing /. The first 512 Bytes of the disk image are assumed to be the MBR of the disk, which is where the installation will write the boot loader.

Quoted 3 lines

After installation, qemu is started with

qemu -hda centos.img -boot c

That scenario works just fine for me when I try it with either RHEL-5 or Fedora Core 6 / 7. QEMU reads the MBR from the disk I pass with -hda, whether that's backed by a physical device, or a file backed disk & will succesfully boot the OS. I just followed the recommended partitioning scheme that RHEL-5 installer suggests making no changes.

Dan.

Signature · 4 lines
|=- Red Hat, Engineering, Emerging Technologies, Boston.  +1 978 392 2496 -=|
|=-           Perl modules: http://search.cpan.org/~danberr/              -=|
|=-               Projects: http://freshmeat.net/~danielpb/               -=|
|=-  GnuPG: 7D3B9505   F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505  -=| 
#5 lore raw
In reply to Christopher Friedt
Quoted 15 lines · Christopher Friedt
Quoted 4 lines · Anthony Liguori

I have no idea what you're talking about. QEMU doesn't care whether you use a physical disk or a file. It handles geometry the same way.

Is there a concrete example that doesn't work that you think should?

Yes, a simple example is running CentOS after a typical install from a hard disk image.

If Qemu is started with the installation cdrom (-cdrom CentOS-1of4*.iso) the installation creates several partitions on the virtual disk, including /boot, and a logical disk containing /. The first 512 Bytes of the disk image are assumed to be the MBR of the disk, which is where the installation will write the boot loader.

Quoted 5 lines

After installation, qemu is started with

qemu -hda centos.img -boot c

and it hangs after saying 'booting from hard disk'

QEMU does the Right Thing in this case. If you're having trouble booting, it's not because of disk geometry.

Please post a link to the exact location of your install disk, the command you used to create the disk, the command lines you're using to install and launch, and the version of QEMU.

Regards,

Anthony Liguori

Quoted 6 lines

If anyone knows a way to work around this, please don't hesitate to offer a suggestion.

~/Chris