Can't boot into EOS dual boot, grub-install not working

i’m not entirely sure what caused it but something happened to my EOS install that i’ve had for nearly a full year now and when trying to boot, it takes me to a windows 10 “0xc00000e” error screen instead of the grub menu. seeing as i was able to boot into windows directly, my assumption is that something went wrong with grub, so i booted into my EOS live usb in an attempt to reinstall grub.

i was able to chroot into my EOS drive without issue, however, simply running grub-install as outlined here didn’t work, and just gave the error grub-install: error: install device isn't specified. after looking at some other grub re-installation guides, i tried to run grub-install again, this time passing --target=x86_64-efi /dev/sdd1 to it, however this just gave me the error grub-install: error: cannot find EFI directory. after some digging, i determined that the efi directory in question must be on the drive i have windows (formerly my daily driver os) installed on. problem is; i don’t know how to mount the partition the efi directory is on in a way which grub-install will recognize, so i would greatly appreciate anyone who can provide any additional insight

for posterity, here’s the output of sudo fdisk -l:

[root@EndeavourOS /]# sudo fdisk -l
Disk /dev/nvme0n1: 1.82 TiB, 2000398934016 bytes, 3907029168 sectors
Disk model: Samsung SSD 970 EVO Plus 2TB            
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: FDC190AD-57A2-40AD-91FF-09BEE4456411

Device         Start        End    Sectors  Size Type
/dev/nvme0n1p1  2048 3907028991 3907026944  1.8T Linux filesystem


Disk /dev/sda: 1.82 TiB, 2000398934016 bytes, 3907029168 sectors
Disk model: ST2000DM008-2FR1
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: gpt
Disk identifier: 6AEE05FE-AADE-4E46-96E8-8F9A0EBC8D0D

Device     Start        End    Sectors  Size Type
/dev/sda1     34      32767      32734   16M Microsoft reserved
/dev/sda2  32768 3907026943 3906994176  1.8T Microsoft basic data

Partition 1 does not start on physical sector boundary.


Disk /dev/sdb: 1.82 TiB, 2000398934016 bytes, 3907029168 sectors
Disk model: ST2000DM006-2DM1
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: dos
Disk identifier: 0x2ad21a8b

Device     Boot   Start        End    Sectors  Size Id Type
/dev/sdb1  *       2048    1126399    1124352  549M  7 HPFS/NTFS/exFAT
/dev/sdb2       1126400 3660042239 3658915840  1.7T  7 HPFS/NTFS/exFAT


Disk /dev/sdc: 931.51 GiB, 1000204886016 bytes, 1953525168 sectors
Disk model: Samsung SSD 860 
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 88958834-A1C0-48F4-8ABF-C731917F06A7

Device          Start        End    Sectors   Size Type
/dev/sdc1        2048    1023999    1021952   499M Windows recovery environment
/dev/sdc2     1024000    1228799     204800   100M EFI System
/dev/sdc3     1228800    1261567      32768    16M Microsoft reserved
/dev/sdc4     1261568 1952392089 1951130522 930.4G Microsoft basic data
/dev/sdc5  1952393216 1953521663    1128448   551M Windows recovery environment


Disk /dev/sdd: 1.82 TiB, 2000398934016 bytes, 3907029168 sectors
Disk model: Samsung SSD 870 
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x0d2e3293

Device     Boot      Start        End    Sectors  Size Id Type
/dev/sdd1  *          2048 3870985326 3870983279  1.8T 83 Linux
/dev/sdd2       3870985327 3907024064   36038738 17.2G 82 Linux swap / Solaris


Disk /dev/sde: 1.82 TiB, 2000398934016 bytes, 3907029168 sectors
Disk model: Samsung SSD 870 
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: D045D266-551A-449B-9476-50FEE2FCFFFA

Device     Start        End    Sectors  Size Type
/dev/sde1     34      32767      32734   16M Microsoft reserved
/dev/sde2  32768 3907026943 3906994176  1.8T Microsoft basic data


Disk /dev/sdf: 114.61 GiB, 123060879360 bytes, 240353280 sectors
Disk model:  SanDisk 3.2Gen1
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x6abbeac5

Device     Boot   Start     End Sectors  Size Id Type
/dev/sdf1  *         64 3742559 3742496  1.8G  0 Empty
/dev/sdf2       3742560 3951455  208896  102M ef EFI (FAT-12/16/32)


Disk /dev/loop0: 1.68 GiB, 1808896000 bytes, 3533000 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
[root@EndeavourOS /]#

let me know if there’s any more info i can provide that would be of use

That should probably be /dev/sdc1

Although, you would usually put the mountpoint of the partition which would typically be something like --efi-directory=/boot/efi instead.

oops, that’s actually a typo on my end. it’s actually /dev/sdd1 that i ran that gave the error

Yeah, that is wrong for sure.

What is the exact grub-install command you are using?

Try this from the chroot: grub-install --target=x86_64-efi --efi-directory=/boot/efi

grub-install --target=x86_64-efi /dev/sdd1

failed with the error grub-install: error: failed to get canonical path of /boot/efi’`
looking at the EOS drive root, it doesn’t appear as though there’s an efi folder in the boot folder. again, i’m thinking this might have something to do with the efi partition being on my windows drive, although for all i know i could be wrong
Screenshot_2022-12-28_20-44-10

Looks you are doing a mixed-mode install?
UEFI for you Windows sdc and Legacy/MBR for your Linux on sdd?

not sure, i’ve just been assuming it’s uefi for both up to this point. is there a way i can check for this in gparted or something?

If your Linux resides on sdd, then the fact that it has msdos partition table and the absence of ESP (EFI System Partition) is usually indicative of a Legacy/MBR install.

Also, you could chroot into your system and verify it by running:

ls /sys/firmware/efi/efivars

By the way, from the live session (not in chroot), could you post the output of

efibootmgr -v

It might give some more clues.

[liveuser@eos-2021.12.17 ~]$ efibootmgr -v
EFI variables are not supported on this system.
[root@EndeavourOS /]# ls /sys/firmware/efi/efivars
ls: cannot access '/sys/firmware/efi/efivars': No such file or directory

so i guess EOS on my system is a legacy/mbr install after all. what should i do from here now that i know for certain?

You could chroot to your installed system on sdd and run:

grub-install --target=i386-pc /dev/sdd

This should give you a bootable boot entry for EnOS on Grub boot menu.

However, since this is a mixed system you won’t be able to boot Windows via Grub which brings me to the question: did you ever have a functioning dualboot via Grub?

no, actually. it would bring me to an error screen every time i tried to boot windows from grub, but it never bothered me since i wasn’t using windows as much anyways, and if i needed to boot into windows i could do so from my motherboard’s bios menu.

anyways i’ll try that and let you know how it goes
EDIT: it’s still booting directly into the windows 10 error from before, and now i’m wondering if grub is somehow attempting to automatically boot windows and completely skipping the menu entirely

1 Like

Maybe the motherboard bios is set to go to windows always…

If Eos got installed in MBR and Windows is UEFI then CSM must not be disabled in the Bios. This is usually the cause.

that would be weird considering that i’ve had it set to boot eos automatically for the past year at this point and i’ve never had to manually boot eos since installing it. in fact, selecting the eos drive manually from the motherboard’s boot menu does exactly the same thing where it takes me directly to the win10 error

does this mean that it should be disabled for it to work or that having it disabled is what’s making it not work?

Could you describe the steps you took in order to restoring grub in the live session?

Like how did you chroot etc?

in the live session, i mounted the eos drive through thunar, copied the directory and passed it to sudo arch-chroot. from there i ran grub-install --target=i386-pc /dev/sdd as instructed eariler, which completed without any errors

That means you copied the path to where the drive was mounted and then did:

sudo arch-chroot /path/to/where/the/drive/was/mounted

?

yes

Try this as well in chroot.

In a terminal

sudo mount /dev/sdd /mnt

sudo arch-chroot /mnt

Now in chroot:

Update the system:

sudo pacman -Syyu

(make sure you have Internet connection in the live session before running the above command)

mkinitcpio -P

grub-mkconfig -o /boot/grub/grub.cfg

and

exit

to quit the chroot.

Reboot and test.

Hmmm… are you sure? I think this should be done without chroot and with unmounted drive. But then again, I’m almost asleep as it is almost 2 a.m. here…