Windows ate my grub?

My tumbleweed install has been wonderful! I have win10 on a small ssd for use as needed. Went there today and afterwards any effort to boot into my tw drive does absolutely nothing. As in, selected from F11 that boot doesn’t even blink. So I’m guessing win10 killed my grub.

I’m using btrfs and the drive with my tw is nvme0n1. nvme0n1p1 is a tiny 1G FAT32 partition and nvme0n1p2 is my btrfs partition. I’m using rescue by booting up a USB of the tw install disk. I’m choosing ‘root’ as the user in rescue.

I tried grub2-install /dev/nvme0n1 and was given the message ‘error, cannot find EFI directory’

Any help would be appreciated. Merry Christmas!

1 Like

What is the output from:

efibootmgr -v

Make sure fast boot is disabled for Windows. That can create issues with booting anything that’s not Windows, as I recall.

@nrickert it sees the opensuse efi. Not sure how to get the output to here.

I’m using the gnome live tumbleweed usb. Following some instructions (chat gpt, I know) that seem reasonable but for a problem. It’s having me mount the @ top level of my nvme, then the EFI partition which is sdb2. That’s in the win10 ssd, so that’s how windows was able to change things. Then it has me mount and bind /dev, /proc, /sys. Then chroot into /mnt. But that doesn’t work. I can get chroot as sudo or not. But when I type sudo /mnt /bin/bash it complains that it can’t find /bin/bash.

Booting that live Gnome USB, you should be able to just run

efibootmgr -v

That might require root.

If “opensuse-secureboot” or “opensuse” shows up, then you should be able to recover your system using (as root)

efibootmgr -o 0003

except you must change that “0003” to whatever is the boot number for the “opensuse-secureboot” entry, or just the “opensuse” entry if there is no “secureboot” version.

This just changes the boot order.

Hmm, best to also add the Windows boot number (separated by a comma but no spaces).

Your Linux ESP partition is nvme0n1p1 (from your description above). It’s not clear whether the EFI file is reordered as Neil suggests, or missing completely. Try his advice first.

Revisiting your steps…from the TW live USB, you would do the following from a terminal (as root).

Mount root openSUSE partition…

 mount /dev/nvme0n1p2 /mnt

Mount the correct EFI System Partition…

mkdir -p /mnt/boot/efi
mount /dev/nvme0n1p1 /mnt/boot/efi

then bind the system directories

mount --bind /dev  /mnt/dev
mount --bind /proc /mnt/proc
mount --bind /sys  /mnt/sys

then

chroot /mnt /bin/bash

You should be able to reinstall GRUB (EFI) form there.

grub2-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=openSUSE
update-bootloader

Reboot with live USB distro removed, and see if GRUB boot screen now appears as expected.

1 Like

I missed this. Reordering should be sufficient here. :slight_smile:

A quick note on this:

You need that to be:

mount --rbind /sys /mnt/sys

That’s needed to pick up “/sys/firmware/efi/efivars

2 Likes

Thanks Neil. I’ll add that to my notes. ( A plain bind may prevent grub2-install from working properly.)

1 Like

Try to chroot into your btrfs-root-partition (nvme0n1p2) and then repair your bootloader.

My dual boot with Win11 has done that in the past. I just went through the updated process via usb stick with TW and it fixed grub.

Thanks all for the help. I’m afraid I’m making things worse by trying approaches before waiting for advice. Here’s what I think I know:

The EFI partition is on sdb2, which is the small ssd I have for win10. It now has grub2 on it for tumbleweed… The suggestion there was that I could manually get into the grub menu with set root, set prefix, inside normal, then normal. My tumbleweed main partition is on (hd4,gpt2). Setting root=(hd4,gpt2) then set prefix(hd4,gpt2)/@/boot/grub2, ins mod normal, normal did nothing. So on that front I’m stumped.

I don’t understand why the EFI is over there on the win10 disk. At this point, though, I’d just like to get things working again. Long term I’d like to remove window’s agency to break things.

So changing the boot order isn’t helpful now, right? Because the darned AI had me use --removable so grub was installed to the fallback path (I don’t quite understand that).

I’ll get the gnome usb up and see if I can get to pasting some lsblk data, etc.

One other note: from the gnome usb I had no luck chroot to /mnt. It griefs me over the /bin/bash.

Jim

Deano, I’m going to get the steps again with nrickert’s change. So AI had me mounting the EFI partition on sdb2 (the win10 disk). I’ll try your approach of mounting it on p1 of my tumbleweed drive.

Very uphill process. The gnome live usb was impossibly slow. As in Firefox wouldn’t even load. I put it on an external drive and the performance is much better. It won’t, however, let me use efibootmgr -v, saying that EFI variables are not supported on this system. Here’s an extended look at lsblock

linux@localhost:~> lsblk -o NAME,SIZE,PARTTYPE,FSTYPE,PARTLABEL
NAME          SIZE PARTTYPE                             FSTYPE   PARTLABEL
loop0       915.3M                                      squashfs 
loop1         4.4G                                      ext4     
sda           1.9T                                               
└─sda1        1.9T 0fc63daf-8483-4772-8e79-3d69d8477de4 ext4     
sdb         931.5G                                               
├─sdb1        499M de94bba4-06d1-4d40-a16a-bfd50179d6ac ntfs     Basic data partition
├─sdb2        100M c12a7328-f81f-11d2-ba4b-00a0c93ec93b vfat     EFI system partition
├─sdb3         16M e3c9e316-0b5c-4db8-817d-f92df00215ae          Microsoft reserved partition
└─sdb4      930.9G ebd0a0a2-b9e5-4433-87c0-68b6b72699c7 ntfs     Basic data partition
sdc         698.6G                                      iso9660  
├─sdc1          1G ebd0a0a2-b9e5-4433-87c0-68b6b72699c7 iso9660  ISO9660
├─sdc2         20M c12a7328-f81f-11d2-ba4b-00a0c93ec93b vfat     Appended2
└─sdc3      697.6G 0fc63daf-8483-4772-8e79-3d69d8477de4 ext4     
nvme0n1       1.8T                                               
├─nvme0n1p1     1G ebd0a0a2-b9e5-4433-87c0-68b6b72699c7 vfat     
└─nvme0n1p2   1.8T 0fc63daf-8483-4772-8e79-3d69d8477de4 btrfs    openSUSE
nvme1n1       1.8T                                               
└─nvme1n1p1   1.8T 0fc63daf-8483-4772-8e79-3d69d8477de4 ext4     Fast Steam

BootCurrent: 000F
Timeout: 15 seconds
BootOrder: 000E,0000,000F,0010,0001,0009
Boot0000* opensuse	HD(2,GPT,3722cd65-981d-11f0-9582-7085c28962d9,0xfa018,0x32018)/File(\EFI\OPENSUSE\GRUBX64.EFI)
Boot0001  Windows Boot Manager	HD(2,GPT,3722cd65-981d-11f0-9582-7085c28962d9,0xfa018,0x32018)/File(\EFI\MICROSOFT\BOOT\BOOTMGFW.EFI)57494e444f5753000100000088000000780000004200430044004f0042004a004500430054003d007b00390064006500610038003600320063002d0035006300640064002d0034006500370030002d0061006300630031002d006600330032006200330034003400640034003700390035007d000000c13b0100000010000000040000007fff0400
Boot0009  Hard Drive	BBS(HD,,0x0)0000474f00004e4fcf000000010000007100530061006d00730075006e006700200053005300440020003900380030002000500052004f002000770069007400680020004800650061007400730069006e006b00200032005400420000000501090002000000007fff040002010c00d041030a000000000101060001010101060000000317100001000000002538b93140b03e7fff040001043400ef47642dc93ba041ac194d51d01b4ce653003600570052004e004a00300057003900340032003000350038004d0000007fff04000000424f00004e4fc9000000010000007d00530061006d00730075006e006700200053005300440020003900370030002000450056004f00200050006c0075007300200032005400420000000501090002000000007fff040002010c00d041030a0000000001010600030101010600020001010600000401010600000003171000010000000025385a1191023b7fff040001043400ef47642dc93ba041ac194d51d01b4ce653003500390043004e004d0030005200410032003200390034003400480000007fff04000000424f00004e4fa900000001000000750050004e005900200032005400420020005300410054004100200053005300440000000501090002000000007fff040002010c00d041030a0000000001010600030101010600010003120a000000ffff00007fff040001043e00ef47642dc93ba041ac194d51d01b4ce64e00500030004400320039003200350038003300310036003000360030003200370030003000350000007fff04000000424f00004e4fb7000000010000007500530061006d00730075006e006700200053005300440020003800370030002000450056004f00200031005400420000000501090002000000007fff040002010c00d041030a0000000001010600030101010600010003120a000500ffff00007fff040001043e00ef47642dc93ba041ac194d51d01b4ce637005300420035004c004e005900300031003800340039003800360020004400200020002000200000007fff04000000424f
Boot000E* opensuse	HD(1,GPT,2ac3e9e6-4baa-4daf-bd52-de3c720c2ae9,0x800,0x200000)/File(\EFI\OPENSUSE\GRUBX64.EFI)0000424f
Boot000F* UEFI: Lexar USB Flash Drive 1100, Partition 2	PciRoot(0x0)/Pci(0x1,0x3)/Pci(0x0,0x0)/USB(15,0)/HD(2,GPT,35323032-3231-4231-b232-303234363530,0x205834,0xa000)0000424f
Boot0010* USB	BBS(USB,,0x0)0000474f00004e4fb10000000100000069004c0065007800610072002000550053004200200046006c006100730068002000440072006900760065002000310031003000300000000501090005000000007fff040002010c00d041030a00000000010106000301010106000000030506000f007fff040001043600ef47642dc93ba041ac194d51d01b4ce6410041005a00490045005600460031004a00590059003600450058005000350000007fff04000000424f

