Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED] Need to change the boot sequence.
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
manu_leo
Guru
Guru


Joined: 20 Jan 2014
Posts: 453
Location: India

PostPosted: Wed Aug 27, 2014 1:50 pm    Post subject: [SOLVED] Need to change the boot sequence. Reply with quote

Hi Everyone, I am new to Gentoo. I want to know how to change the boot sequence in Gentoo. I do have multiple kernel-images under /boot. I want to change the sequence for them so that it boots automatically from that kernel-image when I restart the server.

Quote:
boot # ls
grub
kernel-3.12.13-gentoo
kernel-3.12.13.1-gentoo pro
kernel-3.12.13.2-gentoo


I see a grub file under /etc/default/grub.conf

Quote:
# cat /etc/default/grub
# Copyright 1999-2013 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/sys-boot/grub/files/grub.default-2,v 1.4 2013/09/21 18:10:55 floppym Exp $
#
# To populate all changes in this file you need to regenerate your
# grub configuration file afterwards:
# 'grub2-mkconfig -o /boot/grub/grub.cfg'
#
# See the grub info page for documentation on possible variables and
# their associated values.

GRUB_DISTRIBUTOR="Gentoo"

GRUB_DEFAULT=1
GRUB_HIDDEN_TIMEOUT=0
GRUB_HIDDEN_TIMEOUT_QUIET=true
GRUB_TIMEOUT=10


I changed the value for
Quote:
GRUB_DEFAULT=1
, but it still boots from the previous one. Do I need to need to change or complily or modify some other file to change this.

Appreciate all your help.


Last edited by manu_leo on Wed Aug 27, 2014 3:07 pm; edited 1 time in total
Back to top
View user's profile Send private message
krinn
Watchman
Watchman


Joined: 02 May 2003
Posts: 7071

PostPosted: Wed Aug 27, 2014 2:00 pm    Post subject: Reply with quote

Ok, i don't know for grub2, but for grub, default doesn't refer to any kernel, but to a grub entry.
You can tell what entries to boot with that option. It's not what kernel to boot, but what entries to boot.
Back to top
View user's profile Send private message
i92guboj
Bodhisattva
Bodhisattva


Joined: 30 Nov 2004
Posts: 10306
Location: Córdoba (Spain)

PostPosted: Wed Aug 27, 2014 2:02 pm    Post subject: Reply with quote

You have to use grub2-mkconfig to dump any changed done to that config file into the actual grub configuration file under /boot/grub, something like this, on a typical setup:

Code:
grub2-mkconfig -o /boot/grub/grub.cfg

_________________
Gentoo Handbook | My website
Back to top
View user's profile Send private message
manu_leo
Guru
Guru


Joined: 20 Jan 2014
Posts: 453
Location: India

PostPosted: Wed Aug 27, 2014 2:53 pm    Post subject: Reply with quote

Thanks everyone for looking into this.
Quote:
Yes I am using grub-2.
I am actually trying to modify the grub sequence when the server boots up.

So once I make modifications under the
Quote:
file /etc/defaults/grub,
, After this I run the command
Quote:
grub2-mkconfig -o /boot/grub/grub.cfg,
for the changes to take place. Once this command is executed, it lists all the different kernel-image that are there under /boot/ .

But I dint get this part :-

Quote:
changed done to that config file into the actual grub configuration file under /boot/grub,


Quote:
vim /etc/defaults/grub
GRUB_DEFAULT=2
Esc:wq!

grub2-mkconfig -o /boot/grub/grub.cfg


Do I need to add anything to it for the change to take effect ?

Appreciate all your help.
Back to top
View user's profile Send private message
i92guboj
Bodhisattva
Bodhisattva


Joined: 30 Nov 2004
Posts: 10306
Location: Córdoba (Spain)

PostPosted: Wed Aug 27, 2014 2:57 pm    Post subject: Reply with quote

That should suffice.

You can always review the generated grub.cfg and see if everything went the intended way. But there shouldn't be a problem as long as there're no errors in the /etc/defaults/grub config file.
_________________
Gentoo Handbook | My website
Back to top
View user's profile Send private message
manu_leo
Guru
Guru


Joined: 20 Jan 2014
Posts: 453
Location: India

PostPosted: Wed Aug 27, 2014 3:06 pm    Post subject: Reply with quote

Thanks man, appreciate all your time. That make more sense to me now.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum