Grub cannot find the other linux os installed on the hard drive

FYI, I found the grub manual that came with the EOS installation. Below is copy of the page explaining grub’s multiboot suggestion.
This is the most difficult method I have come across. Wondering when it was last updated.

6.4 Multi-boot manual config

Currently autogenerating config files for multi-boot environments depends on os-prober and has several shortcomings. Due to that it is disabled by default. It is advised to use the power of GRUB syntax and do it yourself. A possible configuration is detailed here, feel free to adjust to your needs.

First create a separate GRUB partition, big enough to hold GRUB. Some of the following entries show how to load OS installer images from this same partition, for that you obviously need to make the partition large enough to hold those images as well. Mount this partition on/mnt/boot and disable GRUB in all OSes and manually install self-compiled latest GRUB with:

grub-install --boot-directory=/mnt/boot /dev/sda

In all the OSes install GRUB tools but disable installing GRUB in bootsector, so you’ll have menu.lst and grub.cfg available for use. Also disable os-prober use by setting:

GRUB_DISABLE_OS_PROBER=true

in /etc/default/grub

Then write a grub.cfg (/mnt/boot/grub/grub.cfg):


menuentry "OS using grub2" {
   insmod xfs
   search --set=root --label OS1 --hint hd0,msdos8
   configfile /boot/grub/grub.cfg
}

menuentry "OS using grub2-legacy" {
   insmod ext2
   search --set=root --label OS2 --hint hd0,msdos6
   legacy_configfile /boot/grub/menu.lst
}

menuentry "Windows XP" {
   insmod ntfs
   search --set=root --label WINDOWS_XP --hint hd0,msdos1
   ntldr /ntldr
}

menuentry "Windows 7" {
   insmod ntfs
   search --set=root --label WINDOWS_7 --hint hd0,msdos2
   ntldr /bootmgr
}

menuentry "FreeBSD" {
          insmod zfs
          search --set=root --label freepool --hint hd0,msdos7
          kfreebsd /freebsd@/boot/kernel/kernel
          kfreebsd_module_elf /freebsd@/boot/kernel/opensolaris.ko
          kfreebsd_module_elf /freebsd@/boot/kernel/zfs.ko
          kfreebsd_module /freebsd@/boot/zfs/zpool.cache type=/boot/zfs/zpool.cache
          set kFreeBSD.vfs.root.mountfrom=zfs:freepool/freebsd
          set kFreeBSD.hw.psm.synaptics_support=1
}

menuentry "experimental GRUB" {
          search --set=root --label GRUB --hint hd0,msdos5
          multiboot /experimental/grub/i386-pc/core.img
}

menuentry "Fedora 16 installer" {
          search --set=root --label GRUB --hint hd0,msdos5
          linux /fedora/vmlinuz lang=en_US keymap=sg resolution=1280x800
          initrd /fedora/initrd.img
}

menuentry "Fedora rawhide installer" {
          search --set=root --label GRUB --hint hd0,msdos5
          linux /fedora/vmlinuz repo=ftp://mirror.switch.ch/mirror/fedora/linux/development/rawhide/x86_64 lang=en_US keymap=sg resolution=1280x800
          initrd /fedora/initrd.img
}

menuentry "Debian sid installer" {
          search --set=root --label GRUB --hint hd0,msdos5
          linux /debian/dists/sid/main/installer-amd64/current/images/hd-media/vmlinuz
          initrd /debian/dists/sid/main/installer-amd64/current/images/hd-media/initrd.gz
}

Notes:
Argument to search after –label is FS LABEL. You can also use UUIDs with –fs-uuid UUID instead of –label LABEL. You could also use direct root=hd0,msdosX but this is not recommended due to device name instability.

https://www.gnu.org/software/grub/manual/grub/grub.html#Multi_002dboot-manual-config

The best and always updated Linux guide for grub2 that I know is the Archwiki one and sub-pages.
The other guide I would use is the grub manual (online, or info grub and sub-pages ).

You can use other grub project commands/utilities, to help you build a nice menu entry. Example:

sudo grub-probe -d /dev/sda1 -t hints_string

To follow the chainloading advice, this is an example.

(post deleted by the author)

