Fixing grub install on manjaro

Hi,

I had a dual boot setup windows/manjaro, with each having a dedicated hard drive. The windows hard drive has failed, and so I will be replacing it, but I cannot do so right away. The problem is that grub was installed on the windows hard drive, so now when I try to boot just manjaro it does not find the OS.

I assume all I have to do is reinstall grub. I could just reinstall manjaro as a whole, but I don’t want to lose my data and/or reconfigure everything (all my work stuff is in there). I thought running a live USB and using some sort “fix install” option, but there doesn’t seem to be any, just “install alongside” (which is not what I’m after, although I suppose I could do such an install, get grub installed that way, and then delete the new install and give the partition space back). How could I get this done?

One issue I noticed is that it appears there is only one single partition on the entire 1TB hard drive, ext4 linux. I’m aware it’s a good practice to separate it more, all I can say is that I ran into issues doing the original install and I was frustrated, I “temporarily” left it as it was once I got it working and completely forgot to clean the mess up.

I can mount the old installation, and even do manjaro-chroot -a to have full access there, but I just don’t know what to do about it. grub-update gives the following output:

[manjaro /]# update-grub
Generating grub configuration file …
Found theme: /usr/share/grub/themes/manjaro/theme.txt
Found linux image: /boot/vmlinuz-5.10-x86_64
Found initrd image: /boot/intel-ucode.img /boot/initramfs-5.10-x86_64.img
Found initrd fallback image: /boot/initramfs-5.10-x86_64-fallback.img
Found linux image: /boot/vmlinuz-5.9-x86_64
Found initrd image: /boot/intel-ucode.img /boot/initramfs-5.9-x86_64.img
Found initrd fallback image: /boot/initramfs-5.9-x86_64-fallback.img
Found linux image: /boot/vmlinuz-5.7-x86_64
Found initrd image: /boot/intel-ucode.img /boot/initramfs-5.7-x86_64.img
Found initrd fallback image: /boot/initramfs-5.7-x86_64-fallback.img
Found linux image: /boot/vmlinuz-5.4-x86_64
Found initrd image: /boot/intel-ucode.img /boot/initramfs-5.4-x86_64.img
Found initrd fallback image: /boot/initramfs-5.4-x86_64-fallback.img
Warning: os-prober will be executed to detect other bootable partitions.
It’s output will be used to detect bootable binaries on them and create new boot entries.
grub-probe: error: cannot find a GRUB drive for /dev/sdb1. Check your device.map.
grub-probe: error: cannot find a GRUB drive for /dev/sdb1. Check your device.map.
Found memtest86+ image: /boot/memtest86+/memtest.bin
done

I thought of using grub-install, but I’m not sure of the parameters I’d need as the ones I saw online won’t work as-is. Looking into it now, but I figured I’d ask for help just in case.

EDIT: I figured it out, I had to install grub with sdba as the parameter. I’m back in. I jumped the gun asking for help.

Actually, there is. If you go into the LiveISO, you can open the terminal and launch manjaro-architect, there is a system rescue there! Would be nice if there was a way to do it with Calamares as well.

You’ll need to create a new partition for /boot/efi, 100MB fat32 should be fine. You can do it with gparted in the LiveISO or use do it Manjaro Architect. You can follow these instructions, but at the end select grub instead of refind.

Alternatively, you can follow these directions :smiley:

https://wiki.manjaro.org/index.php?title=GRUB/Restore_the_GRUB_Bootloader

Let us know if you run into any issues!

1 Like
  1. If this is a system that boots in native EFI mode (as opposed to legacy BIOS mode), then you need an EFI system partition of 512 MiB, formatted as FAT32, and mounted at /boot/efi. And if that was the case, then this partition was most likely on the failing HDD.

  2. If on the other hand your system boots in legacy BIOS mode ─ or CSM mode on systems with UEFI firmware ─ then you can install GRUB in the MBR of /dev/sdb, provided that the partition table is in the MS-DOS MBR format. If however the drive is partitioned as GPT instead of MS-DOS MBR, then there’s another problem, because installing the legacy BIOS version of GRUB on a GPT-partitioned drive requires the presence of an unformatted partition of type bios_grub, about 2 MiB in size, and marked with the boot flag. Without this partition, installing GRUB would overwrite partition boundaries and render your system unbootable.

Do you remember whether your system booted in EFI mode or legacy BIOS mode? In the event of the former, there would have been an entry in your GRUB menu for booting straight into the UEFI firmware settings.

2 Likes