Bug 10246 - Grub2 and reboot directly to windows doesn't work anymore
Summary: Grub2 and reboot directly to windows doesn't work anymore
Status: RESOLVED WORKSFORME
Alias: None
Product: Mageia
Classification: Unclassified
Component: RPM Packages (show other bugs)
Version: 3
Hardware: i586 Linux
Priority: Normal normal
Target Milestone: ---
Assignee: Mageia Bug Squad
QA Contact:
URL:
Whiteboard:
Keywords: NEEDINFO
Depends on:
Blocks:
 
Reported: 2013-05-24 09:43 CEST by Henrik Christiansen
Modified: 2013-06-22 13:30 CEST (History)
3 users (show)

See Also:
Source RPM:
CVE:
Status comment:


Attachments
bootinfoscripts RESULTS.txt (14.24 KB, text/plain)
2013-05-25 10:53 CEST, Henrik Christiansen
Details
restart computer picture (35.68 KB, image/png)
2013-05-25 22:31 CEST, Henrik Christiansen
Details
sub-menu in "Leave menu" (34.60 KB, image/png)
2013-05-25 22:32 CEST, Henrik Christiansen
Details
sub menu with windows option (59.90 KB, image/png)
2013-05-28 21:00 CEST, Henrik Christiansen
Details
mcc > boot > setup boot system >screen2 empty (39.39 KB, image/png)
2013-05-29 21:01 CEST, Henrik Christiansen
Details

Description Henrik Christiansen 2013-05-24 09:43:57 CEST
This is on Mageia 3 upgraded from Mageia 2 and Grub upgraded to Grub2

From the Leave window, left click on "Restart computer" select "windows".
It should reboot to windows, but reboots to Mageia again.

With Grub it did boot directly to windows.
Comment 1 Manuel Hiebel 2013-05-24 20:12:43 CEST
is that in kde ?

CC: (none) => zen25000

Comment 2 Barry Jackson 2013-05-24 22:33:20 CEST
(In reply to Manuel Hiebel from comment #1)
> is that in kde ?

After reboot it's not 'in' anything :/

Henrik, could you please run bootinfoscript:

http://sourceforge.net/projects/bootinfoscript/files/latest

Follow the instructions and attach RESULTS.txt to this bug report.

Thanks.

Keywords: (none) => NEEDINFO

Comment 3 Henrik Christiansen 2013-05-25 10:53:28 CEST
Created attachment 4050 [details]
bootinfoscripts RESULTS.txt
Comment 4 Henrik Christiansen 2013-05-25 10:54:13 CEST
It's kde.

CC: (none) => hc

Comment 5 Barry Jackson 2013-05-25 11:24:23 CEST
(In reply to Henrik Christiansen from comment #3)
> Created attachment 4050 [details]
> bootinfoscripts RESULTS.txt

Henrik,

Thanks, I think I see the issue.
You have an old version of grub2 in the MBR.

If you boot into Mageia and run:

su
grub2-install /dev/sda

This will re-install grub2 to the MBR and it *should* then work correctly.
Comment 6 Henrik Christiansen 2013-05-25 12:12:31 CEST
>grub2-install /dev/sda
Installation finished. No error reported.

2x reboot from the "leave menu" selecting "windows", but it still boots back to Mageia.

Info:
It _does_ boot to windows when I select it from the boot menu.

About old:
Mageia 2 upgraded to Mageia 3, using urpmi, reboot and then upgrading grub to grub2.
Comment 7 Barry Jackson 2013-05-25 12:40:41 CEST
(In reply to Henrik Christiansen from comment #6)
> >grub2-install /dev/sda
> Installation finished. No error reported.
> 
> 2x reboot from the "leave menu" selecting "windows", but it still boots back
> to Mageia.
> 

Ah! Now I understand Manuel's question about KDE /o\
I was unaware of an option in the KDE leave menu.

Try selecting Grub2 as your bootloader under "System Settings > System Administration > Login Screen > Shutdown > Boot manager".

See how that goes.

> Info:
> It _does_ boot to windows when I select it from the boot menu.
> 
> About old:
> Mageia 2 upgraded to Mageia 3, using urpmi, reboot and then upgrading grub
> to grub2.

Mageia has never officially shipped grub 1.99 so this must have been installed  while testing or by some other OS - unless this is a bootinfoscript bug, or grub2-2.00 has a left-over string somewhere hidden, that bootinfoscript has found. Odd :/
Comment 8 Henrik Christiansen 2013-05-25 18:07:53 CEST
> Try selecting Grub2 as your bootloader under "System Settings > System
> Administration > Login Screen > Shutdown > Boot manager".
> 
> See how that goes.

On first try, nothing changed, it boots back to Mageia.
On second try however, there is no longer a left click menu on the "leave menu" --> "restart computer"


> > About old:
> > Mageia 2 upgraded to Mageia 3, using urpmi, reboot and then upgrading grub
> > to grub2.
> 
> Mageia has never officially shipped grub 1.99 so this must have been
> installed  while testing or by some other OS - unless this is a
> bootinfoscript bug, or grub2-2.00 has a left-over string somewhere hidden,
> that bootinfoscript has found. Odd :/

Cant help with that. This computer has been used with some mandriva versions, before Mageia 1 > 3. Either going from Mageia 1 to 2 or 2 to 3, was the first time I did an upgrade and not a fresh install.
Comment 9 Barry Jackson 2013-05-25 21:33:28 CEST
(In reply to Henrik Christiansen from comment #8)
> > Try selecting Grub2 as your bootloader under "System Settings > System
> > Administration > Login Screen > Shutdown > Boot manager".
> > 
> > See how that goes.
> 
> On first try, nothing changed, it boots back to Mageia.
> On second try however, there is no longer a left click menu on the "leave
> menu" --> "restart computer"
> 

This does look like a KDE issue. 
However I am somewhat confused as I don't see a "Restart Computer" option at all. I see "Restart", and I have never seen any sub-options to "directly reboot into other OS"

> 
> > > About old:
> > > Mageia 2 upgraded to Mageia 3, using urpmi, reboot and then upgrading grub
> > > to grub2.
> > 
> > Mageia has never officially shipped grub 1.99 so this must have been
> > installed  while testing or by some other OS - unless this is a
> > bootinfoscript bug, or grub2-2.00 has a left-over string somewhere hidden,
> > that bootinfoscript has found. Odd :/
> 
> Cant help with that. This computer has been used with some mandriva
> versions, before Mageia 1 > 3. Either going from Mageia 1 to 2 or 2 to 3,
> was the first time I did an upgrade and not a fresh install.

It's OK - I think the current bootinfoscript version knows nothing of grub versions beyond 1.99 so that was a red herring.
Comment 10 Henrik Christiansen 2013-05-25 22:31:13 CEST
Created attachment 4053 [details]
restart computer picture

> This does look like a KDE issue. 
> However I am somewhat confused as I don't see a "Restart Computer" option at
> all. I see "Restart", and I have never seen any sub-options to "directly
> reboot into other OS"
Comment 11 Henrik Christiansen 2013-05-25 22:32:31 CEST
Created attachment 4054 [details]
sub-menu in "Leave menu"

> This does look like a KDE issue. 
> However I am somewhat confused as I don't see a "Restart Computer" option at
> all. I see "Restart", and I have never seen any sub-options to "directly
> reboot into other OS"
Comment 12 Barry Jackson 2013-05-26 01:42:38 CEST
Ah OK that is from the kicker menu which is not the default.
I still can't see any options to direct boot another system though. even looking in Mageia 2, but I'll take your word ;)
Comment 13 Barry Jackson 2013-05-26 23:14:15 CEST
Henrik, please try:-

su
echo "GRUB_DEFAULT=saved" >> /etc/default/grub && update-grub

Then re-boot and see if there is any change.
Comment 14 Henrik Christiansen 2013-05-28 19:57:06 CEST
(In reply to Barry Jackson from comment #13)

> su
> echo "GRUB_DEFAULT=saved" >> /etc/default/grub && update-grub
> 
> Then re-boot and see if there is any change.

Thanks Barry, but that didn't help.

I took a look in mcc > boot > setup boot system
"Bootloader to use" was "GRUB2 with graphical menu"
I hit "Next" where the screen was empty :-O
I hit "Finish" anyway.
Rebooted and got into a loop, that always ended with something like "Video driver has changed, you need to reboot"
If I hit cancel it just hang where it wrote something with plymouth..
I then rm xorg.conf > rebooted and it booted to kde.
In mcc > boot > setup boot system
I changed "Bootloader to use" to "GRUB with graphical menu"
I hit "Next" where the screen was empty again
I hit "Finish" anyway.

Rebooted and got a Bash minimal grub promt :-(
Couldn't find a way to make it boot, so I used the Mageia3 DVD to reinstall the bootloader, but that didn't work.

I then used the Mageia3 DVD to upgrade, which took 15 minuts.
Grub is now back and it boots.
The DVD upgraded the Mageia3 install to Cauldron ?!?
A lot of Cauldron rpms was installed.
I have just finished to downgrade those rpms to mga3.


I'll stay with GRUB for now ;-)
Comment 15 Barry Jackson 2013-05-28 20:31:41 CEST
(In reply to Henrik Christiansen from comment #14)
> (In reply to Barry Jackson from comment #13)
> 
> > su
> > echo "GRUB_DEFAULT=saved" >> /etc/default/grub && update-grub
> > 
> > Then re-boot and see if there is any change.
> 
> Thanks Barry, but that didn't help.
> 

OK

> I took a look in mcc > boot > setup boot system

I wish you hadn't :(

> "Bootloader to use" was "GRUB2 with graphical menu"
> I hit "Next" where the screen was empty :-O
> I hit "Finish" anyway.
> Rebooted and got into a loop, that always ended with something like "Video
> driver has changed, you need to reboot"
> If I hit cancel it just hang where it wrote something with plymouth..
> I then rm xorg.conf > rebooted and it booted to kde.
> In mcc > boot > setup boot system
> I changed "Bootloader to use" to "GRUB with graphical menu"
> I hit "Next" where the screen was empty again
> I hit "Finish" anyway.
> 
> Rebooted and got a Bash minimal grub promt :-(
> Couldn't find a way to make it boot

It's really simple to boot manually from a legacy grub prompt :/
https://forums.mageia.org/en/viewtopic.php?p=6096&sid=08539761beebc4db4ea56faca4b2a441#p6096
Maybe worth learning how before you next need it :)

> so I used the Mageia3 DVD to reinstall
> the bootloader, but that didn't work.

Digging a deeper and deeper hole :/

> 
> I then used the Mageia3 DVD to upgrade, which took 15 minuts.
> Grub is now back and it boots.
> The DVD upgraded the Mageia3 install to Cauldron ?!?

Agghhh !

> A lot of Cauldron rpms was installed.
> I have just finished to downgrade those rpms to mga3.
> 
> 
> I'll stay with GRUB for now ;-)

OK - however, getting back to this bug - does it work now with grub?
If so could you please post an image of the leave sub-menu that shows 'Windows' as a boot option?
Comment 16 Henrik Christiansen 2013-05-28 20:58:49 CEST
(In reply to Barry Jackson from comment #15)

> I wish you hadn't :(
Me to ;-)

> It's really simple to boot manually from a legacy grub prompt :/
> https://forums.mageia.org/en/viewtopic.
> php?p=6096&sid=08539761beebc4db4ea56faca4b2a441#p6096
> Maybe worth learning how before you next need it :)

That is what google could find to. It didn't work however...

> OK - however, getting back to this bug - does it work now with grub?

Yes

> If so could you please post an image of the leave sub-menu that shows
> 'Windows' as a boot option?
hang on....
Comment 17 Henrik Christiansen 2013-05-28 21:00:53 CEST
Created attachment 4062 [details]
sub menu with windows option
Comment 18 Barry Jackson 2013-05-28 23:23:23 CEST
Your issue with updating to Cauldron is here: https://bugs.mageia.org/show_bug.cgi?id=10332
Comment 19 Barry Jackson 2013-05-29 01:23:56 CEST
OK I have finally figured out what is happeneing with this.

It works OK here with grub2 after doing as I suggested in #7 and #13.

It edits /boot/grub2/grub.env so that grub2 thinks the OS selected at last boot was the one you have selected from the leave > reboot sub-menu.

With GRUB_DEFAULT=saved set this becomes the default for the next boot.

Note that it only becomes the default, there is no magic "direct boot" going on here and the machine still does a complete warm re-boot including POST so no time is saved. 
Seems a bit pointless really :\

The reason I had never seen this - and have still been struggling to find it, was that the sub-menu only appears when the yellow icon is clicked next to the "Reboot computer" (or "Reboot" in the classic menu) - I have always clicked on the text - which just re-boots without displaying the menu.

So this "Works for me" in Cauldron and 3 and so I feel the bug can be closed, unless you think something should be added to the installer/drakxtools to automatically edit the configuration files when grub2 is in use. I'm not sure that would be desirable as most people may not want 'saved' active (I certainly don't). 

What do you think Henrik?
Comment 20 Henrik Christiansen 2013-05-29 10:33:57 CEST
(In reply to Barry Jackson from comment #19)
> OK I have finally figured out what is happeneing with this.
> 
> Note that it only becomes the default, there is no magic "direct boot" going
> on here and the machine still does a complete warm re-boot including POST so
> no time is saved. 
> Seems a bit pointless really :\

Not everyone has a blazing fast laptop. I like, that I can hit reboot to windows, walk away and not having to sit tight waiting for the boot menu to select windows and when I come back Netflix is ready. Yup, Netflix is almost the only thing I ever boot to windows for :-(

> So this "Works for me" in Cauldron and 3 and so I feel the bug can be
> closed, unless you think something should be added to the
> installer/drakxtools to automatically edit the configuration files when
> grub2 is in use. I'm not sure that would be desirable as most people may not
> want 'saved' active (I certainly don't). 
> 
> What do you think Henrik?

It's ok to close it, if it works for you.
However the, for me, major pain, was when mcc > boot > setup boot system didn't find anything on the last screen with GRUB2 and then almost ruin my laptop, with no easy way to get everything back again. Is there a bug there that should be reported you think?
Comment 21 Barry Jackson 2013-05-29 14:26:18 CEST
(In reply to Henrik Christiansen from comment #20)
> (In reply to Barry Jackson from comment #19)

> Not everyone has a blazing fast laptop. I like, that I can hit reboot to
> windows, walk away and not having to sit tight waiting for the boot menu to
> select windows and when I come back Netflix is ready. Yup, Netflix is almost
> the only thing I ever boot to windows for :-(
> 

Ah - OK, so you are combining this with some sort of auto-login on Windows ?
In that case I see why it may be useful. 


> It's ok to close it, if it works for you.
> However the, for me, major pain, was when mcc > boot > setup boot system
> didn't find anything on the last screen with GRUB2 and then almost ruin my
> laptop, with no easy way to get everything back again. Is there a bug there
> that should be reported you think?

Probably - I will do some testing in a VM to see what may be happening there.
I don't really understand "didn't find anything on the last screen with GRUB2", but if I play long enough I may find it.
Integration of grub2 in the drakxtools is still very new and does have some issues.
Comment 22 Henrik Christiansen 2013-05-29 21:01:09 CEST
Created attachment 4070 [details]
mcc > boot > setup boot system >screen2 empty

This screen should have shown all kernels and OS installed on the computer.
Comment 23 Henrik Christiansen 2013-05-29 21:14:08 CEST
(In reply to Barry Jackson from comment #21)

> Ah - OK, so you are combining this with some sort of auto-login on Windows ?
> In that case I see why it may be useful. 

Exactly. Boots windows and the user desktop with the screen locked and the browser loaded with Netflix.

> Probably - I will do some testing in a VM to see what may be happening there.
> I don't really understand "didn't find anything on the last screen with
> GRUB2", but if I play long enough I may find it.

see attachment 4070 [details]
Comment 24 Barry Jackson 2013-05-29 21:32:33 CEST
(In reply to Henrik Christiansen from comment #22)
> Created attachment 4070 [details]
> mcc > boot > setup boot system >screen2 empty
> 
> This screen should have shown all kernels and OS installed on the computer.

Ah - you obviously didn't read the release notes/errata ;)

https://wiki.mageia.org/en/Mageia_3_Release_Notes#Others
https://wiki.mageia.org/en/Mageia_3_Errata#Grub2

and

https://bugs.mageia.org/show_bug.cgi?id=9627

I agree that despite not working, it should not damage your system.

Closing this bug as WFM.

Status: NEW => RESOLVED
Resolution: (none) => WORKSFORME

Comment 25 Rémi Verschelde 2013-06-22 13:08:56 CEST
Following the instructions in comment 7 and 13 fixed it for me too.

I also added mga3 with grub at first, and then installed grub2 for the QA of bug 9991.
I suppose that users who installed mga3 KDE4 and chose grub2 as default bootloader during the install won't have to do what is in comment 7, but should still fix the config from comment 13?

IIUC, "GRUB_DEFAULT=saved" loads the last successfully loaded OS? Then I don't want it either, and that's not how I understand this KDE "Reboot" feature.


As I understand it, it should trigger grub2-reboot:
[root@remi akien]# grub2-reboot --help
Usage: grub2-reboot [OPTION] MENU_ENTRY
Set the default boot menu entry for GRUB, for the next boot only.

  -h, --help              print this message and exit
  -v, --version           print the version information and exit
  --boot-directory=DIR    expect GRUB images under the directory DIR//grub2
                          instead of the /boot/grub2 directory

MENU_ENTRY is a number, a menu item title or a menu item identifier.


That would be a KDE bug then?

CC: (none) => remi

Comment 26 Barry Jackson 2013-06-22 13:30:12 CEST
(In reply to Rémi Verschelde from comment #25)
> Following the instructions in comment 7 and 13 fixed it for me too.
> 
> I also added mga3 with grub at first, and then installed grub2 for the QA of
> bug 9991.
> I suppose that users who installed mga3 KDE4 and chose grub2 as default
> bootloader during the install won't have to do what is in comment 7, but
> should still fix the config from comment 13?
> 
I'm not sure that's the case since grub legacy is always installed whether grub2 is selected or not:- https://bugs.mageia.org/show_bug.cgi?id=8741

> IIUC, "GRUB_DEFAULT=saved" loads the last successfully loaded OS? Then I
> don't want it either, and that's not how I understand this KDE "Reboot"
> feature.
> 
> 
> As I understand it, it should trigger grub2-reboot:
> [root@remi akien]# grub2-reboot --help
> Usage: grub2-reboot [OPTION] MENU_ENTRY
> Set the default boot menu entry for GRUB, for the next boot only.
> 
>   -h, --help              print this message and exit
>   -v, --version           print the version information and exit
>   --boot-directory=DIR    expect GRUB images under the directory DIR//grub2
>                           instead of the /boot/grub2 directory
> 
> MENU_ENTRY is a number, a menu item title or a menu item identifier.
> 

That would make more sense than the way it tries to work now, however IIANM it would need to be root to run grub2-reboot.

> 
> That would be a KDE bug then?

Yes I guess so - maybe re-open this against KDE?

Note You need to log in before you can comment on or make changes to this bug.