Comment 4 for bug 476625

Revision history for this message
TJ (tj) wrote : Re: Grub2 fails to properly identify Windows and Compaq recovery partitions

The bug is in /usr/lib/os-probes/mounted/20microsoft

When probing the Boot Configuration Data binary file it makes several invalid assumptions:

1. All recovery file-systems are named (in UTF-16) "Windows Recovery Environment"
2. The last entry in the /Boot/BCD file is related to the partition being probed
3. Any BCD it can't 'understand' must be "Windows Vista"

In my case /dev/sda1 (the recovery partition) has a /boot/bcd containing "Vaio Recovery Environment" and "Windows Memory Diagnostic", neither of which will match:

 elif grep -qs "W.i.n.d.o.w.s. .R.e.c.o.v.e.r.y. .E.n.v.i.r.o.n.m.e.n.t" "$2/$boot/$bcd"; then
  long="Windows Recovery Environment (loader)"

resulting in the default being used:

 else
  long="Windows Vista (loader)"

For /dev/sda2 (the Windows Vista partition) has a /Boot/BCD containing "Windows Vista" followed by "Windows Recovery Environment". In this case because there is no specific test for "Windows Vista" a match is made with:

 elif grep -qs "W.i.n.d.o.w.s. .R.e.c.o.v.e.r.y. .E.n.v.i.r.o.n.m.e.n.t" "$2/$boot/$bcd"; then
  long="Windows Recovery Environment (loader)"

and the default 'else' clause that would set "Windows Vista" is never used.