grub-devel
[Top][All Lists]
Advanced

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

Re: Improperly nested partitions, help needed!


From: Grégoire Sutre
Subject: Re: Improperly nested partitions, help needed!
Date: Tue, 21 Sep 2010 15:59:07 +0200
User-agent: Mozilla/5.0 (X11; U; NetBSD i386; en-US; rv:1.9.1.11) Gecko/20100723 Lightning/1.0b2pre Shredder/3.0.6

On 09/21/2010 09:31, Svante Signell wrote:

When installing a new kernel or a new version of grub I get a
warning that /dev/sda1 (windows rescue) and /dev/sda3 (linux root /)
are improperly nested: /usr/sbin/grub-probe: warn: Discarding
improperly nested partition (hd1,msdos3,msdos1).

Assuming that hd1 is sda, this means that (1) grub-probe detects an
MSDOS partition table T in the first sector of sda3, and (2) the first
partition descriptor in T describes a partition that ends after sda3.

It does not say anything about sda1, which is (hd1,msdos1).

Correct detection of MSDOS partition tables is not obvious.  If I read
the code correctly, grub-probe detects an MSDOS partition table (at the
beggining of a disk/partition) if (a) the sector ends with the correct
signature and (b) the first byte of each partition descriptor contains
a valid boot flag.

Actually, for (b), the check that it's a valid boot flag is:

      for (i = 0; i < 4; i++)
        if (mbr.entries[i].flag & 0x7f)
          return grub_error (GRUB_ERR_BAD_PART_TABLE, "bad boot flag");

Couldn't this be made stronger, with:

      for (i = 0; i < 4; i++)
        if (mbr.entries[i].flag != 0x00 && mbr.entries[i].flag != 0x80)
          return grub_error (GRUB_ERR_BAD_PART_TABLE, "bad boot flag");

?

How to resolve this problem?

It's likely that the first sector of sda3 contains useless, leftover
data.  If that's the case (I mean if you are absolutely sure that it's
the case) then you could simply fill this sector with zeroes.

Additionally, does the same warning have to be repeated so many times
for every kernel entry???

Well, I guess so, since grub-probe is run independently for each kernel
entry (several times actually).

Grégoire



reply via email to

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