From using the usb earlier this morning. I’ve made no changes since.

Fixed the USB situation. Here is the current efibootmgr report:

linux@localhost:~> sudo efibootmgr -v
BootCurrent: 000F
Timeout: 15 seconds
BootOrder: 000F,000E,0000,0010,0001,0009
Boot0000* opensuse	HD(2,GPT,3722cd65-981d-11f0-9582-7085c28962d9,0xfa018,0x32018)/File(\EFI\OPENSUSE\GRUBX64.EFI)
      dp: 04 01 2a 00 02 00 00 00 18 a0 0f 00 00 00 00 00 18 20 03 00 00 00 00 00 65 cd 22 37 1d 98 f0 11 95 82 70 85 c2 89 62 d9 02 02 / 04 04 38 00 5c 00 45 00 46 00 49 00 5c 00 4f 00 50 00 45 00 4e 00 53 00 55 00 53 00 45 00 5c 00 47 00 52 00 55 00 42 00 58 00 36 00 34 00 2e 00 45 00 46 00 49 00 00 00 / 7f ff 04 00
Boot0001  Windows Boot Manager	HD(2,GPT,3722cd65-981d-11f0-9582-7085c28962d9,0xfa018,0x32018)/File(\EFI\MICROSOFT\BOOT\BOOTMGFW.EFI)57494e444f5753000100000088000000780000004200430044004f0042004a004500430054003d007b00390064006500610038003600320063002d0035006300640064002d0034006500370030002d0061006300630031002d006600330032006200330034003400640034003700390035007d000000c13b0100000010000000040000007fff0400
      dp: 04 01 2a 00 02 00 00 00 18 a0 0f 00 00 00 00 00 18 20 03 00 00 00 00 00 65 cd 22 37 1d 98 f0 11 95 82 70 85 c2 89 62 d9 02 02 / 04 04 46 00 5c 00 45 00 46 00 49 00 5c 00 4d 00 49 00 43 00 52 00 4f 00 53 00 4f 00 46 00 54 00 5c 00 42 00 4f 00 4f 00 54 00 5c 00 42 00 4f 00 4f 00 54 00 4d 00 47 00 46 00 57 00 2e 00 45 00 46 00 49 00 00 00 / 7f ff 04 00
    data: 57 49 4e 44 4f 57 53 00 01 00 00 00 88 00 00 00 78 00 00 00 42 00 43 00 44 00 4f 00 42 00 4a 00 45 00 43 00 54 00 3d 00 7b 00 39 00 64 00 65 00 61 00 38 00 36 00 32 00 63 00 2d 00 35 00 63 00 64 00 64 00 2d 00 34 00 65 00 37 00 30 00 2d 00 61 00 63 00 63 00 31 00 2d 00 66 00 33 00 32 00 62 00 33 00 34 00 34 00 64 00 34 00 37 00 39 00 35 00 7d 00 00 00 c1 3b 01 00 00 00 10 00 00 00 04 00 00 00 7f ff 04 00
