Bug 758627 - Default grub2 configuration booting into wrong kernel
Summary: Default grub2 configuration booting into wrong kernel
Keywords:
Status: CLOSED DUPLICATE of bug 732058
Alias: None
Product: Fedora
Classification: Fedora
Component: grub2
Version: 16
Hardware: Unspecified
OS: Linux
unspecified
high
Target Milestone: ---
Assignee: Peter Jones
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-11-30 09:42 UTC by bob mckay
Modified: 2011-12-10 02:44 UTC (History)
5 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2011-12-10 02:44:23 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description bob mckay 2011-11-30 09:42:31 UTC
Description of problem:
Default configuration (GRUB_DEFAULT=saved) is not resulting in the last-selected kernel being booted.

Version-Release number of selected component (if applicable):
1:1.99-12.fc16

How reproducible:
Always fails on this machine, but I'm not sure whether I can reproduce it on another machine.

Steps to Reproduce:
1. Upgrade to F16
2. Edit /etc/default/grub (in my case, to remove rhgb and quite, I like to see what's happening)
3. grub2-mkconfig -o /boot/grub2/grub.cfg
4. reboot (many times)
  
Actual results:
Grub2 always defaults to the original kernel; I have to select the latest kernel manually, but this selection is not saved, although /etc/default/grub is configured to save it:
GRUB_TIMEOUT=5
GRUB_DISTRIBUTOR="Fedora"
GRUB_DEFAULT=saved
GRUB_CMDLINE_LINUX="rd.lvm.lv=vg_sc1_f14plus/lv_swap rd.md=0 rd.lvm.lv=vg_sc1_f15plus/lv_swap  KEYTABLE=us SYSFONT=latarcyrheb-sun16 rd.luks=0 LANG=en_US.UTF-8 rd.lvm.lv=vg_sc1_f15plus/lv_root rd.dm=0"

Expected results:
Grub defaults to the most recently selected kernel

Additional info:
I'm guessing that the reason is that grubenv is not being updated. ls -Z gives
-r--------. root root unconfined_u:object_r:boot_t:s0  grub.cfg
-rw-r--r--. root root system_u:object_r:boot_t:s0      grubenv
ls -l
-r--------. 1 root root   4886 Nov 28 20:11 grub.cfg
-rw-r--r--. 1 root root   1024 Nov 28 18:15 grubenv
i.e. grubenv was last updated immediately after I upgraded from Fedora 16 (it's now Nov 30, and I last rebooted the system about 1200 today); I modified /etc/default/grub and grub2-mkconfig-ed fairly soon after the upgrade, and haven't touched it since (i.e. in particular, it was before doing the initial update after the upgrade).

Grubenv contains
# GRUB Environment Block
saved_entry=Fedora Linux, with Linux 3.1.0-7.fc16.x86_64
but according to /proc/version:
Linux version 3.1.2-1.fc16.x86_64 (mockbuild.fedoraproject.org) (gcc version 4.6.2 20111027 (Red Hat 4.6.2-1) (GCC) ) #1 SMP Tue Nov 22 09:00:57 UTC 2011

I'm happy to provide any other diagonistic information (I haven't succeeded in finding anything else relevant myself).

Comment 1 Mads Kiilerich 2011-12-08 19:18:16 UTC
http://www.gnu.org/software/grub/manual/grub.html :
‘GRUB_DEFAULT’
...
    If you set this to ‘saved’, then the default menu entry will be that saved by ‘GRUB_SAVEDEFAULT’, grub-set-default, or grub-reboot.

‘GRUB_SAVEDEFAULT’
    If this option is set to ‘true’, then, when an entry is selected, save it as a new default entry for use by future runs of GRUB. This is only useful if ‘GRUB_DEFAULT=saved’; it is a separate option because ‘GRUB_DEFAULT=saved’ is useful without this option, in conjunction with grub-set-default or grub-reboot. 


- but it will not work anyway, see bug 732058.

Comment 2 jmlevick 2011-12-09 21:59:14 UTC
Workaround for this problem (and other similar ones) posted in:

https://bugzilla.redhat.com/show_bug.cgi?id=732058

Cheers.

Comment 3 bob mckay 2011-12-10 02:44:23 UTC
Thanks Mads, JM; I hadn't picked up on 732058 (must have used the wrong search terms). Marking as duplicate.

*** This bug has been marked as a duplicate of bug 732058 ***


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