grub-devel
[Top][All Lists]
Advanced

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

GRUB2 msdos logical partition numbering mismatch with Linux partitions


From: Andrey Borzenkov
Subject: GRUB2 msdos logical partition numbering mismatch with Linux partitions
Date: Tue, 16 Oct 2012 20:51:12 +0400

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

address@hidden:~/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

address@hidden:~> 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

address@hidden:~/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




reply via email to

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