Dual-Booting Windows after Manjaro

So, I might have done a wee mistake by installing Manjaro first on my new PC. From what I could gather online, Windows has a tendency to break the bootloader and cause the Linux partition to be unbootable. I looked for solutions to this on the old forum, but all I could find are suggestions to use another drive and disconnect the Linux drive, but I have only one SSD, so I can’t do so.

Is there anyway to install Windows on the same drive without breaking the bootloader? If that isn’t possible, I would appreciate if someone could point me to a detailed guide on how to fix the bootloader (with a Live CD I presume) afterwards.

1 Like

Let’s assume you have installed Manjaro in UEFI mode on a gpt parted disk. After installing Windoze make sure Secure boot is disabled (in firmware), fully shutdown Windoze (switch off Fastboot) to avoid it’s remaining in a kind of hibernate state, then boot into a Manjaro LIVE iso (in UEFI mode) and enter some commands to let us know how your system is configured:

sudo parted -l
lsblk -f

Most likely you only need to chroot into your system and reinstall grub afterwards, the command(s) depend on your system configuration (deducted from the output of the above commands).

https://wiki.manjaro.org/index.php/Restore_the_GRUB_Bootloader

It is indeed a gpt parted SSD, and the /boot/efi is on a separate partition.

Here is the parted info:

Model: GIGABYTE GP-GSM2NE3100TNTD (nvme)
Disk /dev/nvme0n1: 1024GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags: 

Number  Start   End     Size    File system     Name  Flags
 1      1049kB  316MB   315MB   fat32                 msftdata
 2      316MB   11.1GB  10.7GB  linux-swap(v1)        swap
 3      11.1GB  97.0GB  85.9GB  ext4
 4      97.0GB  569GB   472GB   ext4

The third partition is for root, but I notice it doesn’t display root flags. Maybe I forgot? Is there any way to remedy it?

The whole drive is 1TB, so the free space from 569 onward is supposed to be for Windows.

And here is lsblk -f (which seems to have lost some of its indentation when I copied it over. nvm0n1 is the whole drive of course):

NAME      MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
nvme0n1   259:0    0 953.9G  0 disk 
nvme0n1p1 259:1    0   300M  0 part /boot/efi
nvme0n1p2 259:2    0    10G  0 part [SWAP]
nvme0n1p3 259:3    0    80G  0 part /
nvme0n1p4 259:4    0   440G  0 part /home

The only thing I miss is the boot flag for nvme0n1p1. When you install Windoze your EFI partition most likely will be overwritten by Windoze. As I said after installing Windoze make sure Secure boot is disabled (in firmware), fully shutdown Windoze (switch off Fastboot) to avoid it’s remaining in a kind of hibernate state, then boot into a Manjaro LIVE iso (in UEFI mode) and enter:

sudo manjaro-chroot -a

(Select 1 if only one line is offered)

Then enter:

grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=manjaro --recheck

update-grub

Here it could be required to fix your /etc/fstab file as the UUID of the /boot/efi partition might have changed. To check it out enter

blkid

Note the UUID of the /boot/efi partition and change /etc/fstab entry accordingly.

exit
exit

And reboot into firmware, select the manjaro entry to boot permanently and then reboot, normally.

If Windoze does not appear as entry in the grub boot menu after first boot into Manjaro then enter

sudo update-grub

and reboot again to find a Windoze entry in the grub menue, next time.

2 Likes

Thanks for the detailed response. How do I disable secure and fast boot though? I have only one thumb drive, so I’ll need to download the Manjaro image while in windows.

1 Like

Secure boot can be disabled in your firmware. I don’t know your firmware but usually there is somewhere an entry with that name.

Fastboot is set in Windows settings (somewhere), I don’t use it but I guess if you google a bit you will find some hints.

do not forget to add
flag boot & esp on /boot/efi ,
that can be done with Gparted

Just wanted to report that I followed the instructions you gave here and it all went very smoothly, surprisingly so.

P. S.
I fixed the flags earlier.

2 Likes

Glad to hear this! :innocent:

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