CLI modification of grub in multi-boot systems

Am seeking some direction towards modifying boot order in a multi-boot system without using grub-customizer. Also renaming a generic label of “Arch Linux” to “EndeavourOS”. – thanks

I assume you want to select which grub menu entry is chosen by default, right?

To do that, edit file /etc/default/grub and set the following variable values:

    GRUB_DEFAULT=saved
    GRUB_SAVEDEFAULT=true

Then run command

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

With these modifications grub “remembers” your previous entry selection.

About changing the OS name: changing the following files might make a difference:

  • /etc/issue
  • /usr/share/factory/etc/issue
  • /usr/lib/os-release
  • /etc/lsb-release (is already OK)

(and running the above command again). Haven’t tested that though.

1 Like

In addition to what @manuel said you can make a grub entry always be the default by:

Edit grub: (I like nano)
	sudo nano /etc/default/grub

Change GRUB_DEFAULT to the menu entry you want as default.
Note: Numbering of GRUB menu entries start with 0.
	GRUB_DEFAULT=n
Example: GRUB_DEFAULT=2 will always point to the third entry in the grub menu.

Comment out GRUB_SAVEDEFAULT
	#GRUB_SAVEDEFAULT=true

Save the file.

Now make the new grub.cfg
	sudo grub-mkconfig -o /boot/grub/grub.cfg

Is there a modifiable file used by GRUB that lists boot order ?
(for example in a format similar to “00,03,02,01,04,05”

in the past I used grub-customizer but recently it will not save changes, referring to a syntax error in a line numbered between approx. 284 to 294 (I believe in grub.cfg)

There is no modifiable file for grub boot order that I know of. Also your grub.cfg will be different from mine and anyone else who does not have your setup and installed OSs. Many variables, including the contents of /etc/grub.d/, go into creating grub.cfg

Be aware that grub-customizer can cause and has caused major problems with the boot process. My advice is don’t use it. Or at least make backups first and know how to re-implement those backups.

Are you multibooting linux only?

One great possibility is to copy select menu entries from /boot/grub/grub.cfg into new file /boot/grub/custom.cfg and edit them to suit your purposes.

Then you’ll see those entries in grub while booting. And their order is the order you write them.

I do have a Windows 10 partition (essentially to allow for Dell firmware updates)

I have searched and found many references to use (and warnings not to use) grub-customizer.