From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1TOAMb-00055Q-C7 for mharc-grub-devel@gnu.org; Tue, 16 Oct 2012 12:51:29 -0400 Received: from eggs.gnu.org ([208.118.235.92]:58883) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TOAMY-00055J-Js for grub-devel@gnu.org; Tue, 16 Oct 2012 12:51:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TOAMO-0001RP-Vh for grub-devel@gnu.org; Tue, 16 Oct 2012 12:51:26 -0400 Received: from mail-la0-f41.google.com ([209.85.215.41]:46059) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TOAMO-0001R4-OP for grub-devel@gnu.org; Tue, 16 Oct 2012 12:51:16 -0400 Received: by mail-la0-f41.google.com with SMTP id p5so4820925lag.0 for ; Tue, 16 Oct 2012 09:51:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:subject:from:to:date:content-type:x-mailer:mime-version :content-transfer-encoding; bh=jfHA5KXLTISYi5yjeEty3HeRFYAKcAmeK/5UyeUfe68=; b=oV/RhBOmcuL1ummuwRC7AgxqzpAy0PL4SjT5s/uA7anKeP+1DlaaZ1B0U0EYgHrYMa z2KIuFAeUcMZ8h3MeaA7tvt+kZlspWZMXNOY/n3dsSThQff4+zzrfB/6VPSHG4eb9YSu CU22Orl7M/4FpRxCPzhX8n0oNxdDv4a8lM3B6fc5hsfZFPOPJ08DB6uJXcLQIvfwxZFH v4n2Zw2jv4XNl5O8CjrpkmgfDxqDIqVt6l/iOUkBDJLCvB3CFEGekc3D6QOzGO/cCEWG mtZeF667EulaoHB6ONzRw+3c1oNl/Id2cGM/EAXUBPl9LTk001y9R+9+oqUNd8044RKn HR0w== Received: by 10.152.104.148 with SMTP id ge20mr13099372lab.51.1350406275719; Tue, 16 Oct 2012 09:51:15 -0700 (PDT) Received: from [192.168.10.103] (ppp83-237-23-13.pppoe.mtu-net.ru. [83.237.23.13]) by mx.google.com with ESMTPS id ti4sm5689811lab.1.2012.10.16.09.51.13 (version=SSLv3 cipher=OTHER); Tue, 16 Oct 2012 09:51:14 -0700 (PDT) Message-ID: <1350406272.2842.17.camel@opensuse.site> Subject: GRUB2 msdos logical partition numbering mismatch with Linux partitions From: Andrey Borzenkov To: grub-devel@gnu.org Date: Tue, 16 Oct 2012 20:51:12 +0400 Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.4.4 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.85.215.41 X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.14 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, 16 Oct 2012 16:51:27 -0000 It appears that in case of logical partitions GRUB2 counts each "glue" entry (that points to the next EBR) as fully fledged partition which results in bor@opensuse:~/src/grub> sudo /usr/sbin/grub2-probe -t drive -d /dev/sda8 (hd0,msdos11) Quick script to walk logical partitions chain: Extended partition 2, type 0x05, start at 1044225, size 487347840 Logical partition 5 (grub 5), type 0x82, start at 1044288, size 8385867 Glue partition (grub 6), type 0x05, start at 9430155, size 62910540 Logical partition 6 (grub 7), type 0x83, start at 9430218, size 62910477 Glue partition (grub 8), type 0x05, start at 72340695, size 125837145 Logical partition 7 (grub 9), type 0x83, start at 72340758, size 125837082 Glue partition (grub 10), type 0x05, start at 198177840, size 290214225 Logical partition 8 (grub 11), type 0x8e, start at 198177903, size 290214162 for a disk bor@opensuse:~> LC_ALL=C sudo /sbin/fdisk -l /dev/sda Disk /dev/sda: 250.1 GB, 250059350016 bytes 255 heads, 63 sectors/track, 30401 cylinders, total 488397168 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x70000000 Device Boot Start End Blocks Id System /dev/sda1 * 63 1044224 522081 83 Linux /dev/sda2 1044225 488392064 243673920 5 Extended /dev/sda5 1044288 9430154 4192933+ 82 Linux swap / Solaris /dev/sda6 9430218 72340694 31455238+ 83 Linux /dev/sda7 72340758 198177839 62918541 83 Linux /dev/sda8 198177903 488392064 145107081 8e Linux LVM And to prove bor@opensuse:~/src/grub> for i in 5 6 7 8; do sudo /usr/sbin/grub2-probe -t drive -d /dev/sda$i; done (hd0,msdos5) (hd0,msdos7) (hd0,msdos9) (hd0,msdos11) It is apparently also inconsistent between distributions (probably different GRUB2 versions); reports are that Ubuntu 12.04 gets numbers right and Fedora 16 and openSUSE 12.2 gets them wrong (I am under openSUSE 12.2). Is it intentional? If anything, this is extremely confusing for an unprepared user. -andrey