On 4 March 2015 at 20:19, steve-ALUG@hst.me.uk wrote:
On 04/03/15 11:38, Mark Rogers wrote:
In particular, I'd like to understand the relationship between the C/H/S values that testdisk gave me for the start and end of the ext2 partition (start: 3/112/46), and the start/end values that fdisk subsequently gave me for the same partition (start: 55296)?
Good? Not really. A start? Perhaps: https://en.wikipedia.org/wiki/Cylinder-head-sector
Thanks!
It took some experimenting but I finally got there: LBA Address A = (c ⋅ Nheads + h) ⋅ Nsectors + (s − 1) In my case c/h/s are 3/112/46 as above, and some playing around got me Nheads=255, Nsectors=63, ie: (3 * 255 + 112) * 63 + (46-1) = 55296
At least that means that I can avoid writing partition tables to my image now; I can calculate the value to throw at "sudo losetup /dev/loop0 mydisk.dsk -o <value>" without the extra step.