LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 11-13-2015, 08:36 AM   #1
windstory
Member
 
Registered: Nov 2008
Posts: 489

Rep: Reputation: 36
booting problem


My box is Centos 7.1 x64 and every booting I got this problem as shown int the attached photo.

I want to boot the fourth item at the photo, but it boot another.

Please let me know how to boot the fourth evertime.

Thanks in advance.
Attached Thumbnails
Click image for larger version

Name:	2015-11-13_centosboot.jpg
Views:	46
Size:	42.2 KB
ID:	20043  
 
Old 11-13-2015, 11:54 AM   #2
lazydog
Senior Member
 
Registered: Dec 2003
Location: The Key Stone State
Distribution: CentOS Sabayon and now Gentoo
Posts: 1,249
Blog Entries: 3

Rep: Reputation: 194Reputation: 194
You should not be booting the rescue every time. That should be booted to fix something and then boot normal.
Why are you wanting to boot rescue ever time?
 
Old 11-13-2015, 12:29 PM   #3
jailbait
LQ Guru
 
Registered: Feb 2003
Location: Virginia, USA
Distribution: Debian 12
Posts: 8,333

Rep: Reputation: 547Reputation: 547Reputation: 547Reputation: 547Reputation: 547Reputation: 547
Quote:
Originally Posted by windstory View Post

Please let me know how to boot the fourth evertime.
Edit /boot/grub/grub.cfg and change the default entry from 0 to 3. On Debian the line you need to edit looks like this:

set default="0"

which you would change to:

set default="3"

The CentOS code may not be exactly the same but it will be similar.

--------------------------
Steve Stites
 
Old 11-13-2015, 01:37 PM   #4
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6052Reputation: 6052Reputation: 6052Reputation: 6052Reputation: 6052Reputation: 6052Reputation: 6052Reputation: 6052Reputation: 6052Reputation: 6052Reputation: 6052
...and just for the record, both previous answers are the 100 correct ones.
 
Old 11-13-2015, 07:32 PM   #5
windstory
Member
 
Registered: Nov 2008
Posts: 489

Original Poster
Rep: Reputation: 36
There is not "/boot/grub/grub.cfg", but "/boot/grub2/grub.cfg".
 
Old 11-13-2015, 07:42 PM   #6
yancek
LQ Guru
 
Registered: Apr 2008
Distribution: Slackware, Ubuntu, PCLinux,
Posts: 10,411

Rep: Reputation: 2468Reputation: 2468Reputation: 2468Reputation: 2468Reputation: 2468Reputation: 2468Reputation: 2468Reputation: 2468Reputation: 2468Reputation: 2468Reputation: 2468
Quote:
There is not "/boot/grub/grub.cfg", but "/boot/grub2/grub.cfg"
Well, then edit the /boot/grub2/grub.cfg file as explained above in post 3. Some Linux distributions name the grub directory 'grub', some name it 'grub2', some have both a grub and a grub2 directory. You could also edit the /etc/default/grub file by setting the line at the top of the file to below and then run sudo update-grub

Quote:
GRUB_DEFAULT=3
 
1 members found this post helpful.
Old 11-13-2015, 09:32 PM   #7
windstory
Member
 
Registered: Nov 2008
Posts: 489

Original Poster
Rep: Reputation: 36
yancek/

I've changed The content of "/boot/grub2/grub.cfg" like this;
Code:
set pager=1

if [ -s $prefix/grubenv ]; then
  load_env
fi
if [ "${next_entry}" ] ; then
   set default="${next_entry}"
   set next_entry=
   save_env next_entry
   set boot_once=true
else
   set default="${saved_entry}"
fi

if [ x"${feature_menuentry_id}" = xy ]; then
  menuentry_id_option="--id"
else
  menuentry_id_option=""
fi

export menuentry_id_option

if [ "${prev_saved_entry}" ]; then
  set saved_entry="${prev_saved_entry}"
  save_env saved_entry
  set prev_saved_entry=
  save_env prev_saved_entry
  set boot_once=true
fi

function savedefault {
  if [ -z "${boot_once}" ]; then
    saved_entry="${chosen}"
    save_env saved_entry
  fi
}

function load_video {
  if [ x$feature_all_video_module = xy ]; then
    insmod all_video
  else
    insmod efi_gop
    insmod efi_uga
    insmod ieee1275_fb
    insmod vbe
    insmod vga
    insmod video_bochs
    insmod video_cirrus
  fi
}

terminal_output console
if [ x$feature_timeout_style = xy ] ; then
  set timeout_style=menu
  set timeout=5

else
  set timeout=5
fi

set tuned_params=""

menuentry 'CentOS Linux (3.10.0-229.20.1.el7.x86_64) 7 (Core)' --class rhel fedora --class gnu-linux --class gnu --class os --unrestricted $menuentry_id_option 'gnulinux-3.10.0-229.el7.x86_64-advanced-3dfaa88c-3457-4db5-a67b-2e7bfcc9798a' {
	load_video
	set gfxpayload=keep
	insmod gzio
	insmod part_msdos
	insmod xfs
	set root='hd0,msdos1'
	if [ x$feature_platform_search_hint = xy ]; then
	  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1 --hint='hd0,msdos1'  b93fcea5-125e-4c36-81b3-2d8b1076803d
	else
	  search --no-floppy --fs-uuid --set=root b93fcea5-125e-4c36-81b3-2d8b1076803d
	fi
	linux16 /vmlinuz-3.10.0-229.20.1.el7.x86_64 root=/dev/mapper/centos-root ro rd.lvm.lv=centos/root rd.lvm.lv=centos/swap rhgb quiet LANG=en_US.UTF-8 systemd.debug
	initrd16 /initramfs-3.10.0-229.20.1.el7.x86_64.img
}

if [ -f  ${config_directory}/custom.cfg ]; then
  source ${config_directory}/custom.cfg
elif [ -z "${config_directory}" -a -f  $prefix/custom.cfg ]; then
  source $prefix/custom.cfg;
fi
Deleted 3 menuentries without the top one.

And it works.

Last edited by windstory; 11-13-2015 at 11:21 PM.
 
Old 11-14-2015, 03:16 AM   #8
berndbausch
LQ Addict
 
Registered: Nov 2013
Location: Tokyo
Distribution: Mostly Ubuntu and Centos
Posts: 6,316

Rep: Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002
Quote:
Originally Posted by windstory View Post
yancek/

I've changed The content of "/boot/grub2/grub.cfg" like this;

... snip ...

And it works.
Until something overwrites grub.cfg, for example when you update your kernel.

You aren't supposed to change grub.cfg directly. Instead, modify /etc/defaults/grub and run update-grub. Find instructions on gnu.org.
 
1 members found this post helpful.
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
booting problem satimis Debian 2 02-24-2014 05:00 AM
Booting problem at time of kernel booting biyabani Linux - Newbie 4 03-10-2013 03:50 AM
[SOLVED] Problem booting generic kernel and another problem with fluxbox - libpng warning Switch7 Slackware 17 11-14-2009 04:36 AM
Booting Problem WebWatcher SUSE / openSUSE 9 02-23-2005 06:27 PM
Problem Booting (LILO problem) moger Linux - General 21 01-13-2004 08:37 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 12:50 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration