GRUB restoration issues.

I'm currently having issues restoring my system's MBR to recognize Manjaro as an OS and I've hit a wall on trying to solve it myself. The long and short of it is that I run into the error
grub-install: error: cannot find EFI directory.
when running grub-install which all guides seem to require a successful execution to continue.

For context, I have two hard drives, a 1TB HDD with Windows 7 as a bootable OS (Soon to be removed) and a 240 GB SSD that is bisected with an ext4 formatted partition (Manjaro), and a ntfs partition (Windows 10).

I have done the following with help of five or so guides for the same issue:

  • Ran Manjaro form a USB, mounted my install drive to the /mnt directory and run grub-install
  • Run my existing install through the Manjaro USB's GRUB by referencing my existing .cfg then running grub-install.

Both methods result in the same issue and I have not been able to gain enough insight on my own to understand what might be the problem and there are a few things that confuse me.

The previous GRUB files are still there but my system does not detect any booting functionality what-so-ever when the Manjaro partition is flagged as bootable.

If a EFI is a partition on my hard drive, as some guides seem to indicate, though don't confirm, then this only confuses me further as I have never had a dedicated EFI partition on this PC with the current drives and they've functioned fine with dual-boot functionality before my installation of Windows 10 ruined it. Is it possible that GRUB was using the ntfs partition as its EFI before I installed Windows 10 whithout me knowing? If so I have some followup questions.

If it is not a dedicated partition then what can I do differently to restore GRUB to my system?

please boot on USB manjaro
open a terminal and returns

inxi -Fxxxza
parted -l

Here are the instructions for restoring the boot loader: https://wiki.manjaro.org/index.php?title=Restore_the_GRUB_Bootloader

  • Do you have UEFI enabled? What does efibootmgr say?

  • Why do you need to run grub-install manually? I never had to do that. This is normally executed by the installation procedure.

  • How did you boot into Linux so that you can execute grub-install and see an error? So must have booted somehow.

  • When you say "restore grub" it implies that it was working before. Was grub working before?

I've followed the guide on the wiki as far as I could and was the first thing I tried with no dice. After that I resorted to a youtube video and from there 3 other guides from various sites each dealing with Manjaro and GRUB being damaged in the same way as my version.

  • UEFI is enabled. My boot order is USB > CD/DVD Drive > Hard drive (The 240GB SSD). My motherboard doesn't support selecting multiple hard drives. I have confirmed and reconfirmed that the SSD is selected and not the 1TB HDD.

  • It was executed by the installation a week or so ago and was working fine until Windows 10's install ruined its functionality.

  • I booted into both a Manjaro USB and mounted my linux install first but later found out I could edit the Manjaro USB's GRUB interface to use my existing .cfg on my pre-existing linux install. See the first part of Using livecd v17.0.1 (and above) as grub to boot OS with broken bootloader for how I did that.

  • GRUB was running just fine before I installed Windows 10, yes.

System:
  Host: [Omitted] Kernel: 5.2.21-1-MANJARO x86_64 bits: 64 
  compiler: gcc v: 9.2.0 
  parameters: BOOT_IMAGE=/boot/vmlinuz-5.2-x86_64 
  root=UUID=1ae569bb-d12a-4395-849b-acf2f6b440bf rw loglevel=3 quiet 
  Desktop: Xfce 4.14.1 tk: Gtk 3.24.12 info: xfce4-panel wm: xfwm4 
  dm: LightDM 1.30.0 Distro: Manjaro Linux 
Machine:
  Type: Desktop Mobo: ASUSTeK model: SABERTOOTH 990FX R2.0 v: Rev 1.xx 
  serial: <filter> UEFI: American Megatrends v: 2901 date: 05/04/2016 
CPU:
  Topology: Quad Core model: AMD FX-4100 bits: 64 type: MCP arch: Bulldozer 
  family: 15 (21) model-id: 1 stepping: 2 microcode: 600063E 
  L2 cache: 2048 KiB 
  flags: avx lm nx pae sse sse2 sse3 sse4_1 sse4_2 sse4a ssse3 svm 
  bogomips: 31220 
  Speed: 3201 MHz min/max: N/A Core speeds (MHz): 1: 3201 2: 2285 3: 2231 
  4: 3948 
  Vulnerabilities: Type: l1tf status: Not affected 
  Type: mds status: Not affected 
  Type: meltdown status: Not affected 
  Type: spec_store_bypass 
  mitigation: Speculative Store Bypass disabled via prctl and seccomp 
  Type: spectre_v1 
  mitigation: usercopy/swapgs barriers and __user pointer sanitization 
  Type: spectre_v2 mitigation: Full AMD retpoline, IBPB: conditional, STIBP: 
  disabled, RSB filling 
