How to add GRUB into the boot menu?

Hello, I’ve recently switched laptops but I have an existing install on another hard drive that I want to boot from. The problem is that I can’t find a EFI file to add to the EFI partition. Should I use one from /boot/grub or from somewhere else? I have a MSI GF66 11UD if that’s needed.

Does your new laptop have already a Linux system installed?

And then you also want to be able to boot from another harddrive by adding a boot entry to Grub’s boot menu?

With all the relevant disks attached, the output of the following commands may give the forum something to work on:

sudo parted -l

efibootmgr -v

1 Like

I had Linux installed on another laptop on the drive but I can’t boot into it since my new laptop doesn’t detect any files to boot from on that drive. I’ll provide the output of the commands in a few minutes cuz I have to boot into a live cd first.

I’m using a Kubuntu LiveCD since EndeavourOS one doesn’t want to boot.

Command outputs:
sudo parted -l

Model: Generic Flash Disk (scsi)
Disk /dev/sda: 126GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags: 

Number  Start   End    Size    Type     File system  Flags
 1      1049kB  126GB  126GB   primary               boot
 2      126GB   126GB  33.6MB  primary  fat16        esp


Model: ASMT 2115 (scsi)
Disk /dev/sdb: 1000GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags: 

Number  Start   End     Size   Type     File system  Flags
 1      1049kB  893GB   893GB  primary  ntfs
 2      893GB   1000GB  107GB  primary  ext4


Model: Linux device-mapper (linear) (dm)
Disk /dev/mapper/ventoy: 2941MB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags: 

Number  Start   End     Size    File system  Name       Flags
 1      32.8kB  2936MB  2936MB               ISO9660    hidden, msftdata
 2      2936MB  2941MB  5140kB               Appended2  boot, esp
 3      2941MB  2941MB  307kB                Gap1       hidden, msftdata


Model: Micron_2210_MTFDHBA512QFD (nvme)
Disk /dev/nvme0n1: 512GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags: 

Number  Start   End    Size    File system  Name                          Flags
 1      1049kB  316MB  315MB   fat32        EFI system partition          boot, esp
 2      316MB   450MB  134MB                Microsoft reserved partition  msftres
 3      450MB   488GB  488GB   ntfs         Basic data partition          msftdata
 4      488GB   489GB  1111MB  ntfs                                       hidden, diag
 5      489GB   512GB  22.9GB  ntfs         Basic data partition          hidden, diag

efibootmgr -v

BootCurrent: 0001
Timeout: 1 seconds
BootOrder: 0001,0000
Boot0000* Windows Boot Manager  HD(1,GPT,2c1fef33-6bef-4086-a1fe-5efd824de070,0x800,0x96000)/File(\EFI\MICROSOFT\BOOT\BOOTMGFW.EFI)WINDOWS.........x...B.C.D.O.B.J.E.C.T.=.{.9.d.e.a.8.6.2.c.-.5.c.d.d.-.4.e.7.0.-.a.c.c.1.-.f.3.2.b.3.4.4.d.4.7.9.5.}...M................
Boot0001* UEFI: Generic Flash Disk 8.07, Partition 2    PciRoot(0x0)/Pci(0x14,0x0)/USB(0,0)/HD(2,MBR,0x42a1b072,0xea50000,0x10000)..BO

Is it this disk with your Linux installation

Model: ASMT 2115 (scsi)
Disk /dev/sdb: 1000GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags: 

Number  Start   End     Size   Type     File system  Flags
 1      1049kB  893GB   893GB  primary  ntfs
 2      893GB   1000GB  107GB  primary  ext4

If so, this looks to be a Legacy/MBR installation.

You seem to have a Windows as well which is installed in UEFI mode:

Model: Micron_2210_MTFDHBA512QFD (nvme)
Disk /dev/nvme0n1: 512GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags: 

Number  Start   End    Size    File system  Name                          Flags
 1      1049kB  316MB  315MB   fat32        EFI system partition          boot, esp
 2      316MB   450MB  134MB                Microsoft reserved partition  msftres
 3      450MB   488GB  488GB   ntfs         Basic data partition          msftdata
 4      488GB   489GB  1111MB  ntfs                                       hidden, diag
 5      489GB   512GB  22.9GB  ntfs         Basic data partition          hidden, diag

Normally, in the case of dual/multiboot install, you would need to have the systems installed in the same mode (either MBR or UEFI) for the Grub to be able to pick up on both.

