help needed for dual boot grub default

kronoSX

Honorary Master
Joined
Feb 28, 2005
Messages
15,305
Reaction score
336
Location
Capetown home to gang stars
I use redhat and windows 11 dual boot,I want the last booted os to be default in grub everytime the machine boots so i dont have to select in grub windows boot manager or redhat.Now i did google how to edit the grub in nano and i did the steps but its still not doing what its suppose to be doing,Its fkin stressful when i power the pc on and walk away to come back and see flippin redhat loaded.I use windows for certain apps that linux cant do.Now i have to power off redhat and sit in fron of the pc and do it manually to windows boot manager....god damn.
It seems redhat has a different approach to doing this as i followed a ubuntu tutorial.
 
Don't walk away next time and see what happens
 
Post your grub.conf and also the path where you are editing it.

Can’t help you with Jack **** without seeing what you are doing.
 
Might give some ideas:

Official manual (see section 26.5.1):
that dont work
 
  • Like
Reactions: Nod
let me try that again,i know last week i did something like that and i got an error when saving the entire process,hold
It should be as simple as default=number

Then match the number to the one listed in the rest of the file starting at 0.

If it never saved then it’s obviously not going to work as nothing changed.
 
Why not the second link is the official Red Hat manual. It’s exactly what you need.
god damn thats an entire book to read there

26.5.1. Changing the Default Boot Entry​

By default, the key for the GRUB_DEFAULT directive in the /etc/default/grub file is the word saved. This instructs GRUB 2 to load the kernel specified by the saved_entry directive in the GRUB 2 environment file, located at /boot/grub2/grubenv. You can set another GRUB 2 record to be the default, using the grub2-set-default command, which will update the GRUB 2 environment file.

By default, the saved_entry value is set to the name of latest installed kernel of package type kernel. This is defined in /etc/sysconfig/kernel by the UPDATEDEFAULT and DEFAULTKERNEL directives. The file can be viewed by the root


Is this the section i need to follow
 
[kronos@localhost ~]$ cat /etc/default/grub
GRUB_TIMEOUT=5
GRUB_DISTRIBUTOR="$(sed 's, release .*$,,g' /etc/system-release)"
GRUB_DEFAULT=saved
GRUB_DISABLE_SUBMENU=true
GRUB_TERMINAL_OUTPUT="console"
GRUB_CMDLINE_LINUX="crashkernel=1G-4G:192M,4G-64G:256M,64G-:512M resume=/dev/mapper/rhel-swap rd.lvm.lv=rhel/root rd.lvm.lv=rhel/swap rhgb quiet"
GRUB_DISABLE_RECOVERY="true"
GRUB_ENABLE_BLSCFG=true
GRUB_SAVEDEFAULT=true
this is now

GNU nano 5.6.1 /etc/default/grub
GRUB_TIMEOUT=10
GRUB_DISTRIBUTOR="$(sed 's, release .*$,,g' /etc/system-release)"
GRUB_DEFAULT=saved
GRUB_DISABLE_SUBMENU=true
GRUB_TERMINAL_OUTPUT="console"
GRUB_CMDLINE_LINUX="crashkernel=1G-4G:192M,4G-64G:256M,64G-:512M resume=/dev/ma>
GRUB_DISABLE_RECOVERY="true"
GRUB_ENABLE_BLSCFG=true
GRUB_SAVEDEFAULT=true


I changes the timeout to 10.now to do the main thing
 
Last edited:
god damn thats an entire book to read there

26.5.1. Changing the Default Boot Entry​

By default, the key for the GRUB_DEFAULT directive in the /etc/default/grub file is the word saved. This instructs GRUB 2 to load the kernel specified by the saved_entry directive in the GRUB 2 environment file, located at /boot/grub2/grubenv. You can set another GRUB 2 record to be the default, using the grub2-set-default command, which will update the GRUB 2 environment file.

By default, the saved_entry value is set to the name of latest installed kernel of package type kernel. This is defined in /etc/sysconfig/kernel by the UPDATEDEFAULT and DEFAULTKERNEL directives. The file can be viewed by the root


Is this the section i need to follow
You want to become a Linux Administrator you need to be able to read basic documention without someone holding your hand.

Everything you need is on that RedHat link. You are looking in the wrong places and needlessly complicating things.
 