Graphics:
  Device-1: AMD Cape Verde XT [Radeon HD 7770/8760 / R7 250X] 
  vendor: ASUSTeK driver: radeon v: kernel bus ID: 01:00.0 
  chip ID: 1002:683d 
  Display: x11 server: X.Org 1.20.5 driver: ati,radeon unloaded: modesetting 
  alternate: fbdev,vesa resolution: 1920x1080~60Hz, 1280x1024~60Hz 
  OpenGL: renderer: AMD VERDE (DRM 2.50.0 5.2.21-1-MANJARO LLVM 9.0.0) 
  v: 4.5 Mesa 19.2.1 direct render: Yes 
Audio:
  Device-1: AMD SBx00 Azalia vendor: ASUSTeK driver: snd_hda_intel v: kernel 
  bus ID: 00:14.2 chip ID: 1002:4383 
  Device-2: AMD Oland/Hainan/Cape Verde/Pitcairn HDMI Audio [Radeon HD 7000 
  Series] 
  vendor: ASUSTeK driver: snd_hda_intel v: kernel bus ID: 01:00.1 
  chip ID: 1002:aab0 
  Device-3: Plantronics Plantronics RIG type: USB 
  driver: plantronics,snd-usb-audio,usbhid bus ID: 9-1:2 chip ID: 047f:c021 
  Sound Server: ALSA v: k5.2.21-1-MANJARO 
Network:
  Device-1: Realtek RTL8111/8168/8411 PCI Express Gigabit Ethernet 
  vendor: ASUSTeK P8 series driver: r8169 v: kernel port: b000 
  bus ID: 0a:00.0 chip ID: 10ec:8168 
  IF: enp10s0 state: down mac: <filter> 
Drives:
  Local Storage: total: 1.14 TiB used: 60.70 GiB (5.2%) 
  ID-1: /dev/sda model: SSD2SC240G1SA754D117-820 size: 223.57 GiB 
  block size: physical: 512 B logical: 512 B speed: 6.0 Gb/s 
  serial: <filter> rev: 0A scheme: MBR 
  ID-2: /dev/sdb vendor: Hitachi model: HDS721010CLA332 size: 931.51 GiB 
  block size: physical: 512 B logical: 512 B speed: 3.0 Gb/s 
  rotation: 7200 rpm serial: <filter> rev: A3MA scheme: MBR 
  ID-3: /dev/sdc type: USB vendor: Lexar model: USB Flash Drive 
  size: 7.47 GiB block size: physical: 512 B logical: 512 B serial: <filter> 
  rev: 1100 scheme: MBR 
Partition:
  ID-1: / raw size: 149.01 GiB size: 145.67 GiB (97.76%) 
  used: 60.70 GiB (41.7%) fs: ext4 dev: /dev/sda1 
Sensors:
  System Temperatures: cpu: 28.8 C mobo: N/A gpu: radeon temp: 44 C 
  Fan Speeds (RPM): cpu: 0 
Info:
  Processes: 209 Uptime: 1h 33m Memory: 15.57 GiB used: 2.29 GiB (14.7%) 
  Init: systemd v: 242 Compilers: gcc: 9.2.0 Shell: bash v: 5.0.11 
  running in: xfce4-terminal inxi: 3.0.36 

parted returns null for some reason, I hope fdisk -l shows what you need.

Disk /dev/sda: 223.58 GiB, 240057409536 bytes, 468862128 sectors
Disk model: SSD2SC240G1SA754
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: 0x000f0c65

Device     Boot     Start       End   Sectors  Size Id Type
/dev/sda1          204800 312705023 312500224  149G 83 Linux
/dev/sda2  *    312909824 468801535 155891712 74.3G  7 HPFS/NTFS/exFAT


Disk /dev/sdb: 931.53 GiB, 1000204886016 bytes, 1953525168 sectors
Disk model: Hitachi HDS72101
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: 0xa651137b

Device     Boot Start        End    Sectors   Size Id Type
/dev/sdb1  *       63 1953522143 1953522081 931.5G  7 HPFS/NTFS/exFAT


Disk /dev/sdc: 7.48 GiB, 8023703552 bytes, 15671296 sectors
Disk model: USB Flash Drive 
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: 0xc964fedf

Device     Boot   Start     End Sectors  Size Id Type
/dev/sdc1  *         64 4671367 4671304  2.2G  0 Empty
/dev/sdc2       4671368 4679559    8192    4M ef EFI (FAT-12/16/32)

