LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   booting problem (https://www.linuxquestions.org/questions/linux-newbie-8/booting-problem-4175558777/)

windstory 11-13-2015 07:36 AM

booting problem
 
1 Attachment(s)
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.

lazydog 11-13-2015 10:54 AM

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?

jailbait 11-13-2015 11:29 AM

Quote:

Originally Posted by windstory (Post 5449127)

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

ondoho 11-13-2015 12:37 PM

...and just for the record, both previous answers are the 100 correct ones.

windstory 11-13-2015 06:32 PM

There is not "/boot/grub/grub.cfg", but "/boot/grub2/grub.cfg".

yancek 11-13-2015 06:42 PM

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

windstory 11-13-2015 08:32 PM

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.

berndbausch 11-14-2015 02:16 AM

Quote:

Originally Posted by windstory (Post 5449466)
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.


All times are GMT -5. The time now is 07:00 PM.