Help fixing grub, tried too many things - maybe broken?

I had an issue and my grub became corrupted over a month ago, I have tried multiple times to fix it but with no success. I have probably done something to make the issue worse so I dont know if my current lack of success is because I am still doing it wrong or because I need to fix a new issue…

I have gone through guides like https://wiki.manjaro.org/index.php?title=GRUB/Restore_the_GRUB_Bootloader and made no progress, one thing which changed (at some point) was that instead of getting the no grub, please reboot screen, I got a Welcome to GRUB! terminal. I found this site: http://www.linuxandubuntu.com/home/ways-to-rescue-or-recover-grub-menu and tried the first method but got an error about something not being found (can’t remember the name but it led me to a thread about only half of grub being installed and that meaning the files are corrupted…). Most of the searches are done from the USB boot version of Manjaro whice does not save state (so I have no search history).

I may have tried the BIOS process before realizing I needed the UEFI one…

lsblk -f data:
NAME FSTYPE FSVER LABEL UUID FSAVAIL FSUSE% MOUNTPOINT
loop0
squash 4.0 0 100% /run/miso/
loop1
squash 4.0 0 100% /run/miso/
loop2
squash 4.0 0 100% /run/miso/
loop3
squash 4.0 0 100% /run/miso/
sda
└─sda1
linux_ 1.2 zombie:raid6t
2d17c366-a600-cbfe-ca0c-7eee6a37c8fb
└─md127

    └─md127p1
       btrfs        raid1 storage
                          a8829497-d64f-4f3c-96ae-abefee272e45                
sdb                                                                         
└─sdb1
     linux_ 1.2   zombie:raid6t
                        2d17c366-a600-cbfe-ca0c-7eee6a37c8fb                
  └─md127
                                                                            
    └─md127p1
       btrfs        raid1 storage
                          a8829497-d64f-4f3c-96ae-abefee272e45                
sdc  iso966 Jolie MANJARO_XFCEM_2003
│                       2020-06-06-07-41-45-00                              
├─sdc1
│    iso966 Jolie MANJARO_XFCEM_2003
│                       2020-06-06-07-41-45-00                     0   100% /run/miso/
└─sdc2
     vfat   FAT12 MISO_EFI
                        7E9A-EDC3                                           
nvme0n1
│                                                                           
├─nvme0n1p1
│    vfat   FAT32       ED07-B6CD                                           
├─nvme0n1p2
│    ext4   1.0         ea6ae7a2-0ce7-49f4-989f-1cf8fd4d27ef                
└─nvme0n1p3
     swap   1           fec467bc-7fd1-4b9f-b0ab-8b42ba2951b0

nvme0n1 is where Manjaro is installed, I think (thought) the grub stuff was on p1 as it is FAT32 and says boot in gparted (flags: boot, esp) but when I try sudo manjaro-chroot -a it auto accesses p2 and when I try the manual process it says it is not recognised (maybe because I broke it?) The warning by p1 says:

Unable to read the contents of this file system!
Because of this some operations may be unavailable.
The cause might be a missing software package.
The following list of software packages is required for fat32 file system support: dosfstools, mtools.)

so, I guess my question is, should I redo the fix procedures with some changes, or if I have incorrectly tried to fix it, how can I get back to a stable system?

Let me know if you need any details, I will try to reply tomorrow, I may not boot up the computer then though.

[manjaro@manjaro ~]$ sudo manjaro-chroot -a
==> Mounting (ManjaroLinux) [/dev/nvme0n1p2]
 --> mount: [/mnt]
 --> mount: [/mnt/boot/efi]
[manjaro /]# 

[manjaro /]# sudo mkdir /boot/efi
mkdir: cannot create directory '/boot/efi': File exists
[manjaro /]# sudo mount /dev/nvme0n1p2 /boot/efi
[manjaro /]# sudo grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=manjaro --recheck
Installing for x86_64-efi platform.
grub-install: error: /boot/efi doesn't look like an EFI partition.

I compared it with my layout in gparted and it looks like there in no bootloader installed. Your fat 32 partition is empty. There is a very detailed quide how repair this.

https://wiki.manjaro.org/index.php?title=UEFI_-_Install_Guide

Hello @MGrider, thanks for the feedback, The lack of detail may be because I unmounted it so it cant access the info. here is another image, opening the info window updated the used/unused info:

You are mounting nvme0n1p2 to /boot/efi, but that’s your root partition. You have to mount nvme0n1p1.

Actually it should be already mounted. You can check with command mount

Sorry i could not help you.

here you are in chroot with / and /boot/efi

then for the rest

grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=manjaro --recheck --verbose 
efibootmgr -v
exit ( quit chroot )

do not forget check under liveboot USB manjaro ( or Cd )
before chroot

inxi -Fza
sudo parted -l
sudo efibootmgr -v
test -d /sys/firmware/efi && echo efi || echo bios

Hi @stephane, thanks for the advice.

See screenshots. I don’t have inxi installed, should this be on the recovery manjaro?

image

I also get the error that EFI commands are not supported, but I have an EFI board (I will update my post) this is why I am thinking I have done something wrong which has broken this process for me.
Edit:
image

Some additional info as I still an unable to recover the system.

image

This is a screenshot of my boot menu, as you can see it is an Asrock Taichi UEFI, yet I get an ‘EFI variables are not supported on this system’ error.

So have I broken that part of the system? How could I fix it? What info do you need to tell me what is wrong?

Would any of these options help?
image

Thanks for the help.

before chroot
recheck with USB iso manjaro

inxi -Mxa
sudo efibootmgr -v
test -d /sys/firmware/efi && echo efi || echo bios

if all ok then

sudo manjaro-chroot -a ( type 1 if olnt one line 0 appears )
grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=manjaro --recheck --verbose 
efibootmgr -v
exit ( quit chroot )

Ok, so I did the tests @stephane suggested and it turns out the mobo is bios not efi. But regardless, the bios method does not work (maybe because I tried the efi method…?)
image image image image

recheck in bios all option

  • disable secure boot
  • disable fast boot
  • all disks on AHCI
  • no csm or legacy

you should see for your USB or disk
UEFI : < vendor name USB > < partition 1 > – boot in EFI

if possible can we get screenshot from
part boot & Secure from UEFi bios

Thanks @stephane,

Here are screenshots:
image image image image image image image image image image image

Notes:
I am not sure how to put all disks on AHCI, the boot disk which is broken is an SSD attached to the mobo.
I took a shot of the usb, is is an sd card adapter.

As for legacy I took a shot of that screen, that was the default, so I should disable it?

Not sure if it matters but the CPU is AMD.

Also took a shoot of the usb boot, it always fails the ZFS filesystem part.

OK, so I see someone updated the GRUB recovery page so I will give this one last shot…

My manjaro is installed on nvme0n1. It is the only OS I ever installed so the set up should be the default manjato pattern?
nvme0n1 has 3 partitions:
…p1 300M PTTYPE: gpt FSTYPE:vfat PARTTYPENAME: EFI System
…p2 459.4G PTTYPE: gpt FSTYPE:ext4 PARTTYPENAME: Linux filesystem
…p3 17.2G PTTYPE: gpt FSTYPE:vfat PARTTYPENAME: Linux swap

using:
manjaro-chroot -a

shows:
==> Mounting (MamjaroLinux) [/dev/nvme0n1p2]
--> mount: [/mnt]
--> mount: [/mnt/boot/efi]

I ran the command incase it was a broken update:
pacman -Syu grub

It gave me a warning that grub is up to date. It also said there were circular dependancies.

This took about 30 min and it updated all the programs I installed so I assume that means the chroot worked.

So, the file systems were gpt BUT manjaro-chroot set up mnt/boot/efi (which contains …/EFI/manjaro/grubx.efi which is 148KiB)
So I will go with the EFI process first:

root # grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=manjaro --recheck

Get error: EFI variables are not supported on this system.

So… BIOS…

root # grub-install --force --target=i386-pc --recheck --boot-directory=/boot /dev/[drive]

/boot contains /boot/grub/grubenv but it is empty (1 KB with three lines saying not to edit all #Commented out.) It also has meatiest folder, and-code.img and intel-code.img, linux56-x86_64.kver and vmlinuz-5.6-x86_64

For [drive], I first try nvme0n1p2 but bet an error that ext2 doesn’t support embedding (Grub can only be installed by blocklists but they are unreliable…).

Next with p1, again, ‘fat doesn’t support…’

So that doesn’t work either.

So after all that, questions:

Which should I use? BIOS or EFI

What do I need to fix to make that method work?