friendica.eskimo.com

[SOLVED] Installing Linux distro without breaking Windows install

Solution:
When I formatted all my drives to install Linux on one and Windows on the other, I kept both connected and they share EFI boot partition as a result. Every time I reinstall Linux it formats the drive and therefore deletes the Windows's EFI Boot as well. One way is to fix this is to reinstall Windows while disconnecting the drive you have Linux on. Or you can move the boot files if you don't want to do that.

I used this guide:
forums.tomshardware.com/thread…

OP:


Currently dual booting as I need Windows for a few tasks and ganes Linux just won’t do. Since setting everything up I’ve reinstalled Linux twice, both times I’ve lost the ability to boot into windows and have needed to reinstall it.

Disk doesn’t show at all in Grub, tried all kinds of things but it just doesn’t show as a bootable OS. It doesn’t show in the boot options in the BIOS or the boot menu for my motherboard. Drive shows up and all the files are still on it. So my guess is the Windows bootloader somehow installs on the same disk that I have Linux on.

I run Linux(Fedora) and Windows on two separate drives.

Windows take forever to install. Anything I can do now to prevent this from happening if I need to reinstall Linux or if I wanna to some distro hopping?

Just to be clear, everything is working right now. But I want to prevent having to reinstall Windows every time I change distro or reinstall my Linux OS

This entry was edited (1 day ago)
42 4

I was hoping to avoid that, but that’s gonna be my next move.

Unless I forget and break windows again.
Words can’t describe how tired I am of choosing the 37 different options during the install, updating the OS 4 times and installing my apps and deleting bloat. 😂
Windows 11 is great and all, but Microsoft loves to make it unbearable to use.

This entry was edited (1 day ago)
1
I was doing some quick research and saw someone suggest installing each OS with the other drive disconnected. That way you can first get each one working individually and there's no chance of one messing with the other's bootloader.

I've had Windows and Linux installed on the SAME drive for decades and don't have this issue. Install Windows first because it WILL fuck up the EFI boot partition, that's inevitable because Windows sucks, then install Linux, use the manual partition option and simply select the existing EFI System partition for the EFI and DO NOT mark format, Linux will then install and leave the Windows boot loader in the EFI partition undisturbed.

Linux WILL overwrite the boot block to start grub instead of the Windows boot loader, but most Linux distros will automatically add a chain boot loader entry to the grub menu to allow you to boot Windows, at least Debian and Redhat derived distros will do this, probably a more manual process in Arch derived distros.

If it does become necessary to install Whendoze after Linux, you can use boot-repair to automatically fix the EFI System partition Windows fucked up or you can boot off of a flash drive, and fix it manually.

Install Windows, but leave drive open or a partial space on windows drive. When you install Linux, don't let it install the EFI boot into the Windows EFI boot partition. Instead have the partition manager build a new boot partition+root home etc. Grub will install on its own partition, OS prober should find the Windows drive too, and it will add a chainloader entry to grub.
Set your machine to always boot from Linux grub, if you want windows you select it in grub and it hands boot over to windows boot. This way they are isolated and Windows never knows that Linux grub exists and will leave it alone.

First of all: You don't have to reinstall Windows to get it's bootmgr EFI and supporting files back into the ESP. Installing those from the CLI in from a booted install media is possible, I did it before. You can even install all of Windows manually if you ever need to, it's just annoying to do with the windows command line tools.

Secondly: I'm not familiar with all distro installers, but surely you can just not format the ESP? Worst case scenario you'd have to use manual disk formatting I guess, but it's not that difficult.

Thirdly: You said Grub doesn't show the disk. If you mean the Grub command interface didn't show the disk, then the issue is deeper, at a UEFI or hardware level. If you mean there are no boot entries for a Windows install to be selected, then it could be that they were not generated because the Windows bootmgr EFI was not found when Grub got installed. Sometimes just booting back into Linux and running os-prober again might be enough, if the Windows bootmgr EFI is still around. On my distro the os-proper is automatically run when I run grub-mkconfig -o /boot/grub/grub.cfg

I've always used a shared ESP for my dual boot systems and I certainly don't reinstall one OS as the result of a change with the other.

This entry was edited (22 hours ago)

Fucking hell that’s a real pain in the arse solution you have there.

If you have two drives then one will be sda and the other will be sdb. Install Windows first on sda (which will mean the boot sector is on sda) then install linux to sdb.

When you get to the part in the Linux installation process where it asks where you want the boot partition tell it to install on sda.

Then anytime you want to install and try a different distro just install to sdb with the boot sector on sda and grub will always detect and add Windows to the boot menu.

Ran that configuration for 10yrs zero issues.

1

This solution took all about 2 minutes. Now it won’t matter what I do when I reinstall Linux. My Windows boot is not on that same drive any more.

If I would have known my Windows boot was on the M.2 drive I install Linux on, I would not tell the Linux installer to format that drive, obviously.

It’s an Issue I created myself by not thinking about Windows’ limitations. But this solution is pretty quick if you already reinstalled Windows again.

This entry was edited (20 hours ago)
1
What Linux distro are you using? To make it not erase the Windows boot manager from the EFI partition simply manually partition, and do NOT mark the EFI partition for formatting, then Linux will add it's own but NOT erase Windows.
I prefer to just move the Windows boot loader so that I don’t have to even think about it. Having Windows’ EFI completely separated is a much better solution in my opinion. But both solutions work all the same.