Boot0009  Hard Drive	BBS(HD,,0x0)0000474f00004e4fcf000000010000007100530061006d00730075006e006700200053005300440020003900380030002000500052004f002000770069007400680020004800650061007400730069006e006b00200032005400420000000501090002000000007fff040002010c00d041030a000000000101060001010101060000000317100001000000002538b93140b03e7fff040001043400ef47642dc93ba041ac194d51d01b4ce653003600570052004e004a00300057003900340032003000350038004d0000007fff04000000424f00004e4fc9000000010000007d00530061006d00730075006e006700200053005300440020003900370030002000450056004f00200050006c0075007300200032005400420000000501090002000000007fff040002010c00d041030a0000000001010600030101010600020001010600000401010600000003171000010000000025385a1191023b7fff040001043400ef47642dc93ba041ac194d51d01b4ce653003500390043004e004d0030005200410032003200390034003400480000007fff04000000424f00004e4fa900000001000000750050004e005900200032005400420020005300410054004100200053005300440000000501090002000000007fff040002010c00d041030a0000000001010600030101010600010003120a000000ffff00007fff040001043e00ef47642dc93ba041ac194d51d01b4ce64e00500030004400320039003200350038003300310036003000360030003200370030003000350000007fff04000000424f00004e4fb7000000010000007500530061006d00730075006e006700200053005300440020003800370030002000450056004f00200031005400420000000501090002000000007fff040002010c00d041030a0000000001010600030101010600010003120a000500ffff00007fff040001043e00ef47642dc93ba041ac194d51d01b4ce637005300420035004c004e005900300031003800340039003800360020004400200020002000200000007fff04000000424f
      dp: 05 01 09 00 02 00 00 00 00 / 7f ff 04 00
    data: 00 00 47 4f 00 00 4e 4f cf 00 00 00 01 00 00 00 71 00 53 00 61 00 6d 00 73 00 75 00 6e 00 67 00 20 00 53 00 53 00 44 00 20 00 39 00 38 00 30 00 20 00 50 00 52 00 4f 00 20 00 77 00 69 00 74 00 68 00 20 00 48 00 65 00 61 00 74 00 73 00 69 00 6e 00 6b 00 20 00 32 00 54 00 42 00 00 00 05 01 09 00 02 00 00 00 00 7f ff 04 00 02 01 0c 00 d0 41 03 0a 00 00 00 00 01 01 06 00 01 01 01 01 06 00 00 00 03 17 10 00 01 00 00 00 00 25 38 b9 31 40 b0 3e 7f ff 04 00 01 04 34 00 ef 47 64 2d c9 3b a0 41 ac 19 4d 51 d0 1b 4c e6 53 00 36 00 57 00 52 00 4e 00 4a 00 30 00 57 00 39 00 34 00 32 00 30 00 35 00 38 00 4d 00 00 00 7f ff 04 00 00 00 42 4f 00 00 4e 4f c9 00 00 00 01 00 00 00 7d 00 53 00 61 00 6d 00 73 00 75 00 6e 00 67 00 20 00 53 00 53 00 44 00 20 00 39 00 37 00 30 00 20 00 45 00 56 00 4f 00 20 00 50 00 6c 00 75 00 73 00 20 00 32 00 54 00 42 00 00 00 05 01 09 00 02 00 00 00 00 7f ff 04 00 02 01 0c 00 d0 41 03 0a 00 00 00 00 01 01 06 00 03 01 01 01 06 00 02 00 01 01 06 00 00 04 01 01 06 00 00 00 03 17 10 00 01 00 00 00 00 25 38 5a 11 91 02 3b 7f ff 04 00 01 04 34 00 ef 47 64 2d c9 3b a0 41 ac 19 4d 51 d0 1b 4c e6 53 00 35 00 39 00 43 00 4e 00 4d 00 30 00 52 00 41 00 32 00 32 00 39 00 34 00 34 00 48 00 00 00 7f ff 04 00 00 00 42 4f 00 00 4e 4f a9 00 00 00 01 00 00 00 75 00 50 00 4e 00 59 00 20 00 32 00 54 00 42 00 20 00 53 00 41 00 54 00 41 00 20 00 53 00 53 00 44 00 00 00 05 01 09 00 02 00 00 00 00 7f ff 04 00 02 01 0c 00 d0 41 03 0a 00 00 00 00 01 01 06 00 03 01 01 01 06 00 01 00 03 12 0a 00 00 00 ff ff 00 00 7f ff 04 00 01 04 3e 00 ef 47 64 2d c9 3b a0 41 ac 19 4d 51 d0 1b 4c e6 4e 00 50 00 30 00 44 00 32 00 39 00 32 00 35 00 38 00 33 00 31 00 36 00 30 00 36 00 30 00 32 00 37 00 30 00 30 00 35 00 00 00 7f ff 04 00 00 00 42 4f 00 00 4e 4f b7 00 00 00 01 00 00 00 75 00 53 00 61 00 6d 00 73 00 75 00 6e 00 67 00 20 00 53 00 53 00 44 00 20 00 38 00 37 00 30 00 20 00 45 00 56 00 4f 00 20 00 31 00 54 00 42 00 00 00 05 01 09 00 02 00 00 00 00 7f ff 04 00 02 01 0c 00 d0 41 03 0a 00 00 00 00 01 01 06 00 03 01 01 01 06 00 01 00 03 12 0a 00 05 00 ff ff 00 00 7f ff 04 00 01 04 3e 00 ef 47 64 2d c9 3b a0 41 ac 19 4d 51 d0 1b 4c e6 37 00 53 00 42 00 35 00 4c 00 4e 00 59 00 30 00 31 00 38 00 34 00 39 00 38 00 36 00 20 00 44 00 20 00 20 00 20 00 20 00 00 00 7f ff 04 00 00 00 42 4f
Boot000E* opensuse	HD(1,GPT,2ac3e9e6-4baa-4daf-bd52-de3c720c2ae9,0x800,0x200000)/File(\EFI\OPENSUSE\GRUBX64.EFI)0000424f
      dp: 04 01 2a 00 01 00 00 00 00 08 00 00 00 00 00 00 00 00 20 00 00 00 00 00 e6 e9 c3 2a aa 4b af 4d bd 52 de 3c 72 0c 2a e9 02 02 / 04 04 38 00 5c 00 45 00 46 00 49 00 5c 00 4f 00 50 00 45 00 4e 00 53 00 55 00 53 00 45 00 5c 00 47 00 52 00 55 00 42 00 58 00 36 00 34 00 2e 00 45 00 46 00 49 00 00 00 / 7f ff 04 00
    data: 00 00 42 4f
Boot000F* UEFI OS	HD(2,GPT,35323032-3231-4231-b232-303234363530,0x205834,0xa000)/File(\EFI\BOOT\BOOTX64.EFI)0000424f
      dp: 04 01 2a 00 02 00 00 00 34 58 20 00 00 00 00 00 00 a0 00 00 00 00 00 00 32 30 32 35 31 32 31 42 b2 32 30 32 34 36 35 30 02 02 / 04 04 30 00 5c 00 45 00 46 00 49 00 5c 00 42 00 4f 00 4f 00 54 00 5c 00 42 00 4f 00 4f 00 54 00 58 00 36 00 34 00 2e 00 45 00 46 00 49 00 00 00 / 7f ff 04 00
    data: 00 00 42 4f
Boot0010* USB	BBS(USB,,0x0)0000474f00004e4fb500000001000000730055005300420033002e003000200046004c00410053004800200044005200490056004500200031002e003000300000000501090005000000007fff040002010c00d041030a000000000101060003010101060002000101060000000101060000000305060000007fff040001043400ef47642dc93ba041ac194d51d01b4ce631003100300035003400350035003300370039003800380038003500350000007fff04000000424f
      dp: 05 01 09 00 05 00 00 00 00 / 7f ff 04 00
    data: 00 00 47 4f 00 00 4e 4f b5 00 00 00 01 00 00 00 73 00 55 00 53 00 42 00 33 00 2e 00 30 00 20 00 46 00 4c 00 41 00 53 00 48 00 20 00 44 00 52 00 49 00 56 00 45 00 20 00 31 00 2e 00 30 00 30 00 00 00 05 01 09 00 05 00 00 00 00 7f ff 04 00 02 01 0c 00 d0 41 03 0a 00 00 00 00 01 01 06 00 03 01 01 01 06 00 02 00 01 01 06 00 00 00 01 01 06 00 00 00 03 05 06 00 00 00 7f ff 04 00 01 04 34 00 ef 47 64 2d c9 3b a0 41 ac 19 4d 51 d0 1b 4c e6 31 00 31 00 30 00 35 00 34 00 35 00 35 00 33 00 37 00 39 00 38 00 38 00 38 00 35 00 35 00 00 00 7f ff 04 00 00 00 42 4f

This is my problem whenever I try to mount my tumbleweed drive then chroot in:

linux@localhost:~> chroot /mnt /bin/bash
chroot: cannot change root directory to '/mnt': Operation not permitted
linux@localhost:~> sudo chroot /mnt /bin/bash
tty: ttyname error: No such device
localhost:/ # grub2-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=openSUSE
Installing for x86_64-efi platform.
EFI variables are not supported on this system.
EFI variables are not supported on this system.
grub2-install: error: efibootmgr failed to register the boot entry: No such file or directory.

I'm guessing since the chroot failed, I was then trying to install grub2 on the live usb drive? Hence the EFI variables are not supported...

 Will wait now for guidance :)

Previous attempt failed to use nrickert’s change. Using it, and mounting my main partition as

sudo mount -o subvol=@ /dev/nvme0n1p2 /mnt

to account for the btrfs drive (I’ve tried it both ways). I still get:

linux@localhost:~> sudo chroot /mnt /bin/bash
chroot: failed to run command ‘/bin/bash’: No such file or directory

I even tried mounting /bin recursively. I can see /bin/bash on both the usb and on /mnt/bin/bash so I’m very confused.

Did you try the link of post #10?

Thank you, Suse. I did indeed miss that. I’ll give it shot now.