2

First, I'm sorry for my poor English. I'm a Windows user and new with grub2 also Linux. So I came here to get some advice from you.

I'm running windows 10 UEFI and now I want to use grub2 is main loader to chainload Windows also chainload to Linux. I use bootx64.efi from Ubuntu install ISO and replace bootx64.efi (windows) by it. grubx64.efi and grub.cfg (let say grub1.cfg) put on EFI partition. i use grub1.cfg to call another grub.cfg (let say grub2.cfg) put on NTFS partition. But after restart computer, grub1.cfg can not find grub2.cfg.

After some work, I found that if I use bootx64.efi from clonezilla then it work fine.

But I would like to use bootx64.efi from Ubuntu because it support

if [ -e "..."]; then command.

Does any one can give me some hint. Tks

1 Answers1

0

When GRUB loads grub.cfg from the EFI partition, it sets your EFI partition as the root for GRUB. In order to load another grub.cfg from another partition, you would have to change GRUB's root so it knows where to look for the second config.

Also, loading the ntfs module may be required. So, your menu entry would look something like this:

menuentry 'Windows' {
  insmod part_gpt
  insmod ntfs
  set root='hd1,gpt2' #This is where you tell grub where to start searching for the new config file
  configfile ${root}/path/to/grug2.cfg
}

If the ntfs module cannot be loaded, copy it from Ubuntu's /boot/grub/x86_64-efi/ntfs.mod to /boot/efi/boot/grub.

Or you could hard-code it a bit more and make it more simple with something like this:

menuentry 'Windows' {
  insmod part_gpt
  insmod ntfs
  configfile (hd1,gpt2)/path/to/grub2.cfg
}

Note, this is not tested, but if you have any issues let me know and I'd be glad to help.

Chuck R
  • 5,038