GRUB issues after replacing Ubuntu with Manjaro in dual-boot with Windows

Previously, I was dual booting Windows 10 with Ubuntu, but I decided to replace Ubuntu with Manjaro. My 1TB HDD is sda and my 256 GB SSD is sdb. I have split the SSD between Windows and Linux. During the Manjaro install, I reformatted sdb6 (my old root partition) and mounted it as /, and I mounted (without reformatting) sdb1 as /boot/efi (but I'm thinking maybe it was supposed to be as /boot?). Anyway, when I turn on my computer, I get a grub> screen. With the "search and set" method described here, I am able to successfully boot into Manjaro. After booting, I ran sudo update-grub, but that did not appear to fix the problem. I still get the grub screen and have to manually set all the variables every time I boot.

Here is the output of sudo tree /boot: https://pastebin.com/QDYxDDJ7

The output of sudo update-grub: https://pastebin.com/atjcv5S6

cat /boot/grub/grub.cfg: https://pastebin.com/CXgH0Jr2

Partitions on sdb:

Device         Start       End   Sectors   Size Type

/dev/sdb1       2048    616447    614400   300M EFI System

/dev/sdb2     616448    878591    262144   128M Microsoft reserved

/dev/sdb3     878592 250728447 249849856 119.1G Microsoft basic data

/dev/sdb4  498274304 500117503   1843200   900M Windows recovery environment

/dev/sdb5  250728448 266352639  15624192   7.5G Linux swap

/dev/sdb6  266352640 315181055  48828416  23.3G Linux filesystem

/dev/sdb7  315181056 498274303 183093248  87.3G Linux filesystem

Relevant entry in mount:

/dev/sdb1 on /boot/efi type vfat (rw,noatime,fmask=0022,dmask=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro)

Edit with more info:

At the GRUB prompt, I can type configfile (hd1,gpt6)/boot/grub/grub.cfg and it will load the normal boot menu. Then, I can select Manjaro and it says "Error: file 'boot/grub/grubenv' not found," then it boots Manjaro normally. However, I still have to do this every time it boots.

1 Like

Search in Forum , upper right mirror glas

dualboot @gohlip 

Could you post

sudo parted -l
efibootmgr -v
findmnt -s
sudo blkid

My grubenv

# GRUB Environment Block
saved_entry=gnulinux-simple-9030b9ef-9aab-4578-92c7-b085e2b31cbb
boot_success=1
boot_indeterminate=1
##################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################

/ on sda2

# /dev/sda2
UUID=9030b9ef-9aab-4578-92c7-b085e2b31cbb	/         	ext4      	rw,noatime	0 0

Ayour grub prompt, do steps 2 onwards.. Don't forget when booted up to do the 2 extra uefi commands.

1 Like

sudo parted -l:

 Model: ATA WDC WD10SPZX-17Z (scsi)
 Disk /dev/sda: 1000GB
 Sector size (logical/physical): 512B/4096B
 Partition Table: gpt
 Disk Flags: 
 
 Number  Start   End     Size    File system  Name                  Flags
 1      1049kB  978GB   978GB   ntfs         Basic data partition  msftdata
 2      978GB   1000GB  22.3GB  ntfs         Basic data partition  hidden, diag
 
 
 Model: ATA SanDisk SD9SN8W2 (scsi)
 Disk /dev/sdb: 256GB
 Sector size (logical/physical): 512B/512B
 Partition Table: gpt
 Disk Flags: 
 
 Number  Start   End    Size    File system     Name                          Flags
 1      1049kB  316MB  315MB   fat32           EFI system partition          boot, esp
 2      316MB   450MB  134MB                   Microsoft reserved partition  msftres
 3      450MB   128GB  128GB   ntfs            Basic data partition          msftdata
 5      128GB   136GB  8000MB  linux-swap(v1)
 6      136GB   161GB  25.0GB  ext4
 7      161GB   255GB  93.7GB  ext4
 4      255GB   256GB  944MB   ntfs            Basic data partition          hidden, diag

efibootmgr -v:

BootCurrent: 0000
Timeout: 2 seconds
BootOrder: 0000,0004,0001,0002
Boot0000* Windows Boot Manager	HD(1,GPT,d9c6f4ea-2841-4ba6-ba83-4fcd5e3d268a,0x800,0x96000)/File(\EFI\UBUNTU\GRUBX64.EFI)WINDOWS.........x...B.C.D.O.B.J.E.C.T.=.{.9.d.e.a.8.6.2.c.-.5.c.d.d.-.4.e.7.0.-.a.c.c.1.-.f.3.2.b.3.4.4.d.4.7.9.5.}...T................
Boot0001* ubuntu	HD(1,GPT,d9c6f4ea-2841-4ba6-ba83-4fcd5e3d268a,0x800,0x96000)/File(\EFI\UBUNTU\SHIMX64.EFI)
Boot0002* manjaro	HD(1,GPT,d9c6f4ea-2841-4ba6-ba83-4fcd5e3d268a,0x800,0x96000)/File(\EFI\MANJARO\GRUBX64.EFI)
Boot0004* Windows Boot Manager	HD(1,GPT,d9c6f4ea-2841-4ba6-ba83-4fcd5e3d268a,0x800,0x96000)/File(\EFI\MICROSOFT\BOOT\BOOTMGFW.EFI)..BO

findmnt -s:

TARGET    SOURCE                                    FSTYPE  OPTIONS
/boot/efi UUID=6442-C9FD                            vfat    defaults,noatime
swap      UUID=d4e87065-5ee5-4a77-bd0f-fe150c5e4bed swap    defaults,noatime,discard
/         UUID=38ae4041-b53d-470b-a119-ad21485e3c87 ext4    defaults,noatime,discard
/home     UUID=48be1150-0364-4d1d-bcde-ced620ac3872 ext4    defaults,noatime,discard
/media/Data
          UUID=26544A86544A58A7                     ntfs-3g rw,noexec,auto,user,uid=1000,gid=1000,um
/tmp      tmpfs                                     tmpfs   defaults,noatime,mode=1777

sudo blkid:

/dev/sda1: LABEL="Data" UUID="26544A86544A58A7" TYPE="ntfs" PARTLABEL="Basic data partition" PARTUUID="c23eb3fc-a487-4ddd-8383-6339e71361c8"
/dev/sda2: LABEL="BIOS_RVY" UUID="4E704C60704C513F" TYPE="ntfs" PARTLABEL="Basic data partition" PARTUUID="4ea61f58-3ce5-4ac2-bf4e-a2b59621264d"
/dev/sdb1: LABEL="SYSTEM" UUID="6442-C9FD" TYPE="vfat" PARTLABEL="EFI system partition" PARTUUID="d9c6f4ea-2841-4ba6-ba83-4fcd5e3d268a"
/dev/sdb2: PARTLABEL="Microsoft reserved partition" PARTUUID="6fb9a461-7b42-4967-8aaa-2a20061d233e"
/dev/sdb3: LABEL="Windows" UUID="F4CA4494CA445550" TYPE="ntfs" PARTLABEL="Basic data partition" PARTUUID="80597a73-13ec-4bc2-af3a-2253faa2eca8"
/dev/sdb4: LABEL="WinRE tools" UUID="5020450C2044FB0C" TYPE="ntfs" PARTLABEL="Basic data partition" PARTUUID="56520f60-07f7-4cef-94a8-9e6c04867174"
/dev/sdb5: UUID="d4e87065-5ee5-4a77-bd0f-fe150c5e4bed" TYPE="swap" PARTUUID="c50e7411-3f45-4724-af41-bc3476845d38"
/dev/sdb6: UUID="38ae4041-b53d-470b-a119-ad21485e3c87" TYPE="ext4" PARTUUID="39be5add-7b9e-4d84-8de6-983e139bb40c"
/dev/sdb7: UUID="48be1150-0364-4d1d-bcde-ced620ac3872" TYPE="ext4" PARTUUID="513b5a35-d29e-4a5a-806e-7490bf1cbaae"

Ok, I just tried that, but unfortunately it didn't seem to fix it.

Then use manjaro livecd, start up in uefi.
Don't just say it didn;'t fic it.
Say whetrher it tboots, what error message if any.
And did you disable secure boot?
Your grub is your ubuntu grub, yes it is uninstalled but your grub is ubuntu's.

Reminder, don't just say it didn';t work. Didnpt fic
Tell us. YTou want thelp? tell us.
If having problems, write

1 Like

Hey,

I just noticed, your partition which is flagged boot and esp (/sdb1). Can you boot in Manjaro and make sure the partition isn't completely full? Maybe during installation, you didn't the make boot partition to be large enough, and some files couldn't be written (this is a completely blind guess).

Have you tried os-probe ? If I recall update-grub runs it everytime it runs but it might be worth a shot. It scans your machine for bootup files.

Thats possible: try booting into your motherboard's BIOS and find all the possible systems it can boot into. Boot into every option and find out wether one of them is Manjaro's grub; since both ubuntu and manjaro were installed in the same spot, its possible those aren't named correctly (although I don't think they should). This bootup list generally is referred to as "Boot overrides" or "Boot order priorities" in your mobo's bios.

1 Like

Delete boot 0000 (it's Ubuntu)
Recheck efibootmgr
Set Manjaro boot as 1st in order.

For the above, you only need efibootmgr --help.

1 Like

Looks like petsam has the good answer. Changing boot order priorities - exchanging 0000 and 0002 should also do the trick.

I thought it was odd to see 2 "Windows boot manager" boot options. I got completely fooled by it: it redirects to Ubuntu. Silly windows, trying to overwrite other OSes names so youre always first. This also probably means one of the partitions containing ubuntu files didnt get formatted on manjaro's install. So you might went to do some clean up afterwards @SMF67. I.e. mount each partition and check if they have any files related to ubuntu, then wipe it and extend your new manjaro partition to override and claim back the territory. Make sure it doesnt have any important flags before though (parted -l)!

1 Like

Thank you both so much for your suggestions. I think we're getting closer to solving it now. I did this and rebooted. My machine booted straight into Windows. So I rebooted again and hit F11 to select a boot device and got this menu: https://imgur.com/lmMVQn5

I selected the Manjaro option and it booted the Manjaro GRUB and Manjaro normally. However, it appears that the second Windows Boot Manager reappeared and is the default.

Here's the output from sudo efibootmgr --verbose again:

BootCurrent: 0003
Timeout: 2 seconds
BootOrder: 0004,0001,0003,0000
Boot0000* Windows Boot Manager	HD(1,GPT,d9c6f4ea-2841-4ba6-ba83-4fcd5e3d268a,0x800,0x96000)/File(\EFI\UBUNTU\GRUBX64.EFI)WINDOWS.........x...B.C.D.O.B.J.E.C.T.=.{.9.d.e.a.8.6.2.c.-.5.c.d.d.-.4.e.7.0.-.a.c.c.1.-.f.3.2.b.3.4.4.d.4.7.9.5.}...T................
Boot0001* ubuntu	HD(1,GPT,d9c6f4ea-2841-4ba6-ba83-4fcd5e3d268a,0x800,0x96000)/File(\EFI\UBUNTU\SHIMX64.EFI)
Boot0003* manjaro	HD(1,GPT,d9c6f4ea-2841-4ba6-ba83-4fcd5e3d268a,0x800,0x96000)/File(\EFI\MANJARO\GRUBX64.EFI)
Boot0004* Windows Boot Manager	HD(1,GPT,d9c6f4ea-2841-4ba6-ba83-4fcd5e3d268a,0x800,0x96000)/File(\EFI\MICROSOFT\BOOT\BOOTMGFW.EFI)..BO

I tried changing the boot order again by -o 3,4,0,1 I confirmed that it changed with efibootmgr --verbose but it didn't stick after a reboot.

I'm not sure what to do next. Is it safe to remove the /boot/efi/EFI/ubuntu directory? If so, would that force it to use Manjaro instead of the ubuntu GRUB? Or is there a safer way to do this from here?

Oh, I think you need to run update-grub after efibootmgr -o. This will should make the change stick on reboot. Make sure update-grub didn't rechange the order too.

If it still doesn't stick around try this: instead of hitting F11 on boot, try F10 or ESC to get the full menu. From there, change the default boot order to manjaro first. The menu you accessed is the boot override menu: its a one-time boot thing. A boot order priority list should be in there somewhere. It should look kinda like this:
https://youtu.be/GJo4OF5JNN0?t=160

I believe you can delete Ubuntu's efibootmgr entry safely, and most probably the files too. I wouldn't recommend though until someone else comes around and knows why Ubuntu was renamed "Windows Boot Manager". Clearly Windows did something to it, or it did something to Windows.

You can look here:
https://www.linuxquestions.org/questions/debian-26/how-to-delete-an-unwanted-entry-in-efibootmgr-4175608434/

I wonder though: do you have any other Ubuntu files just laying around like that? I would expect them to be in another partition, as Manjaro would've overriden them otherwise.

1 Like

sudo efibootmgr -b 0000,0001 -B
sudo rm -rf /boot/efi/EFI/Ubuntu
sudo efibootmgr -o 0003,0004
sudo grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=manjaro --recheck
sudo update-grub

1 Like

you will have 2 lines boot for manjaro ...

I would save those files though, I'm kinda worried with Ubuntu thinking he's Windows. grub-install could work, but maybe we should try just a update-grub first.

sudo efibootmgr -b 0000,0001 -B
sudo efibootmgr -o 0003,0004

Move all of /boot/efi/EFI/Ubuntu to a USB key.

sudo rm -rf /boot/efi/EFI/Ubuntu
sudo update-grub

Boot, check if it works, ----->check if windows works<------ . If it doesn't: bring back the files and update-grub. Its gonna pick them back up. Change order if needed. Boot back Windows.

Still no manjaro grub? Do @openminded 's grub-install solution. Stillllll no manjaro grub? Change BIOS boot order priority. That should be a complete solution.

1 Like

@petsam @openminded
Any idea if OP does not go via windows BCDedit how does this happen?
If you remember, there are some topics here where I ask users to substitute our efi-file into windows efibootentry (mainly Lenovo) for windows tied-in systems? But the OP here did not say this is the case; and obviously would have if that is the case.

Perhaps it is just a non-BBS compliant system (mostly msi models, some acer) but that does not explain how ubuntu grub file got into windows efibootentry.

Anyway in both cases, there would be a resolution. But this is an interesting puzzle. Any guesses?
Cheers.

1 Like

I guess it's a problematic UEFI and Ubuntu had to replace win entry.
Probably manjaro has to do the same.
My advice:

  1. First try with UEFI menu to change order of Manjaro to 1st.
  2. If on reboot is win 1st, use win bcd method to make manjaro first
    Fix UEFI bootloader when Dual Booting with Windows, using Windows
  3. If it still fails, use @gohlip method (copy grub efi to boot/something.efi)
    Using livecd v17.0.1 as grub to boot OS with broken bootloader
3 Likes

This seems to have fixed it, thank you so much! I pressed DEL on boot to get the full menu and I found the setting for the default boot loader for the hard drive. I set Manjaro first and it seems to have stuck, and I now get Manjaro GRUB on boot. Now that it's working, I probably won't touch those ubuntu files on the ESP unless it acts up again.

Other than those files on the ESP (and maybe some config files in my home directory), I don't think there are any other ubuntu files anywhere else.

@gohlip My machine is an MSI GS63VR, for reference.

1 Like

Good to hear. Yes, there are a few topics here on msi where the user needs to go to bios setup and set manjaro grub to the firmware and then set it as default. And correct, leave those settings by it self and not mess with it.

Oh, BTW, can you remember if you had tinkered with windows BCD, and if not, perhaps at the bios lever (now knowing it is msi) where the windows efi entry can use the ubuntu grub efi? If I'm not mistaken, one msi user explained how he got into manjaro (he had manjaro efibootentry, just not showing at bios firmware) where at bios he had to choose manjaro to make it into the efi firmware and then choose the efi file for it. Note in his msi, he cannot use 'efibootmgr commands, they just won't stick or become effective (not BBS compliant, as they say).

Anyway, good to hear and take care. Cheers.

You can safely delete the ubuntu folder at esp (/boot/efi) and the efibootmgr entry for ubuntu.

Sometimes there are conflicts when using application config files from other versions (ubuntu packages probably have different package versions than Manjaro). You should check there first when/if you have issues with respective apps.

1 Like

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