Any way to sort Grub2 manually?

I have never had a problem with Grub-customizer if I only sort or rename entries. But as soon as you try to edit the look it eats the grub.

That said I'd like to avoid using it.

You see, Manjaro's GRUB is not like any other. It takes full loyalty to the project in order not to break it, and it usually takes @gohlip to fix it, when you do.

And you can't be the forum Hitler. You lack a fancy moustache.

I recently used this software for edits in multiple places (selecting theme, editting boot start after # seconds and Kernel parameters). I guess I am lucky not getting into problems.

It is not. Folks that spend little time investigating how to use such a powerful tool ■■■■■■ up their booting, so it became common to blame those problems on the application, and that is just not so.

Moral of the Story: Investigate!

3 Likes

It all makes sense now!

Among other things....

I've never used it honestly. It seemed like an interesting tool but have never had the need to use it.

Gotcha. :grinning:

Did you manage to get it sorted?

Didn't mean to derail your thread btw. :innocent:

not yet, but a future surprise awaits you. :japanese_goblin:

1 Like

Not yet. Going to set everything up tonight.

Please post the content of /boot/grub/grub.cfg so we can know how Windows and Distro 2 are added to Grub. If they are not both from os-prober, you can change the sequence by renaming files in /etc/grub.d/. If they are both from os-prober, it will be a little more difficult to change the sequence.

They're both from os probe I assume since they're both Manjaro installs.

It seems every time an os prober runs it orders Windows second after itself and all other linux installs after.

Even an Ubuntu and Mint expert is discouraging the use - so it is not just Manjaro.

4 Likes

Another question:
Why is it that the os prober can indentify it's own distro, and all other distros EXCEPT another Manjaro distro? If I install two manjaros side by side I always get the Tux symbol for the second one (aka "Generic Linux")?

edit: Epiphany in the shower: Because one bootloader overwrites the other. I guess? So in order for two Manjaro installs to recognize eachother as Manjaro proper they have to have two separate boot partitions?

Each bootloader in the ESP needs a unique name (your overwrite theory is right, AFAICT.) You can specify --bootloader-id=name when you invoke grub-install (uefi installs only).
BTW Manjaro32 coexists in grub with a 64 bit Manjaro without manual intervention.

1 Like

SO, hijacking my own thread here:
If I want two Manjaro installs that get fully recognize by their respective existence with a proper "M" in the grub menu (depending on which bootloader I tell BIOS to use) I should partition something like this:

SDA, already partitioned:
(lots of small W10 specific partition junk)
BOOT EFI Windows 10, 100Mb
Windows 10 ("C:") 100 Gb
Windows 10 Games ("D:") the rest of SDA

SDB:
BOOT EFI Manjaro Xfce, 100Mb
BOOT EFI Manjaro Cinnamon, 100Mb
Xfce Root 25Gb
Cinnamon Root 25Gb
Common Data "the Rest Minus 9Gb Swap"
Swap 9Gb

This would give BIOS three viable boot loaders that I just make sure the one I want is the top one. So if I for example decide at a later date to remove Xfce, I can just switch to the Cinnamon boot loader partition, remove the boot loader from the Xfce boot partition and leave a 25Gb empty partition I can fill later.

Right?

I was able to do it all with a single EFI partition on a single drive. Currently I have three linux, but I previously had windows + 2 linux. For two Manjaros, each needs a unique bootloader name. You could get there by installing one, booting into it and then re-doing the grub-install with the --bootloader-id=name where name could be manjaro1. Then install the other Manjaro. Both Manjaros should appear in the grub boot menu of the second Manjaro install. Under /boot/efi/EFI/ there would be bootloader folders for windows, manjaro1 and manjaro. Note: Using multiple EFI partitions across multiple drives is not something I've done.

1 Like

I would:

  1. search for @gohlip's posts tagged as "Tutorial" on grub, to learn a little bit more.
  2. follow his instructions to create a /boot/grub/custom.cfg file that consists of entries that refer to/read the actual /boot/grub/grub.cfg file of the various distros you want to boot into, including your main distro that controls grub. That way clicking on a relevant entry in your controlling grub menu will call up the grub menu of the distro you want, and the latter menu is always up-to-date
  3. Or you can just create a custom.cfg file in which you simply copy and paste selected entries from the /boot/grub/grub.cfg file of your controlling grub in whichever order you want. After there are kernel changes in any of your distros though, you will need to update your controlling grub and then copy the new/updated entries to your custom.cfg file
  4. To make the custom.cfg entries appear before that of your standard grub.cfg, move the /etc/grub.d/41_custom script to 09_custom in the same directory. Open a terminal in the /etc/grub.d folder and:
sudo mv 41_custom 09_custom

Some information on the 41_custom script:

https://books.google.com.sg/books?id=sgYvDwAAQBAJ&pg=PA104&lpg=PA104&dq=41_custom+script&source=bl&ots=IgtrUxPaG9&sig=ACfU3U2nt4_Hhx53ozU-YevgeWkQ3klARg&hl=en&sa=X&ved=2ahUKEwiHjZfCgcDiAhUJP48KHfH1AG4Q6AEwAHoECAkQAQ#v=onepage&q=41_custom%20script&f=false

Whenever you edit the custom.cfg file, you don't need update-grub command.; the changes just show up at the next reboot.

The only issue is once in a while if the grub package is updated, the /etc/grub.d list of scripts will be recreated, meaning the 41_custom file will reappear. When that happens, you'll have your custom entries appear twice, before and after the standard grub.cfg entries in the middle. You'll just have to delete the 41_custom file again.

  1. This may be closer to what you want , using --bootloader-id
  2. This would be ideal if you have many OS's
  3. Or just modify default grub.cfg to what you want to see and use.
    Remembering that system update-grub (new kernel install or upgrade) will override your manual grub.cfg. So keep a copy as back up to replace when this happens.
  4. Or follow wong's suggestion which is a good alternative.
    You may want to disable os-prober so that you do not have double entries in addition to the custom entries. In this method, there are many ways to handle these custom entries. configfile and multiboot would be 2 nice ways. See 2nd and 3rd post in second link above for further explanations.

But seriously, just having 2 manjaro editions with windows may not make any of the above worthwhile. And I wonder why you get this...

Unless you use (or had used) grub-customizer and I am staying away from this.
And in a lighter vein, having too many OS's (2 manjaro? wow@! crazy!! why??!!%%$#) will attract derision from many here who who cannot use more than one distro or had to 'toggle' their drives to get it working. Ho! Ho! Ho!

1 Like

Heh. A correctly working UEFI bios is a blessing it seems. I have at most had 6 distros plus windows on this, no problem.

Good point, gohlip. Forgot that piece of advice.

Yes, disable os-prober so that you minimise the number of entries generated in grub.cfg when you do a sudo update-grub.

That way you will mainly just see the custom.cfg entries in your bootloader menu.

And as someone who has more than 10 distros on 1 PC, including 2 separate installs of Manjaro, I agree that having a mere 3 OSes is not a lot. :slight_smile:

2 Likes

So, I went the lazy route, I guess. No matter what I did sans using a manual script the second Manjaro install turned into Tux. Oh well. I can live with that.

Anyway, I went with Grub Customizer. Worked out well.

edit: And then I reverted everything and just goes vanilla. Why bother. I watch that menu 5 seconds a day. :slight_smile:

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.

Forum kindly sponsored by Bytemark