bug-parted
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Bug report


From: Curtis Gedak
Subject: Re: Bug report
Date: Fri, 11 Feb 2011 13:30:48 -0700
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.13) Gecko/20101208 Thunderbird/3.1.7

Carlos,

Using the equations noted in the probe_partition_for_geom() method in the parted file libparted/labels/dos.c, I ran the calculations using the values from the MBR you provided.

Variable Description / Calculation Value
c Starting cylinder 1
h Starting head 0
s Starting sector – 1 = 0
a Starting LBA 8,064
C Ending cylinder 967
H Ending head 16
S Ending Sector – 1 = 16
A Ending LBA 7,806,975
a_ = a – s = 8,064
A_ = A – S = 7,806,959
denum = c * H – C * h = 16
a_ * H = 129,024
A_ * h = 0
cyl_size = (a_ * H – A_ * h) / denum = 8,064
cyl_size * denum = 129,024
a_ * H – A_ * h 129,024
head_size1 = (a_ – (c * cyl_size)) / h = n/a
head_size2 = (A_ – (C * cyl_size)) / H = 566
heads1 = cyl_size / head_size1 = n/a
heads2 = cyl_size / head_size2 = 14


Assuming my calculations are correct, a head_size of 566 sectors was determined. This is the number of sectors that would pass under a single disk head in a single rotation of the disk. Unfortunately this value is too large for the MBR specification (range is 1 to 63 sectors), and hence the partition table on your disk device is indeed invalid.


I agree with Brian C. Lane that it would better if parted/libparted were to cleanly indicate that the partition table was invalid as opposed to throwing a stack trace.


Regards,
Curtis Gedak
(Maintainer of GParted)


REFERENCES:
Libparted function probe_partition_for_geom() in file dos.c:
http://git.debian.org/?p=parted/parted.git;a=blob;f=libparted/labels/dos.c;h=578180bc6658d5f4e0812d5976a1499bc95c8d9b;hb=HEAD#l595

MBR Specification:
http://en.wikipedia.org/wiki/Master_boot_record




reply via email to

[Prev in Thread] Current Thread [Next in Thread]