Skip to contentSkip to conversation

GRUB2 msdos logical partition numbering mismatch with Linux partitions

DISCUSSION Andrey Borzenkov 2 participants 3 messages Oct 16, 2012 – Oct 17, 2012

lore
Share & tools
lore
#0 lore raw

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

#1 lore raw

В Вт., 16/10/2012 в 20:51 +0400, Andrey Borzenkov пишет:

Quoted 8 lines

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)

Sorry, ignore that. It was caused by local distribution patch. I had to check better.

#2 lore raw

2012/10/17 Andrey Borzenkov <[email protected]>:

Quoted 5 lines

В Вт., 16/10/2012 в 20:51 +0400, Andrey Borzenkov пишет:

Quoted 4 lines

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

Quoted 7 lines
Quoted 4 lines

bor@opensuse:~/src/grub> sudo /usr/sbin/grub2-probe -t drive -d /dev/sda8
(hd0,msdos11)

Sorry, ignore that. It was caused by local distribution patch. I had to check better.

Probably the patch allowing embedding on extended partition is the culprit. It's only in openSUSE.

http://www.mail-archive.com/[email protected]/msg18893.html

Regards,
Michael

Quoted 6 lines

_______________________________________________
Grub-devel mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/grub-devel