Current-Users archive

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

Re: wd1: mbr partition exceeds disk size



On Thu, Apr 14, 2011 at 09:42:46PM +0200, Michael van Elst wrote:
> On Thu, Apr 14, 2011 at 09:29:54AM -0500, Eric Haszlakiewicz wrote:
> > So perhaps a fix/workaround is to change the start of the MBR to be 0, not 
> > 1.
> > <         mbr->mbr_part[0].part_start_lo = htole16(1);
> > >         mbr->mbr_part[0].part_start_lo = htole16(0);
> 
> Wouldn't help if you get a protective MBR written by another system
> that follows the standard.

Oh, there's a standard that says the protective MBR is supposed to start at
sector 1?  I didn't know that.  

hmm... it seems to be chapter 11.2.2.4 of Intel's EFI spec [*1], which says
  "Starting LBA" ... "Must be 1 by definition."
but it also says the size is "0xFFFFFFFF if this value overflows."
so perhaps it would make sense to have the warning in subr_disk_mbr.c
explicitly check for that:

/* Check end of partition is inside disk limits */
if (le32toh(dp->mbrp_size) != 0xffffffff &&
    (uint64_t)ext_base + le32toh(dp->mbrp_start) +
    le32toh(dp->mbrp_size) > a->lp->d_secperunit) {
        /* This mbr doesn't look good.... */
        a->msg = "mbr partition exceeds disk size";

eric

[*1] http://www.intel.com/technology/efi/main_specification.htm


Home | Main Index | Thread Index | Old Index