F5F Stay Refreshed Software Operating Systems Set up Windows alongside another OS and keep GRUB working.

Set up Windows alongside another OS and keep GRUB working.

Set up Windows alongside another OS and keep GRUB working.

G
190
09-11-2023, 06:17 PM
#1
I frequently encounter discussions on various forums regarding missing grub after dual-booting with Windows. Here, I'm sharing a straightforward approach to install Windows while keeping GRUB safe. This post isn't meant for the Windows section since it's aimed at users who run Linux as their main OS and want to maintain GRUB. This technique is also useful when you have numerous partitions and Windows struggles to install with them. Typically, you'd need to convert everything to GPT (which involves reformatting and data loss), but this isn't essential with the alternative method. Usually, you'd install Windows first and then Linux, but with this approach, the order doesn't matter—GRUB remains intact.

First, identify the disk and partition you wish to install Windows on. The most effective tool in Linux is gnome-disk-utility, which shows manufacturer names for devices. This info is crucial for the Windows installer because devices are listed in the order they were connected to the motherboard, not the installer.

Choose the device you plan to use for Windows installation. For example, if it's SDC, look for Disk 2 in the Windows setup window. In computer terminology, device numbers start with zero, so it's Disk 2.

Once you've found the correct device, open the Windows installer from your preferred source—DVD, USB, etc.—and go to the screen labeled "Custom (advanced)."

On this screen, you'll see a partition manager displaying all disks. Remember that device numbers begin with zero, so the correct one is Disk 3 Partition 2. Select it and click "Format." After formatting, avoid clicking "Next"—instead, press Shift+F10 to open the Command Prompt. Type "diskpart" and confirm it's running.

Continue typing: list disk to verify the disk name and number. You'll see C: as the newly formatted partition. Now, identify the Windows Setup location—this could be any letter (like H for DVD-ROM), but look for labels such as "DVD-ROM" or "CD-ROM." Even if you use a BluRay writer, it will still appear as "DVD-ROM."

If your Windows Setup was run from a flash drive, it will show as "DVD-ROM" too. Once you locate the correct device, use xcopy to copy Windows Setup files to C:\. After completion, reboot your computer and keep pressing F11, F12, or the boot key until the UEFI menu appears.

Select the appropriate device (AHCI P2 for UEFI systems) and boot from it. This will launch Windows Setup, but this time it will boot from the disk you just formatted. Navigate to "Custom (advanced)" and click "Next" without making any changes. The setup will reboot several times, and after each cycle, follow the UEFI boot menu instructions until you see the Windows desktop.

Once installed, verify GRUB is still available. You can do this by running os-prober or using grub-customizer to ensure Windows is detected.

This method guarantees GRUB remains functional regardless of installation sequence.
G
gustavbengters
09-11-2023, 06:17 PM #1

I frequently encounter discussions on various forums regarding missing grub after dual-booting with Windows. Here, I'm sharing a straightforward approach to install Windows while keeping GRUB safe. This post isn't meant for the Windows section since it's aimed at users who run Linux as their main OS and want to maintain GRUB. This technique is also useful when you have numerous partitions and Windows struggles to install with them. Typically, you'd need to convert everything to GPT (which involves reformatting and data loss), but this isn't essential with the alternative method. Usually, you'd install Windows first and then Linux, but with this approach, the order doesn't matter—GRUB remains intact.

First, identify the disk and partition you wish to install Windows on. The most effective tool in Linux is gnome-disk-utility, which shows manufacturer names for devices. This info is crucial for the Windows installer because devices are listed in the order they were connected to the motherboard, not the installer.

Choose the device you plan to use for Windows installation. For example, if it's SDC, look for Disk 2 in the Windows setup window. In computer terminology, device numbers start with zero, so it's Disk 2.

Once you've found the correct device, open the Windows installer from your preferred source—DVD, USB, etc.—and go to the screen labeled "Custom (advanced)."

On this screen, you'll see a partition manager displaying all disks. Remember that device numbers begin with zero, so the correct one is Disk 3 Partition 2. Select it and click "Format." After formatting, avoid clicking "Next"—instead, press Shift+F10 to open the Command Prompt. Type "diskpart" and confirm it's running.

Continue typing: list disk to verify the disk name and number. You'll see C: as the newly formatted partition. Now, identify the Windows Setup location—this could be any letter (like H for DVD-ROM), but look for labels such as "DVD-ROM" or "CD-ROM." Even if you use a BluRay writer, it will still appear as "DVD-ROM."

If your Windows Setup was run from a flash drive, it will show as "DVD-ROM" too. Once you locate the correct device, use xcopy to copy Windows Setup files to C:\. After completion, reboot your computer and keep pressing F11, F12, or the boot key until the UEFI menu appears.

Select the appropriate device (AHCI P2 for UEFI systems) and boot from it. This will launch Windows Setup, but this time it will boot from the disk you just formatted. Navigate to "Custom (advanced)" and click "Next" without making any changes. The setup will reboot several times, and after each cycle, follow the UEFI boot menu instructions until you see the Windows desktop.

Once installed, verify GRUB is still available. You can do this by running os-prober or using grub-customizer to ensure Windows is detected.

This method guarantees GRUB remains functional regardless of installation sequence.

X
XxO_Lola_OxX
Member
77
09-12-2023, 02:16 AM
#2
Unless you turn off automatic updates, this fix will be short-lived. Large Windows upgrades can completely reset your UEFI configuration, reverting it to the default setup for Windows alone.
X
XxO_Lola_OxX
09-12-2023, 02:16 AM #2

Unless you turn off automatic updates, this fix will be short-lived. Large Windows upgrades can completely reset your UEFI configuration, reverting it to the default setup for Windows alone.

T
228
09-12-2023, 02:34 AM
#3
I've set up Windows on many devices using this approach, and GRUB hasn't been modified even after switching from Windows 7 to Windows 10. I think the issue is that a normal installation doesn't create the system and boot partitions that Windows expects. Using my method, the "boot" partition turns into a directory on C:.
T
Thegamingnerds
09-12-2023, 02:34 AM #3

I've set up Windows on many devices using this approach, and GRUB hasn't been modified even after switching from Windows 7 to Windows 10. I think the issue is that a normal installation doesn't create the system and boot partitions that Windows expects. Using my method, the "boot" partition turns into a directory on C:.

B
BOSSARI123
Junior Member
45
09-12-2023, 03:26 AM
#4
When the Windows installer fails to format the EFI partition, simply pick the grub file from the BIOS. To ensure the grub list contains the Windows image, you must restart Linux and execute the following commands from the command line: sudo apt-get update && sudo apt-get upgrade && sudo update-initramfs -u && sudo update-grub && sudo reboot
B
BOSSARI123
09-12-2023, 03:26 AM #4

When the Windows installer fails to format the EFI partition, simply pick the grub file from the BIOS. To ensure the grub list contains the Windows image, you must restart Linux and execute the following commands from the command line: sudo apt-get update && sudo apt-get upgrade && sudo update-initramfs -u && sudo update-grub && sudo reboot

D
DUHMAN118
Junior Member
38
09-12-2023, 10:33 AM
#5
My approach ensures you don't need to perform this task.
D
DUHMAN118
09-12-2023, 10:33 AM #5

My approach ensures you don't need to perform this task.