English
Ask Your Question
0

How to change GRUB 2 boot order?

asked 2013-06-23 15:40:09 +0000

Bucic gravatar image

updated 2013-07-03 19:09:53 +0000

Oddly, I haven't found similar question through the search function. This didn't help me either http://www.linuxreaders.com/2011/11/fedora-16-how-to-change-boot-sequence-grub2.html as the cat command return is not so similar.

Disk partition table type: GPT
No separate boot partition.

My current default entry is:

# grub2-editenv list
saved_entry=Fedora release 18 (Spherical Cow)

I have two Fedora installs currently, and only Fedora. No other systems:

cat /boot/grub2/grub.cfg |grep Fedora
menuentry 'Fedora (3.9.6-200.fc18.x86_64)' --class fedora --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-d84f38a2-2292-4733-895b-ee4664fb8106' {
    echo 'Loading Fedora (3.9.6-200.fc18.x86_64)'
menuentry 'Fedora (3.9.5-201.fc18.x86_64)' --class fedora --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-d84f38a2-2292-4733-895b-ee4664fb8106' {
    echo 'Loading Fedora (3.9.5-201.fc18.x86_64)'
menuentry 'Fedora' --class fedora --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-d84f38a2-2292-4733-895b-ee4664fb8106' {
submenu 'Advanced options for Fedora' $menuentry_id_option 'gnulinux-advanced-d84f38a2-2292-4733-895b-ee4664fb8106' {
    menuentry 'Fedora, with Linux fedup' --class fedora --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-fedup-advanced-d84f38a2-2292-4733-895b-ee4664fb8106' {
    menuentry 'Fedora, with Linux 3.9.4-200.fc18.x86_64' --class fedora --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-3.9.4-200.fc18.x86_64-advanced-d84f38a2-2292-4733-895b-ee4664fb8106' {
menuentry 'Fedora GNU/Linux, with tboot 1.7.0 and Linux 3.9.4-200.fc18.x86_64' --class fedora --class gnu-linux --class gnu --class os --class tboot {
menuentry 'Fedora GNU/Linux, with tboot 1.7.0 and Linux 3.9.3-201.fc18.x86_64' --class fedora --class gnu-linux --class gnu --class os --class tboot {
menuentry 'Fedora GNU/Linux, with tboot 1.7.0 and Linux 3.8.11-200.fc18.x86_64' --class fedora --class gnu-linux --class gnu --class os --class tboot {
menuentry 'Fedora release 18 (Spherical Cow)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-simple-ec3d5bbf-4b5e-435c-9e51-09443d969ea1' {
submenu 'Advanced options for Fedora release 18 (Spherical Cow)' $menuentry_id_option 'osprober-gnulinux-advanced-ec3d5bbf-4b5e-435c-9e51-09443d969ea1' {
    menuentry 'Fedora (on /dev/sda3)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-/boot/vmlinuz-3.9.4-200.fc18.x86_64--ec3d5bbf-4b5e-435c-9e51-09443d969ea1' {
    menuentry 'Fedora, with Linux 3.9.4-200.fc18.x86_64 (on /dev/sda3)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-/boot/vmlinuz-3.9.4-200.fc18.x86_64--ec3d5bbf-4b5e-435c-9e51-09443d969ea1' {
    menuentry 'Fedora, with Linux 3.9.2-200.fc18.x86_64 (on /dev/sda3)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-/boot/vmlinuz-3.9.2-200.fc18.x86_64--ec3d5bbf-4b5e-435c-9e51-09443d969ea1' {
    menuentry 'Fedora release 18 (Spherical Cow) (on /dev/sda3)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-/boot/vmlinuz-3.9.4-200.fc18.x86_64--ec3d5bbf-4b5e-435c-9e51-09443d969ea1' {

Contents of /etc/default/grub:

GRUB_TIMEOUT=5
GRUB_DISTRIBUTOR="$(sed 's, release .*$,,g' /etc/system-release)"
GRUB_DEFAULT=saved
GRUB_CMDLINE_LINUX="rd.md=0 rd.lvm=0 rd.dm=0 $([ -x /usr/sbin/rhcrashkernel-param ] && /usr/sbin/rhcrashkernel-param || :) rd.luks=0 vconsole.keymap=pl2 rhgb quiet"
GRUB_DISABLE_RECOVERY="true"
GRUB_THEME="/boot/grub2/themes/system/theme.txt"

Complete /boot/grub2/grub.cfg
http://paste.fedoraproject.org/21988/06200137
http://paste.fedoraproject.org/22804/37287366/ (latest)

~$ sudo fedup --clean
~$ sudo fedup --resetbootloader
#reboot#

~$ sudo grub2-mkconfig -o /boot/grub2/grub.cfg
    [sudo] password for hg1: 
    Generating grub.cfg ...
    Found theme: /boot/grub2/themes/system/theme.txt
    Found linux image: /boot/vmlinuz-3.9.6-200.fc18.x86_64
    Found initrd image: /boot/initramfs-3.9.6-200.fc18.x86_64.img
    Found linux image: /boot/vmlinuz-3.9.5-201.fc18.x86_64
    Found initrd image: /boot/initramfs-3.9.5-201.fc18.x86_64.img
    Found linux image: /boot/vmlinuz-3.9.4-200.fc18.x86_64
    Found initrd image: /boot/initramfs-3.9.4-200.fc18.x86_64.img
    Found linux image: /boot/vmlinuz-3.9.6-200.fc18.x86_64
    Found initrd image: /boot/initramfs-3.9.6-200.fc18.x86_64.img
    Found linux image: /boot/vmlinuz-3.9.5-201.fc18.x86_64
    Found initrd image: /boot/initramfs-3.9.5-201.fc18.x86_64.img
    Found linux image: /boot/vmlinuz-3.9.4-200.fc18.x86_64
    Found initrd image: /boot/initramfs-3.9.4-200.fc18.x86_64.img
    Found Fedora release 18 (Spherical Cow) on /dev/sda3
    done
#reboot#

All entries past the 'Fedora release 18 (Spherical Cow)' are for my Fedora install on sda3. Topmost entries are for my Fedora install on sda2. I have no idea what these tboot entries are. sda1 is a ~130 MB partiotion with a bios_grub flag (GParted says so).

I'd really appreciate a solution that will provide booting of the latest kernel and won't require any future actions in case of kernel updates or at least specify that the config will brake if kernel gets updated, if that's the case.

Additional info https://fedoraproject.org/wiki/GRUB_2?rd=Grub2#Setting_default_entry

UPDATE 03/07:
I used boot-repair tool to fix my boot configuration. Here's the log it generated http://paste.ubuntu.com/5841196/
It fixed the configuration partially - I could boot to my primary Fedora (on sda2) finally with the latest kernel installed (3.9.6).

My secondary Fedora (on sda3) was missing though so I issued sudo grub2-mkconfig -o /boot/grub2/grub.cfg, restarted and got both systems booting fine and to the latest kernels.

Now my /boot/grub2/grub.cfg looks like this: http://paste.fedoraproject.org/22823/87830713

edit retag flag offensive close delete

Comments

1

What do you want to do exactly? Do you want to change the default OS selected in Grub2 (what is actually described in the link you posted), or you want to change the order of OSes listed in Grub2 menu?

hedayat ( 2013-06-23 19:16:49 +0000 )edit

@hedayat I'd like to change the default system. I've asked the question poorly which is also the reason why I couldn't find any related questions on ask fedora. BUT! As you see in my question my grub menu entries list is a mess so I don't know how to proceed, neither per the instructions linked in my question nor per https://ask.fedoraproject.org/question/8885/how-can-i-change-default-operating-system-in-start-up-boot-menu/ Once I get it sorted out I'll decide whether to edit my question title or to merge it with the exisiting one OR close it.

Bucic ( 2013-06-24 09:37:43 +0000 )edit

And what should become the default OS? Fedora or something else?

hedayat ( 2013-06-24 11:01:31 +0000 )edit

@hedayat'Fedora release 18 (Spherical Cow)' on sda2. As you can see sda2 is not even mentioned in the return. Do I get this weird return because, probably unlike most people, I use GPT (GUUID Partition Table)?

Bucic ( 2013-06-24 12:04:19 +0000 )edit

And what is your default OS right now? How many Fedora installations do you have (more than one)? what is on your /dev/sda3? Do you use separate /boot partitions?

hedayat ( 2013-06-24 16:39:03 +0000 )edit

2 Answers

Sort by ยป oldest newest most voted
1

answered 2013-06-25 18:50:10 +0000

hedayat gravatar image

Well, if I have understood correctly, you want to boot your Fedora 18 installation on sda2. And, there is no sign that you do NOT want to boot the latest kernel. Therefore, I think you should boot the first entry(Fedora (3.9.6-200.fc18.x86_64)) rather than Fedora release 18 (Spherical Cow). And simply keep the first entry as the default one, because it is always the latest kernel for your Fedora 18 on sda2. If you set the default to Fedora release 18 (Spherical Cow), you won't be using latest kernels because they have a different title by default. Or you should manually change the title after kernel updates.

It is absolutely not important that /dev/sda2 doesn't appear in the labels. It is just a label. Initial entries doesn't contain the partition because they are generated for the main OS (the OS which the installed boot loader comes from).

Entries for Fedora on /dev/sda3 contain the partition name since they are generated using os-prober for 'other OSes'.

edit flag offensive delete publish link more

Comments

Yes, I'd like to always boot to the latest kernel and to avoid any need for intervention after future kernel updates. Yes, I'm after the Fedora install on sda2. Notably NO entry anywhere in my GRUB 2 menus state 3.9.6, nor I got it indicated as available as an update, even after doing yum clean all prior to yum update.

Bucic ( 2013-06-27 13:48:01 +0000 )edit

?! But according to the first line of your output, the first menu entry should be for booting Fedora 3.6.9. Maybe you should post your complete grub.cfg or at least the first menuentry option in grub.cfg.

hedayat ( 2013-06-30 15:16:12 +0000 )edit

I've updated my question with all the details. Also please take a look at https://ask.fedoraproject.org/question/27478/kernel-wont-update-how-to-fix-it/

Bucic ( 2013-06-30 15:54:04 +0000 )edit
1

It seems that you've run fedup but not completed the update process. And the output of your grep command doesn't match the content of grub.cfg you've uploaded. You should be able to boot your latest kernel by selecting "Advanced options for Fedora" and then "Fedora, with Linux 3.9.6-200.fc18.x86_64". However, your grub.cfg is dirty. If you don't need fedup entries, remove files /boot/initramfs-fedup.img and /boot/initramfs-fedup.img and then run grub2-mkconfg -o /boot/grub2/grub.cfg. You might prefer to backup your current grub.cfg before running the command though.

hedayat ( 2013-06-30 22:24:42 +0000 )edit

Cleaning after fedup didn't solve anything. Please see the updated question.

Bucic ( 2013-07-01 22:27:00 +0000 )edit
1

answered 2013-06-30 20:47:19 +0000

Dave Light gravatar image

I don't know if Grub Customizer will work on Fedora Linux (I'm having installation problems). But I have used it with Ubuntu. The only problem I have sometimes is the MBR on sda boot disk (dual boot windows/Linux) will crap out requiring a windows boot repair, booting from DVD. Google Grub Customizer or try this link https://launchpad.net/~danielrichter2007/+archive/grub-customizer. Good luck!

edit flag offensive delete publish link more

Your answer

Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

Add answer

[hide preview]

Use your votes!

  • Use the 30 daily voting points that you get!
  • Up-vote well framed questions that provide enough information to enable people provide answers.
  • Thank your helpers by up-voting their comments and answers to your questions.
  • Down-voting might cost you karma, but you should consider doing so for incorrect or clearly detrimental questions and answers.

Question tools

Follow
1 follower

Stats

Asked: 2013-06-23 15:40:09 +0000

Seen: 8,668 times

Last updated: Jul 03 '13