[kronos@localhost ~]$ cat /etc/default/grub
GRUB_TIMEOUT=5
GRUB_DISTRIBUTOR="$(sed 's, release .*$,,g' /etc/system-release)"
GRUB_DEFAULT=saved
GRUB_DISABLE_SUBMENU=true
GRUB_TERMINAL_OUTPUT="console"
GRUB_CMDLINE_LINUX="crashkernel=1G-4G:192M,4G-64G:256M,64G-:512M resume=/dev/mapper/rhel-swap rd.lvm.lv=rhel/root rd.lvm.lv=rhel/swap rhgb quiet"
GRUB_DISABLE_RECOVERY="true"
GRUB_ENABLE_BLSCFG=true
GRUB_SAVEDEFAULT=true
You are looking at completely the wrong thing.

READ the very top of the link and what it says it guides you exactly based on your setup where you need to go.

You don’t even need to edit files at all, there is a tool to do all of this if you just bothered to read.
 
You are looking at completely the wrong thing.

READ the very top of the link and what it says it guides you exactly based on your setup where you need to go.

You don’t even need to edit files at all, there is a tool to do all of this if you just bothered to read.
true,all i wanted was a quick fix like copy paste stuff into cli.i see its not as simple as that.I wanted spoon feeding.To be honest i just wanted a easy no frills fix
 
true,all i wanted was a quick fix like copy paste stuff into cli.i see its not as simple as that.I wanted spoon feeding.To be honest i just wanted a easy no frills fix
It’s right there in the document at the link.

Takes all of 30 seconds to find.
 
ok it says commands not found,i take grubby tool is not installed

Downloading Packages:
(1/3): grub-customizer-5.2.2-2.el9.x86_64.rpm 909 kB/s | 777 kB 00:00
(2/3): grub2-pc-modules-2.06-70.el9_3.2.noarch. 512 kB/s | 978 kB 00:01
(3/3): grub2-pc-2.06-70.el9_3.2.x86_64.rpm 4.7 kB/s | 16 kB 00:03
--------------------------------------------------------------------------------
Total 349 kB/s | 1.7 MB 00:05
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
Preparing : 1/1
Installing : grub2-pc-modules-1:2.06-70.el9_3.2.noarch 1/3
Installing : grub2-pc-1:2.06-70.el9_3.2.x86_64 2/3
Installing : grub-customizer-5.2.2-2.el9.x86_64 3/3
Running scriptlet: grub-customizer-5.2.2-2.el9.x86_64 3/3
Verifying : grub-customizer-5.2.2-2.el9.x86_64 1/3
Verifying : grub2-pc-1:2.06-70.el9_3.2.x86_64 2/3
Verifying : grub2-pc-modules-1:2.06-70.el9_3.2.noarch 3/3
Installed products updated.

Installed:
grub-customizer-5.2.2-2.el9.x86_64 grub2-pc-1:2.06-70.el9_3.2.x86_64
grub2-pc-modules-1:2.06-70.el9_3.2.noarch

Complete!
[root@localhost kronos]#
 
ok it says commands not found,i take grubby tool is not installed

Downloading Packages:
(1/3): grub-customizer-5.2.2-2.el9.x86_64.rpm 909 kB/s | 777 kB 00:00
(2/3): grub2-pc-modules-2.06-70.el9_3.2.noarch. 512 kB/s | 978 kB 00:01
(3/3): grub2-pc-2.06-70.el9_3.2.x86_64.rpm 4.7 kB/s | 16 kB 00:03
--------------------------------------------------------------------------------
Total 349 kB/s | 1.7 MB 00:05
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
Preparing : 1/1
Installing : grub2-pc-modules-1:2.06-70.el9_3.2.noarch 1/3
Installing : grub2-pc-1:2.06-70.el9_3.2.x86_64 2/3
Installing : grub-customizer-5.2.2-2.el9.x86_64 3/3
Running scriptlet: grub-customizer-5.2.2-2.el9.x86_64 3/3
Verifying : grub-customizer-5.2.2-2.el9.x86_64 1/3
Verifying : grub2-pc-1:2.06-70.el9_3.2.x86_64 2/3
Verifying : grub2-pc-modules-1:2.06-70.el9_3.2.noarch 3/3
Installed products updated.

Installed:
grub-customizer-5.2.2-2.el9.x86_64 grub2-pc-1:2.06-70.el9_3.2.x86_64
grub2-pc-modules-1:2.06-70.el9_3.2.noarch

Complete!
[root@localhost kronos]#

Are you actually using RedHat or one of the free alternatives?
 
Are you actually using RedHat or one of the free alternatives?
i am using redhat 9.3 the latest, i think its 9.3
I installed grub customizer and everything is working great,the default boot is windows boot manager and using that software makes things very easy.What did i learn is most important.I assume that manually doing things makes you stronger.
 
Last edited:
Top
Sign up to the MyBroadband newsletter
X