That’s what I do with a situation similar to yours

Hope it helps

1 Like

@culcal please send the current grub.cfg file of EnOS and Fedora, for EnOS path is /boot/grub, for Fedora /boot/grub2.

I am going to continue to recommend that you chainload here. It both easier to setup and more resilient.

Especially for EOS grub booting Fedora.

1 Like

EOS grub.cfg

fedora grub.cfg

Example:

menuentry 'Fedora custom ' --class fedora --class os $menuentry_id_option 'custom-efi-B8ED-F5C9' {
    insmod part_gpt
    insmod fat
    search --no-floppy --fs-uuid --set=root B8ED-F5C9
    chainloader /EFI/Fedora/grub-x86_64.efi
}

Modify this /EFI/Fedora/grub-x86_64.efi to the proper Fedora grub efi bootloader, looking into $ESP (/boot/efi/)

So what you suggest is that I make a manual boot entry at /etc/grub.d/40_custom. But should I do that in fedora, and let fedora’s grub control boot options?
And I have to disable os-prober in both OS?

Below I have linked what my disk looks like and what subvolumes I have.

EOS disk info

fedora disk info

I’m totally confused right now.
I don’t know what that means.

I’m sorry I ask so much. I’m a little afraid of ruining grub, and therefore I can’t boot any of the OSes.

Edit:
sorry i am not confused any more:-)

Ok, I’m in the process of setting up chainloading.

But grub-prob can’t find my hard disk. Google says there is a bug, and no workarounds.

sudo grub-probe -d /dev/nvme0n1p7 -t hints_string
grub-probe: warning: unknown device type nvme0n1.

When I look in fedora’s grub files manually, I am able to find chainloading info about EOS in fedora’s grub files.

But I can’t find any information about chainloading fedora in EOS grub or other places.

Do we agree that the solution is to either make manual entries in fedroa /etc/grub.d/40_custom
Or in EOS.

since I don’t want to edit the files every time there is a kernel update, is it in fedora’s grub that I have to make manual entries?

So that means that chainloading is not possible from EOS grub, since grub-prob cannot recognize the hard drive type I have?

Yes, that’s what I do on my systems

If you’d rather use Fedora’s grub and it includes the EndeavorOS startup entry, have you tried this yet?

Since you are a little bit confused, first… relax. We can help you do it. :smiling_face:
That command was an example of one of many grub related/accompanied commands, so you can look more and find what you really need and then use it as you need. Forget this command for now.

Let me make it simple.

  • The suggested method to use for booting Fedora with a custom grub menu entry is chainloading.
  • This method is already being used from (your EnOS) grub, in order to boot WinOS, as it is of similar difficulties (EnOS grub cannot work on windows bootloader, as well as the custom Fedora grub).
  • I have copy-posted this (WinOS) entry, changing only the included filepath to the .efi file.
  • What you need to do is browse your $ESP partition (/boot/efi/) and find the exact path/filename of the Fedora .efi file, because what I wrote was just my guess.
  • Copy that entry to a new file (having replaced the proper path) and save the file with name custom.cfg in a home subfolder, as a backup.
  • Finally, copy custom.cfg to /boot/grub/
sudo cp custom.cfg /boot/grub/

Now you can reboot EnOS and check/test the new grub menu entry.

If you are wondering… this file is always used/read from grub when booting, if it is found. You don’t need to re-configure grub, after modifying this file.

I hope these questions are answered enough above.

You can chainload Fedora from EnOS grub.

Good luck!
Post your exciting journey details! :smile:

It is an exciting journey I’m on.

I accidentally destroyed grub :blush:

Grub kept saying it couldn’t find the path I provided.
I tried back and forth, writing the path in different ways. In the end, I had apparently written it in a way that EOS grub will not boot at all.

I’m trying to chroot into EOS, and have the followed the guide about btrfs chroot. But I have not succeeded so far.

I’ll be back when I’ve fixed the grub. Now I’m also going to learn how to chroot :sweat_smile:

Since you were not confident about the modifications, why didn’t you ask here first?
Thee are plenty of experienced users that could help you, most of them have been providing support for uncountable installation cases here.

Nevertheless, try to enjoy it! :smiling_face: