From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1Oy3O3-0000UX-VC for mharc-grub-devel@gnu.org; Tue, 21 Sep 2010 09:59:59 -0400 Received: from [140.186.70.92] (port=36109 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Oy3Nr-0000Sd-Nc for grub-devel@gnu.org; Tue, 21 Sep 2010 09:59:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1Oy3Nf-0006VV-Jh for grub-devel@gnu.org; Tue, 21 Sep 2010 09:59:47 -0400 Received: from mail-ww0-f49.google.com ([74.125.82.49]:63290) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Oy3Nf-0006UV-Fa for grub-devel@gnu.org; Tue, 21 Sep 2010 09:59:35 -0400 Received: by wwb24 with SMTP id 24so6465834wwb.30 for ; Tue, 21 Sep 2010 06:59:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:subject:references:in-reply-to :content-type:content-transfer-encoding; bh=hEo/66OSkLWCTYf/cKDZoabvOeL6VIrGG0XND+aThsY=; b=TrZaT5MVGEPSjhvrr8ygwPS7DlS26wMXDFjBAxGC6qz5+gdkEHibf6PcqBLoAt/9HC KoWij7UeiL79fMfCQHzL8IL9FoiRfc6tw3yE6OHs+YnQEPZcLFH2WHEDvMr9wc/fzrs+ rMk8GFbMr8c2nSbNo//D4HaPRzCawrUAFn97o= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; b=LQgwxfIN9KcHfF0z/QHL5BmlttBxH4WmxVx4sq5KoJ2j2bTN+AmKX8ilgGfxO7kCdP YI4XYSidXFizteEIxtBnk+lEnf0uFu17GtvgsLRWoWoVJnv3brAgCuVAcUp2Eb1q2RDG Ez6DyLF28fGlHrqgMs1kkP95AQGgyT89qPCDU= Received: by 10.216.132.166 with SMTP id o38mr9264184wei.16.1285077570456; Tue, 21 Sep 2010 06:59:30 -0700 (PDT) Received: from [147.210.129.4] (laptop-147-210-129-4.labri.fr [147.210.129.4]) by mx.google.com with ESMTPS id v44sm6023305weq.4.2010.09.21.06.59.09 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 21 Sep 2010 06:59:13 -0700 (PDT) Message-ID: <4C98BA2B.3020300@gmail.com> Date: Tue, 21 Sep 2010 15:59:07 +0200 From: =?UTF-8?B?R3LDqWdvaXJlIFN1dHJl?= 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 MIME-Version: 1.0 To: The development of GRUB 2 References: <1285054276.10425.39.camel@hp.my.own.domain> In-Reply-To: <1285054276.10425.39.camel@hp.my.own.domain> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) Subject: Re: Improperly nested partitions, help needed! X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: The development of GNU GRUB List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Sep 2010 13:59:57 -0000 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