Hi, I want to create a 80M hard disk image.
Using bximage, I got 83607552 bytes, and qemu-img give me 83886080 bytes.
Looks like 83886080B = 80*1024*1024 is right. But why they are not equal? and how to translate 83886080B to numbers for .bxrc file?
Thanks very much!
image by qemu-img and bximage has different size
- brain
- Member

- Posts: 247
- Joined: Thu Nov 05, 2009 5:04 pm
- Location: UK
- Discord: https://discord.gg/brainbox
- GitHub: https://github.com/braindigitalis
- Contact:
Re: image by qemu-img and bximage has different size
Well ive just read the source of bximage and it should create raw sectors. So in short both should be about the same size, are you sure it didnt error and terminate early?
Re: image by qemu-img and bximage has different size
Thanks for help.
I've checked again, and now I'm sure the difference is because bochs will round down the size to a multiply of (16*63*512) bytes.
In my case, it is (16*63*512)*162 = 83607552. And (16*63*512)*163 = 84123648 is larger than 80M=83886080B already.
Tried with different sizes, it always produced a line like:
ata0-master: type=disk, path="x.img", mode=flat, cylinders=162, heads=16, spt=63
And always just the cylinders value will be changed.
BTW, I now know how to get the same value in qemu-img now with:
$ qemu-img create x.img $((162*63*16*512))
I've checked again, and now I'm sure the difference is because bochs will round down the size to a multiply of (16*63*512) bytes.
In my case, it is (16*63*512)*162 = 83607552. And (16*63*512)*163 = 84123648 is larger than 80M=83886080B already.
Tried with different sizes, it always produced a line like:
ata0-master: type=disk, path="x.img", mode=flat, cylinders=162, heads=16, spt=63
And always just the cylinders value will be changed.
BTW, I now know how to get the same value in qemu-img now with:
$ qemu-img create x.img $((162*63*16*512))
Re: image by qemu-img and bximage has different size
That's because XXX*16*63 (where XXX is the number of tracks) is the physical geometry used in ATA interface.chunis wrote:In my case, it is (16*63*512)*162 = 83607552. And (16*63*512)*163 = 84123648 is larger than 80M=83886080B already.
Tried with different sizes, it always produced a line like:
ata0-master: type=disk, path="x.img", mode=flat, cylinders=162, heads=16, spt=63