Skip to contentSkip to conversation

qemu-img documentation

Qemu-devel Fabrice Bellard 7 participants 10 messages Nov 15, 2004 – Nov 17, 2004

lore
Share & tools
lore
#0 lore raw

Hi,

I added some documentation about qemu-img (it is updated on the web site too). You should read it. Packagers should use the CVS to include the qemu-img man page before the 0.6.2 release is out.

Fabrice.

#1 lore raw

Thats the problem, Fabrice..

I tried a fresh new virtual disks and new installation, and the problem occured. Not old virtual disks (pre 0.6.x)..

Thanks,
Hetz

Quoted 13 lines · Fabrice Bellard

Hi,

I added some documentation about qemu-img (it is updated on the web site too). You should read it. Packagers should use the CVS to include the qemu-img man page before the 0.6.2 release is out.

Fabrice.

_______________________________________________
Qemu-devel mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/qemu-devel

#2 lore raw
Quoted 4 lines · Hetz Ben Hamo

Thats the problem, Fabrice..

I tried a fresh new virtual disks and new installation, and the problem occured. Not old virtual disks (pre 0.6.x)..

Try my last fix. The important fix is in hw/ide.c:ide_guess_geometry(). I think the problem is that after reboot when installing ide_guess_geometry() returns an invalid geometry because the BIOS translated geometry is stored in the MBR instead of the real hard disk geometry.

For the desperate user, I added an option to manually specify the BIOS translation mode.

Fabrice.

#3 lore raw

---
Fabrice Bellard said the following on 11/16/2004 02:46 AM:

Quoted 3 lines

Try my last fix. The important fix is in hw/ide.c:ide_guess_geometry(). I think the problem is that after reboot when installing ide_guess_geometry() returns an invalid geometry because the BIOS translated geometry is stored in the MBR instead of the real hard disk geometry.

For the desperate user, I added an option to manually specify the BIOS translation mode.

With this fix now I can boot XP images newly created with 0.6.1 but I can't boot any longer my older images created with versions < 0.6.1 unless I specify hda geometry on the command line. Not a big deal though, I can run QEMU happily with that :)

Thanks for the great work, Fabrice!

Ciao,
Piero

#4 lore raw
Quoted 8 lines · ML

---
Fabrice Bellard said the following on 11/16/2004 02:46 AM:

Quoted 3 lines

Try my last fix. The important fix is in hw/ide.c:ide_guess_geometry(). I think the problem is that after reboot when installing ide_guess_geometry() returns an invalid geometry because the BIOS translated geometry is stored in the MBR instead of the real hard disk geometry.

For the desperate user, I added an option to manually specify the BIOS translation mode.

With this fix now I can boot XP images newly created with 0.6.1 but I can't boot any longer my older images created with versions < 0.6.1 unless I specify hda geometry on the command line.

This is going to cause lots of people to not be able to figure out how to use qemu anymore after an upgrade. For example, even if I knew that I needed to use the -hdachs option (pronounced "headaches"), how would I know what geometry numbers to give it? I'm not real good with this sort of thing, and I haven't found any docs yet that try to explain it from the perspective of a VM user. I know, I know, you can't have everything. But, I do think this will cause users repeated hdachs. :)

Signature · 1 line
Jason Brittain
#5 lore raw

Hi,

Quoted 13 lines · Jason Brittain
Quoted 9 lines · ML

---
Fabrice Bellard said the following on 11/16/2004 02:46 AM:

Quoted 3 lines

Try my last fix. The important fix is in hw/ide.c:ide_guess_geometry(). I think the problem is that after reboot when installing ide_guess_geometry() returns an invalid geometry because the BIOS translated geometry is stored in the MBR instead of the real hard disk geometry.

For the desperate user, I added an option to manually specify the BIOS translation mode.

With this fix now I can boot XP images newly created with 0.6.1 but I can't boot any longer my older images created with versions < 0.6.1 unless I specify hda geometry on the command line.

Quoted 9 lines

This is going to cause lots of people to not be able to figure out how to use qemu anymore after an upgrade. For example, even if I knew that I needed to use the -hdachs option (pronounced "headaches"), how would I know what geometry numbers to give it? I'm not real good with this sort of thing, and I haven't found any docs yet that try to explain it from the perspective of a VM user. I know, I know, you can't have everything. But, I do think this will cause users repeated hdachs. :)

I've used "fdisk c.img" and used the reported values as parameters for hdachs. This together with specifying the bios translating mode enabled me to boot old qemu images again.

So, I used:
"fdisk c.img"

Used the p command to print the partition table, which also shows the necessary disk information:
16 heads, 63 sectors/track, 4161cylinders

And started qemu:
"qemu -hda c.img -hdachs 4161,16,63,none"

Worked for me, but I don't know if fdisk is always right.

With friendly regards,
Takis

Signature · 8 lines
------------------------------------------------------------------------
Panagiotis Issaris
Katholieke Universiteit Leuven
Division Production Engineering,
Machine Design and Automation
Celestijnenlaan 300B              [email protected]
B-3001 Leuven Belgium                 http://www.mech.kuleuven.ac.be/pma
------------------------------------------------------------------------
#6 lore raw

Hi,

Quoted 9 lines · Panagiotis Issaris

So, I used:
"fdisk c.img"

Used the p command to print the partition table, which also shows the necessary disk information:
16 heads, 63 sectors/track, 4161cylinders

And started qemu:
"qemu -hda c.img -hdachs 4161,16,63,none"

IMHO this should definitely go into the documentation.

Ciao,
Dscho

#9 lore raw
In reply to Jason Brittain
Quoted 13 lines · Jason Brittain
Quoted 9 lines · ML

---
Fabrice Bellard said the following on 11/16/2004 02:46 AM:

Quoted 3 lines

Try my last fix. The important fix is in hw/ide.c:ide_guess_geometry(). I think the problem is that after reboot when installing ide_guess_geometry() returns an invalid geometry because the BIOS translated geometry is stored in the MBR instead of the real hard disk geometry.

For the desperate user, I added an option to manually specify the BIOS translation mode.

With this fix now I can boot XP images newly created with 0.6.1 but I can't boot any longer my older images created with versions < 0.6.1 unless I specify hda geometry on the command line.

Quoted 8 lines

This is going to cause lots of people to not be able to figure out how to use qemu anymore after an upgrade. For example, even if I knew that I needed to use the -hdachs option (pronounced "headaches"), how would I know what geometry numbers to give it? I'm not real good with this sort of thing, and I haven't found any docs yet that try to explain it from the perspective of a VM user. I know, I know, you can't have everything. But, I do think this will cause users repeated hdachs. :)

I can do the following:

- The default translation will be 'none', so that older images will be usable without problems (but not the ones created recently).

- there will be a separate option '-hdatranslation' to change the default translation to use 0.6.1 images and to use old OSes such as NT 4.0.

Fabrice.

#7 lore raw
In reply to Panagiotis Issaris

---
Panagiotis Issaris said the following on 11/16/2004 04:42 PM:

Quoted 11 lines

I've used "fdisk c.img" and used the reported values as parameters for hdachs. This together with specifying the bios translating mode enabled me to boot old qemu images again.

So, I used:
"fdisk c.img"

Used the p command to print the partition table, which also shows the necessary disk information:
16 heads, 63 sectors/track, 4161cylinders

Quoted 5 lines

And started qemu:
"qemu -hda c.img -hdachs 4161,16,63,none"

Worked for me, but I don't know if fdisk is always right.

On my newer XP disk images, fdisk seems to report correctly the number of heads and sectors but fails to get the number of cylinders and complains with a "you must set cylinders" message. On my older images, it doesn't seem to be able to guess anything.
Hdparm -g exits with a "Value too large for defined data type" message in both cases.

Ciao,
Piero

#8 lore raw
Quoted 3 lines · ML

Hdparm -g exits with a "Value too large for defined data type" message in both cases.

This is a known problem with 32-bit linux programs in general ... to handle files larger than 2GB, the linux program must use fseeko(), ftello(), etc and then it must have been compiled with large file support. This problem doesn't exist on 64-bit archs where fseek(), ftell(), etc return 64bit integers.

I have never used hdparm so I can't give any more info on it (tho I would expect that hdparm should have no problem with >2GB files as most actual hard disks are larger than this) but I have seen this problem with grep and file (my versions are quite old).

Signature · 2 lines
Infinite complexity begets infinite beauty.
Infinite precision begets infinite perfection.