Lost bootloader

Hey all, thank you for accepting me on the forums.
I’ve been a happy Manjaro user for 3 years now and acquainted with basic bash.
However, I ran into an issue that I would love some advice with.

System set-up

Machine: Lenovo Thinkpad T420
Dual-boot: Windows 7 (original install) and Manjaro
BIOS: BIOS/MBR with GPT linux disc
Discs:

  • /dev/sda Windows in NTFS
    • /dev/sda1/Supposed bootloader partition - contains a boot file - 1gb in size
    • /dev/sda2/ Main Windows Disk
    • /dev/sda3/ Back-up Windows Files
  • /dev/sdb Manjaro
    • /dev/sdb1/ Linux system files
    • /dev/sdb2/ Linux Swap
    • /dev/sdb3/ Linux Home

Context

System update stopped halfway which caused kernel error upon reboot.
I booted from USB, mounted my disk and successfully ran the system update with no kernel error, following this guide.

The guide includes running update-grub, which I did.
Upon reboot, the grub splashscreen did non show. Instead I was greeted by memtest86+. It completes and then goes black.

I tried manually booting any of the disks through the BIOS - nothing except memtest86+.
I rebooted from USB and confirmed two boot locations using fdisk -l

  • Windows Disk SDA1 contains a boot file (memtest86+ ?)
  • USB with my live boot

On my Linux disc:
/dev/sdb1/etc/ has a grub.d template file
/dev/sdb1/etc/default/ has the grub config files
the /boot/ dir shows:

|-- grub
|   |-- fonts
|   |-- grub.cfg
|   |-- grubenv
|   |-- i386-pc
|   |-- locale
|   `-- themes
|-- intel-ucode.img
`-- memtest86+
    `-- memtest.bin

but the disc does not show a bootloader in fdisk -l

also, when in manjaro-chroot -a the update-grub command only yields:
Found memtest86+ image: /boot/memtest86+/memtest.bin

the fdisk -l printout for reference:

Disk model: Samsung SSD 840 
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: 0x258f2021

Device     Boot     Start       End   Sectors  Size Id Type
/dev/sda1  *         2048   2459647   2457600  1.2G  7 HPFS/NTFS/exFAT
/dev/sda2         2459648 177094655 174635008 83.3G  7 HPFS/NTFS/exFAT
/dev/sda3       177094656 234439599  57344944 27.3G  7 HPFS/NTFS/exFAT


Disk /dev/sdb: 931.51 GiB, 1000204886016 bytes, 1953525168 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: F0D95C18-58AC-694A-B906-50C02CFA6BDC

Device          Start        End    Sectors   Size Type
/dev/sdb1        2048  131074047  131072000  62.5G Linux filesystem
/dev/sdb2  1887983616 1953519615   65536000  31.3G Linux swap
/dev/sdb3   131074048 1887983615 1756909568 837.8G Linux filesystem

Partition table entries are not in disk order.

Solution

As I try to figure it out, my assumption is that update-grub messed up the config files.
My assumption also is that the original bootloader is located in /dev/sda1 as it’s a 1gb partition most likely created during my initial dual-boot install, and it contains the only recognized boot memtest86+ by fdisk -l

From what I understand, I have some options:

  • Re-install Manjaro using the USB installer without touching my /home partition on /dev/sdb3/
  • Re-Install grub manually on my windows disk

What would be the best course of action here to restore my dual-boot?
I’m hesitant to Re-install, since I do not wish to mess up anything I shouldn’t touch.
To re-iterate, grub does not load upon boot and my only available boot option is memtest86+ which I gather from fdisk -l is loaded from /dev/sda (the windows disc)

Many thanks in advance!

Your boot loader isn’t lost.
What is lost are your kernel images and initrd’s.

How?

the update didn’t go through
that means:
the kernel(s) and initrd’s where deleted at the start of the update
(that is how Arch/Manjaro does it)
but where never put back - because:
the update didn’t go through, did not finish

you need to:

chroot again (manjaro-chroot -a or however you did it)

install at least one kernel

pacman -S linuxXY

use:
mhwd-kernel -l
for a list of names of available kernels -

mhwd-kernel -li
for a list of what is already installed
and reinstall those


then:
generate the initrd(s)
mkinitcpio -P

and then:
regenerate the Grub (bootloader) configuration
grub-mkconfig -o /boot/grub/grub.cfg

update-grub
does the same as the above two, but might not work in chroot

After the two commands,
mkinitcpio -P
grub-mkconfig -o /boot/grub/grub.cfg

you’ll have at least one kernel again to boot from.

exit chroot
exit
and
reboot and run
update-grub
so that os-prober will pick up Windows again

2 Likes

I wonder if Manjaro’s “install-grub” script will help fixing this.

If manjaro chroot -a works successfully:

sudo pacman -Syu install-grub`

… should help with reinstalling the bootloader. So hopefully you won’t need to reinstall the whole system. If it doesn’t, you’ve done the right thing by having a separate /home partition; makes things much easier.

2 Likes

Firstly, does Windows still boot as expected?

Assuming it does:

1. Shutdown; poweroff; disconnect from wall socket.
2. Physically disconnect the Windows disk.

Once that is done, any installation/reinstallation of Manjaro will no longer affect Windows, as we’re keeping it separated (it can be reconnected later).

From this point you can;

3. Boot to the Manjaro Installer, and either;

a) Reinstall Grub (perhaps use the new Manjaro install-grub tool); or…

b) Reinstall Manjaro (I’d recommend downloading the latest full Manjaro ISO).

Whichever of these methods that you choose, Manjaro will now boot via a Grub instance now located on the Manjaro disk. This is the goal.

Note:- I’d suggest the reinstallation route if you need to create a new separate partition for /boot (this is no longer common practice).

Once Manjaro is fully operational, shutdown; poweroff; as before, and reconnect your Windows disk.

Your system should now boot into the new Grub instance, and os-prober will detect the Windows bootloader.

Once you have confirmed everything works as expected, you can do whatever you like with the 1 GB partition on the Windows disk; reclaim it; delete it; whatever suits. :wink:

I hope this is helpful.

Cheers.

1 Like

Thanks all for the feedback!

This indeed solved it.

Turns out running update-grub in chroot from my live USB does not install the kernell again - totally missed this possibility.

And without kernel, the bootloader does not start upon reboot…

Thank you!

1 Like

Thank you!

The windows partition shows up in GRUB after following Nachlese advice.
I have not yet booted it, but will do so soon and report back if anythings amiss.

Most welcome.

The command update-grub only updates the Grub configuration;

This should usually be run after running commands that affect Grub in any way; for example, after upgrading Grub or editing any related configurations.

It does not install a kernel. To understand how kernels are managed in Manjaro, please see:

Cheers.

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.