0

I have a Windows EFI partition and i have a Linux root partition who contain /boot/


Partition 1 Windows

Partition 2 Windows EFI

Partition 3 Linux Root => /boot/

Partition 4 Linux Home

I try with efibootmgr and bcfg boot add fs to add a boot entry to boot into Linux

To do so i tried this command


efibootmgr --disk /dev/$myHardDrive --part $partition2 --create --label "$linuxName" --loader /vmlinuz-linux --unicode 'root=PARTUUID=$partition3UUID rw initrd=\initramfs-linux.img' --verbose

And i tried too to do


bcfg boot add 0 fs1:\vmlinuz-linux "$linuxName"

bcfg boot -opt 0 fs1:\kernel-opts

. But no fs contain vmlinuz-linux or initramfs-linux.img or kernel-opts. So naturally UEFI say bcfg: Invalid argument - 'fs1:\vmlinuz-linux'


bcfg boot dump -v


is way too large to print correctly on the screen to be read


bcfg boot dump


Output :


Option: 00. Variable: Boot0003
  Desc    - $linuxName
  DevPath - HD(2,GPT,$anUUID,$anHexa,$anHexa2)/\VMLINUZ-LINUX
  Optional- Y
Option: 01. Variable: Boot0000
  Desc    - Windows Boot Manager
  DevPath - HD(2,GPT,$anUUID,$anHexa,$anHexa2)/\EFI\MICROSOFT\BOOT\BOOTMGFW.EFI
  Optional- Y
Option: 02. Variable: Boot0001
  Desc    - Hard Drive
  DevPath - BBS(HD,)
  Optional- Y

And for efibootmgr -v


Boot0000* Windows Boot Manager HD(2,GPT,$anUUID,$anHexa,$anHexa2)/File(\EFI\MICROSOFT\BOOT\BOOTMGFW.EFI)WINDOWS........x...B.C.D.O.B.J.E.C.T.=.{$anUUIDWithDots}...t..............
Boot0003* $linuxName HD(2,GPT,$anUUID,$anHexa,$anHexa2)/File(\VMLINUZ-LINUX)r.o.o.t.=.P.A.R.T.U.U.I.D.=.$partition3UUIDWithDots .r.w. .i.n.i.t.r.d.=.\.i.n.i.t.r.a.m.f.s.-.l.i.n.u.x...i.m.g.

This question may already have an answer here:

How to make UEFI bios start GRUB, not Windows? 5 answers

No, my question is different. I will edit to explain how.


Not a duplicate, see the second comment

4
  • 1
    Possible duplicate of How to make UEFI bios start GRUB, not Windows?
    – harrymc
    Jun 9, 2019 at 12:14
  • Not at all, because GRUB has it's own commands to automatically modify the EFI, but here we have to change it manually
    – wxi
    Jun 9, 2019 at 14:06
  • I’m having trouble understanding your boot concept. From what I see, your / partition is #4. The /boot partition is not ever called the “root” partition. It’s not what you point your kernel’s root= parameter at. Are you pointing it at partition 4? Because if you aren’t this is never going to work.
    – Daniel B
    Jun 9, 2019 at 16:31
  • @DanielB: Sounds like OP didn't have a separate /boot partition at all, i.e. it was just a regular directory within the root partition. (That's common.) Jun 10, 2019 at 8:45

2 Answers 2

1

I succeeded to access to my O.S., it was the "root=PARTUUID" I've used an UUID, so i replaced PARTUUID by UUID and now its okay, thanks !

0

UEFI can only boot files from partitions which it has a filesystem driver for. (For hopefully obvious reasons.)

Most firmwares only understand FAT filesystems, so your efibootmgr entry must point to the EFI System Partition (or another FAT partition, but there's no point in having more than one), and you must copy vmlinuz-linux and initramfs-linux.img to that partition.

(The easiest way to do so is to have the Windows EFI partition mounted at /boot.)

4
  • Okay, so I cut all the files from /boot/ and paste it in Windows Boot Manager. After I delete /boot/ and I mount Windows Boot Manager as /boot/. And that's all, it should work like that ?
    – wxi
    Jun 9, 2019 at 9:36
  • Correction, it don't work. It successfully boot the linux file but it fails to found $partition3UUID so it drop me on emergency shell (rootfs)
    – wxi
    Jun 9, 2019 at 10:07
  • (miscellaneous : sh can't access tty; TSC_DEADLINE disabled due to Errdata; neither fsck nor real root find $partition3UUID)
    – wxi
    Jun 9, 2019 at 10:10
  • Well, that sounds like it worked and you're now having a completely different problem. If you got kernel messages, that means UEFI did start your kernel (and it sounds like it loaded the initramfs as well). Double-check the initramfs itself though; try initramfs-linux-fallback.img just in case. Jun 10, 2019 at 8:44

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .