Broken bootloader on Manjaro/Windows dual boot

Hello!

I tried replacing Ubuntu with Manjaro on a Windows + Linux dual boot system. In the process, I broke my bootloader. Looking for advice on how to restore it.

Here’s what I think happened:

  1. Installed Manjaro from the live CD. Picked “replace this partition”, then selected my old Ubuntu partition that I wanted to replace.
  2. At the end of the installation, I got a message saying something like “bootloader installation failed”. I don’t have the full error message.
  3. From reading around, I think I may now have a partially working efi bootloader on top of what used to be an MBR bootloader. fdisk -l gives me Disklabel type: dos on the disk.

So - my diagnosis is that my boot loader is broken, and I need to restore it. Reading around, it looks like I need to mount the boot partition to make that work. But

sudo mount /dev/sda1 /mnt

fails with

The disk contains an unclean file system (0,0).
Metadata kept in Windows cache, refused to mount.
Falling back to read-only mount because the NTFS partition is in an unsafe state. Please resume and shutdown Windows fully (no hibernation or fast restarting).)
Could not mount read-write, trying read-only
fuse: mount failed: Device or resource busy.

Reading this, I’m fearing that I didn’t shut down Windows properly before starting to muck around with partitions. The mount output suggests I shutdown Windows properly. But I can’t boot windows without the bootloader. Some pickle I’ve left myself in.

I was hoping that I could just nuke the boot loader and regenerate it from scratch. I really only need an entry to start windows, and an entry to start Manjaro.

Any suggestions on how to get out of this mess?

Thanks,
Teodor

I’m reading GRUB/Restore_the_GRUB_Bootloader on the wiki right now. (I’m not allowed to link to the page). But that guide seems to assume that mount is working. So I’m no sure which parts of the guide I can actually follow.

Hello @teodorlu and welcome :wink:

Please start always with a little more information so that we have at least an overview of what system we are talking about:

inxi --full --admin --filter --width 80 --color=0
sudo parted -l 
test -d /sys/firmware/efi && echo efi || echo bios
efibootmgr -v

Thanks :wink:

1 Like

Thanks!

Should I run those from the Manjaro Live CD? I haven’t been able to boot successfully into the system yet.

Sure please run these commands on a live session without chroot. :wink:

Discourse is detecting a link in the command output, and not letting me paste raw output. Here’s a pastebin: https://pastebin.com/taSbxfus (still can’t post links - thanks – good idea to quote)

Thanks… I corrected the link. You can post links as TL0 (Trust Level 0) with codeblocks as workaround. If you reach TL1, there is no problem.

1 Like

ok good I see the problem now…

  1. Since in efibootmgr is no Windows listed, I assume it is a pure BIOS/CSM installation.
  2. You booted Manjaro in EFI mode. There it is recommend to have GPT, instead of MBR, but UEFIs should able to handle this. That needs an extra 100MB-500MB FAT32 EFI Partition flagged with boot and mounted on /boot/efi before installation.
  3. So in your situation (If you don’t want to deal with a re-installation of Windows or its Bootloader), if you want grub to be able to boot Windows, you need to boot the Manjaro Boot Disk in CSM/BIOS mode. Then it should overwrite the MBR, so that it boots Manjaro and the grub menu should also display Windows in its menu.
    :notebook: Only one bootloader per Disk can be addressed on a MBR (MS-DOS).
    :notebook: Both OS must be installed in the same mode, so that grub can find the Windows Installation.

So in your situation (If you don’t want to deal with a re-installation of Windows or its Bootloader), if you want grub to be able to boot Windows,

Yes, I’d prefer not having to reinstall Windows.

you need to boot the Manjaro Boot Disk in CSM/BIOS mode. Then it should overwrite the MBR, so that it boots Manjaro and the grub menu should also display Windows in its menu.

Does that mean I can select CSM/BIOS in the installer, from the live CD?

Edit: I had a look in the live CD installer wizard, couldn’t find anything. I might need to spend some time reading the User manual.

No, that means, when starting the PC, you need to choose the correct mode in the UEFI Boot Menu. Most there are 2 entries, like

  1. EFI FLASH DISK XY
  2. LEGACY FLASH DISK XY

Something like that. There you need to choose it.

Ah, you’re right, I actually remember starting the live CD in EFI mode. It showed up separate from the other partitions. That makes sense.

1 Like

Sorry for the off-topic remark, but this :point_down:

Made me giggle so hard. And thanks! I needed it!!!

1 Like

You’ve had people visit here asking questions without having read the manual first, eh? :grinning_face_with_smiling_eyes:

Thank you for all your help, @megavolt.

I’m going to try the Manjaro install again now, this time not booting from EFI. I’ll report back whether I get Manjaro up and running!

1 Like

I suspect you’ve just described the majority, if not the vast majority, of the human race…

Another tip:

READ THE UPDATE ANNOUNCEMENTS

Don’t just go apply them willy-nilly. It’ll come back to bite you on the posterior.

I’ll give you this one for free, you can thank me later.

:wink:

I promised to check back in. Note: I don’t have much time to follow this further today. I was hoping to convert a friend to Linux, after him being annoyed with the forced microsoft account for Windows 11. My plan was to set up a dual boot and leave him to test both – now I need to get his Windows partition working before I leave.


Here’s what happened:

Reinstalled Manjaro, this time booted from MBR, not EFI. Installation wizard completed without errors. When i try to boot the computer, I get a black screen with the text “Operation system not found” - presumably from BIOS.

I selected “replace partition”. Notice MBR top right.

Then, after selecting the yellow manjaro partition, the visualization looked weird. Take 100 GB and turn it into 200 GB? That doesn’t seem right.

From fdisk, it looks like the two partitions are overlapping:

[manjaro@manjaro ~]$ sudo fdisk /dev/sda -l
Disk /dev/sda: 238.47 GiB, 256060514304 bytes, 500118192 sectors
Disk model: LITEONIT LMT-256
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: 0x000ce6a5

Device     Boot     Start       End   Sectors   Size Id Type
/dev/sda1            2048    718847    716800   350M  7 HPFS/NTFS/exFAT
/dev/sda2          718848 289478655 288759808 137.7G  7 HPFS/NTFS/exFAT
/dev/sda3       499193856 500115455    921600   450M  7 HPFS/NTFS/exFAT
/dev/sda4       289480702 499193855 209713154   100G  5 Extended
/dev/sda5  *    289480704 499193855 209713152   100G 83 Linux

Partition table entries are not in disk order.

Yeah looks weired. But must be some visual bug, when using logical partitions.

Yeah that is the good old way of MBR. MBR can only hold 4 primary partitions. A workaround is a logical/extended partition. Inside the sda4 it creates sda5. sda4 is the fourth primary partition. Inside the extended/logical partition, you can create as much partitions as you want. GPT doesn’t have this restriction.

Check the Boot Priority at the UEFI. You need to pick the correct entry.

Otherwise, try to reinstall grub… GRUB/Restore the GRUB Bootloader - Manjaro
(of course BIOS not EFI, which has different commands)

1 Like

Hey!

@megavolt - just wanted to let you know I got it working. I was able to complete all steps in the GRUB/Restore the GRUB Bootloader guide, but the result was the same, a black screen showing “Operation system not found”.

After that, I tried the Rescatux live CD. After running the Easy GNU/Linux Boot Fix, I was able to boot Manjaro. I would prefer to actually understand what wasn’t working and why it’s working now — but at least I have a working system.

Thanks again for your help!