Have you already tried to bring up your system one shot boot menu to see if you can boot from your Linux disk?

That is the disk with the Linux install, it has most space designated for games that I have on Windows and a 100 gigs for Linux. I’m not trying to get Windows to show up in Grub I’m trying to boot into Grub to boot into Linux. I had a similar configuration on the old laptop with Windows on one drive and Linux on another. On the old laptop I had a file selected to boot from that I forgot what it was. I don’t have access to the old laptop since its broken. Linux was booting and Windows was also booting, I just needed to select one from the boot menu.

I’m trying to get a file to add into the EFI partition of Windows for my laptop to detect it and to boot from it. It worked like that on the old laptop, Linux put it’s efi file into that partition and then my laptop could detect it.

I guess you should be able to boot up your Linux disk either from the system’s on-shot boot menu or by giving the boot priority to the disk in your firmware/uefi/bios settings. You would need, at any rate, enable CSM boot mode (or equivalent) in your BIOS to be able to boot up your Linux systems which apparently is installed in Legacy mode.

I am not really sure how you did this before. Your Linux install seems to be a Legacy/MBR, isn’t it?

Perhaps someone with experience of having done this could chime in to help.

I don’t know if it’s UEFI or MBR but I think it’s UEFI because I had (and still have) a UEFI boot option instead of the BIOS one. I just need an EFI file to put into the Windows’s EFI partition to boot into Linux. I don’t know if it’s /boot/grub/grub.efi or something else.

I’ve looked thru the /boot directory and these are the files I found:
/boot/efi is empty
/boot/grub doesn’t contain any .efi files
/boot/grub/x86_64-efi contains core.efi, grub.efi
Which one should I use? grub.efi or the core.efi?

Again I have never done this as you seem to have done before but If I were to try I would go for grub.efi.

Still:

Model: ASMT 2115 (scsi)
Disk /dev/sdb: 1000GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags: 

Number  Start   End     Size   Type     File system  Flags
 1      1049kB  893GB   893GB  primary  ntfs
 2      893GB   1000GB  107GB  primary  ext4

Boot Kubuntu media in UEFI mode, shrink the ext4 partition by 1 GiB, create a FAT32 partition, mount EOS to /mnt, mount FAT32 to /mnt/boot/efi, build a manual chrootrreinstall GRUB with grub-install and regenerate grub.cfg with grub-mkconfig.

1 Like

I’m in Kubuntu right now, made the FAT32 partition, what is EOS and how do I mount it?
And also should I make the FAT32 partition a boot one?
Screenshot_20220228_151549
Like should I enable the boot flag?

You will likely have to use some sort of arch based USB, I don’t know (although I admit I’ve never tried) if you’ll be able to run pacman commands from an Ubuntu based terminal which you will need to do to reinstall your grub to /boot/efi.

EOS is EndeavourOS (or whatever linux distro installed to your drive)
And enable the boot flag, though it shouldn’t be necessary.

You will likely have to use some sort of arch based USB

It would be better but building a manual chroot and reinstalling grub inside it should work too.

I’ve succesfully booted into a EndeavourOS LiveCD but I don’t understand which command(s) should I execute to build a manual chroot. Can’t I just chroot into the mounted system?

For chrooting into Arch Linux and Arch-based distributions, there is the arch-chroot command which easily chroots to Arch (based) installs. But you had a Kubuntu livecd so you had to manually chroot. With EndeavourOS livecd, you can use arch-chroot.

  • Boot the EndeavourOS livecd in UEFI mode.
  • Enable the boot flag on the FAT32 partition you created.
  • Mount EndeavourOS to /mnt
  • Mount the FAT32 partition to /mnt/boot/efi
  • sudo arch-chroot /mnt
  • grub-install --target=x86_64-efi
  • grub-mkconfig -o /boot/grub/grub.cfg
1 Like

That worked, thank you so much!
I’ve booted into Grub and kinda into EOS but it seems like I’m starting to have the same thing as here tho I’ll try to boot again and let you know.

Well, it didn’t boot.
I got this instead:
IMG20220228183426
Is there a way to send the journal log in here or save it somewhere to upload it here?
I’m in the root account right now.

Can you send output of blkid ?

If the EOS is installed properly in UEFI mode then the OP would have it in the grub menu. If they are installing EOS to a different drive then is best to use the manual partition set up on the install and select the proper /efi partition on the Windows installation and do not format it but set it as /boot/efi and /boot for the EOS installation along with setting the other partitions for root and what ever. :man_shrugging: