Pass the u option to fdisk, and you can ignore the heads/cyl/spt info. 
The u option changes the display/entry units to sectors (each sector is 
512 bytes).  So with the u option the partition start is just 
starting_sector * 512, and you can pass this value directly as the -o 
offset value to losetup.

You can change the heads, cylinders, and spt in fdisk, but I have never 
seen a need to.

The fdisk man page has a good section on disk geometry.



Philip Prindeville wrote:
> So that it matches any partitioning/formatting done on the target's BIOS.
> 
> Also, if the geometry is C=992/H=64/S=63, and the starting cylinder is
> shown by fdisk as 100, then how do you calculate the -o argument to
> losetup to figure out the offset in bytes?
> 
> Thanks.
> 
> 
> On 12/02/2009 07:25 PM, Terry Markovich wrote:
>> As far as I know, the number of heads and sectors-per-track bximage 
>> reports is just a convenient fiction.  Cylinders * heads * spt * 
>> 512(block size) = image size.
>>
>> Why do you need that specific geometry?
>>
>> Terry
>>
>> Philip A. Prindeville wrote:
>>   
>>> I'm trying to "pre-image" Astlinux for a CF of a given size and geometry, 
>>> but when I do:
>>>
>>> ./bximage -q -hd -mode=flat -size=1953 runnix.img
>>>
>>> fdisk reports back to me that the partition table of the image runnix.img 
>>> is C=3968, H=16, S=63.
>>>
>>> I need it to be H=64, S=63 to be correct.
>>>
>>> Anyone know how to force "bximage" to a particular geometry?  I was looking 
>>> at the documentation:
>>>
>>> http://bochs.sourceforge.net/doc/docbook/user/using-bximage.html
>>>
>>> and that doesn't seem to be an option.
>>>
>>> Anyone?
>>>
>>> Thanks,
>>>
>>> -Philip
>>>     
> 
> 
> ------------------------------------------------------------------------------
> Join us December 9, 2009 for the Red Hat Virtual Experience,
> a free event focused on virtualization and cloud computing. 
> Attend in-depth sessions from your desk. Your couch. Anywhere.
> http://p.sf.net/sfu/redhat-sfdev2dev
> _______________________________________________
> Astlinux-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/astlinux-users
> 
> Donations to support AstLinux are graciously accepted via PayPal to 
> [email protected].
> 

------------------------------------------------------------------------------
Join us December 9, 2009 for the Red Hat Virtual Experience,
a free event focused on virtualization and cloud computing. 
Attend in-depth sessions from your desk. Your couch. Anywhere.
http://p.sf.net/sfu/redhat-sfdev2dev
_______________________________________________
Astlinux-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/astlinux-users

Donations to support AstLinux are graciously accepted via PayPal to 
[email protected].

Reply via email to