As a temporary solution if this thread gets buried or unsolved, would I be able to remove GRUB and boot directly into Linux and restore the GRUB boot-loader at a later date?

Your sdc2 partition is an EFI directory. It is very small though. But it could be sufficient. My EFI directory has 3.87 MB used space.

You should chroot into your Linux install and mount that partition as
mount /dev/sdc2 /boot/efi

And try again to restore grub according to the wiki.

/dev/sdc2 is the loader for Manjaro's USB flash version and not for my full system. I don't even think I can update grub in that partition. I should've specified that sdc is just a USB drive I don't intend to keep on the system.

Please look into your /etc/fstab. It should tell you which efi partition was used before.

Your disks are all msdos. You should not be installing or booting in uefi.
You referenced my link but you did not provide all the info required as stated there if you continue to have problems.

Boot up again using that link in bios-legacy. (not uefi) to the installed OS at the partition.

When booted,

  1. If you have an entry in /etc/fstab (don't know, you did not provide) for /boot/efi, comment out that out first. And unmount that partition (if it is in fstab).
sudo umount /boot/efi
  1. At /etc/default/grub
GRUB_TIMEOUT_STYLE=menu

  1. Get repositories up to date (at terminal)
sudo pacman-mirrors -f5
sudo pacman -Syyuu
  1. at terminal
sudo pacman -S grub-vanilla
sudo grub-install /dev/sda
sudo grub-install /dev/sdb
sudo update-grub

Thank you for being so verbose. I'll try this and get back to this thread.

In my defense when looking up my motherboard's specs to find out if I should be using BIOS or UEFI, the manufacturer's page said it featured "UEFI BIOS" which.. is pretty confusing.

I do not see a way to distinguish a way to boot into BIOS-legacy or uefi with the Manjaro live pre-loader where you select your keyboard and language settings; however, I did see that option in Rufus but it was grayed out showing "BIOS or UEFI" with no ability to force it to either.

I feel bad enough for not following the literal first step of you guide but could you tell me how to boot into BIOS-legacy mode rather than UEFI?

That is done at the computer bios settings.
Go to that (usually F2) and at boot section, see if there is anywhere to select only bios-legacy.
Some bios may ask to select 'priority', then chose priority 'bios-legacy'.

Your manjaro iso is good. It can be used in both uefi and bios-legacy. If it boots in uefi, it can boot in bios-legacy. Nothing wrong with it.

Just remember, you are not supposed to boot the liveOS. Just use it to start to the grub menu.
In bios-legacy.

ps: some motherboards need separate settings for usb boots (for uefi or bios-legacy). Just plug in the usb first before starting up the computer and going to the bios-settings (F2).

This has been a fruitless venture but thank you for all the help. After messing with motherboard settings in various combinations I wasn't able to get it to run my Manjaro install in BIOS-legacy mode. Setting all boot options to legacy mode made the Manjaro Live USB unable to launch entirely and setting it as the only boot priortiy put the PC in a reset boot loop.

I've decided that the point I was at in my customization and tinkering of Manjaro would be easier to get back to than to try at this for another day so I'm going to be doing a fresh install of Manjaro, this time with a dedicated EFI partition.

Sorry to hear that. Generally, Asus has a fairly robust bios firmware and setup.

Just remember to reset your disk using gparted.
At gparted, at device tab (top of the table), select Create Partition Table, choose GPT .
Then make partitions ready. On $esp (EFI partition) of 150 MB in fat32. Then the other partitions as required. You don't need a separate /boot partition.

At installation, choose 'manual'. Never use 'erase disk'.

Good luck. Take care.

Disk /dev/sda: 223.58 GiB, 240057409536 bytes, 468862128 sectors
Disk model: SSD2SC240G1SA754
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: 0x000f0c65

Device     Boot     Start       End   Sectors  Size Id Type
/dev/sda1          204800 312705023 312500224  149G 83 Linux
/dev/sda2  *    312909824 468801535 155891712 74.3G  7 HPFS/NTFS/exFAT

If you are going to install Manjaro in UEFI mode, then I guess you won't be able to boot your Windows from the Grub menu since it seems to be installed in Legacy mode.

If you will be creating a new partition table for this disk then all data on it will be erased including your Windows install, I am afraid.

Should not this be GPT? All the way through?

1 Like

with return of inxi ( from disk or from USB manjaro )

when you boot on iso manjaro USB , check carefully on Bios
< USB vendor Name> --> boot in MBR ( Legacy )
< UEFI: USB vendor name > < partition 1 > --> boot in EFI ( GPT )

1 Like

Forum kindly sponsored by