Talk:Dual boot with Windows

From ArchWiki

Use Cases

[Moved from Windows and Arch dual boot#Use cases. This information should be deduplicated and added to a page in Category:Laptops, if applicable. -- Alad (talk) 05:59, 4 September 2015 (UTC)]Reply[reply]

Alad, i think you might be off base on that one, that entire GOAL of that excercise was nothing to do with laptop, but to Demystify arch dual boot. Can we PLEASE put this back, its my new GOTO for dual boot on any windows arch system, no matter the case, whenst i dont want to deal with UEFI and or GPT due to windows or hardware limitations. --Wolfdogg (talk) 23:11, 17 September 2015 (UTC)Reply[reply]

Ahh, after further thkning on this, i probably misled the whole thing by the use case title having anything to with Laptops and HP, its not just a Use Case, its an ENTIRE revamp of the Dual Boot instructions, can we somehow incorporate it on the Dual Boot instructions page, labeling it how you will, so that those instructions are clear for any user to run through as a MBR-BIOS use case if necessary? The idea is it being some new official simple dual boot (as close to all encompassing for newbs) as can be, to where they can work off it how they choose, but as a simple foolproof starting point, pointing out places where its up to the user to make the choices necessary to apply it to their user? I need a good writer for that. --Wolfdogg (talk) 23:16, 17 September 2015 (UTC)Reply[reply]

The whole instructions for setting up dual boot can be summarized as:
  1. make sure there are at least 2 partitions (described in Partitioning),
  2. make sure that Arch is installed on one partition (described in Installation guide) and the other OS on the other partition (cannot be described on the ArchWiki),
  3. (re)install the bootloader (described in Windows_and_Arch_dual_boot#Installation and specific pages for each boot loader)
There is no point in duplicating the instructions for all 3 steps on a single page. Also, your instructions consider only one possible scenario, they won't apply for example if the other OS is already installed.
-- Lahwaacz (talk) 08:32, 18 September 2015 (UTC)Reply[reply]
Is there anything to add or can this be closed? -- Alad (talk) 09:23, 2 September 2016 (UTC)Reply[reply]

MBR-BIOS

Special notes

  • This method uses parted exclusively for all partitioning
  • I'ts assumed (if your bios permits) that you have it set to IDE or SATA/RAID, and not on AHCI mode
  • In this scenario, the user additionally saved 1GB free space at the beginning of drive for later use (Later conversion to boot bios, GPT partition table, grub installations, anything really)
  • FYI this was for HP laptop i3 generation Intel HP4520s#aba xt988ut

Begin

Get yourself a readied drive. You might want to check it out with smartmon tools first, once you trust it and its ready for wipeage then follow the exact procedure below (with as little deviation as possible except for partition sizes).

Note if your newer to parted, pay close attention to the B,MB,GB figures, those are intended to aid in aligning your partitions correctly. This setup may vary on yours, but its highly recommended to keep trying until they are aligned properly first.

  • Using parted, create the following partitions, adjusting start points where you see fit. If you don't want the free space, adjust the first start point to 1MB or something (success is not guaranteed on any partition adjustments, for this scenario)
# parted
mkpart ntfs 
start point 1000000B
end 251000000B

mkpart ext3 (for /)
start 251000000B
end 281000MB (use this MB figure to aligned properly(may vary for you))

mkpart ext3 (for /home)
start 281000MB(use this MB figure to aligned properly(may vary for you))
end 531GB(use this MB figure to aligned properly(may vary for you))

mkpart fat32 (for /media/shared)
start 531GB(use this GB figure to aligned properly(may vary for you))
end 750GB

set 1 boot on

quit parted..

  • reboot with windows cd
  • carefully selecting ONLY the 1st ntfs labeled-type partition you created above install windows (dont worry, it wont create the 2nd boot partition now, if it does, something went wrong try again)
  • reboot into arch dvd
  • follow arch install instructions per standard installation continuing up to the partition creation point, which you will now SKIP over.
  • Start off with formatting with filesystem of your choice
# mkfs.ext3 /dev/sda2
# mkfs.ext3 /dev/sda3
  • use arch install wiki to mount drives, adjust mirrors, connect network easiest way for now is to connect hard lan cable on dhcp avail network, then

run dhcpcd

# dhcpcd
  • Follow arch install wiki for the following per norm;
    • install pac base, genfstab, arch-chroot, set your hostname, set localtime and locale-gen, compile kernel, set password, then continue
  • Install grub
# pacman -S grub
  • backup the boot record to a file named "mbr-backup" on your root
# dd if=/dev/sda of=/mbr-backup bs=512 count=1
  • Install grub onto your disk sdx, replacing sdx with the disk you are working with(be careful).
# grub-install --recheck /dev/sda
  • run os-prober to find your windows install
# pacman -S os-prober
# os-prober
  • You can also edit your default boot order here in /etc/default/grub by changing the order from 0 to 1,2, etc..
  • now compile a new grub boot config to finish things up..
# grub-mkconfig -o /boot/grub/grub.cfg
  • Now reboot, Success!

Alternative grub install

  • Instead of overriding windows boot partition with grub as we just did above, you can alternatively use the windows boot partition to point to grub, ONLY if you install GRUB to the partition, and not the drive boot record. i.e. dev/sdx1 instead of /dev/sdx
# grub-install --target=i386-pc --grub-setup=/bin/true --recheck --debug /dev/sda
  • continue with bcedit in windows to point a second boot to the grubbed partition.. good luck with that..

-- 02:12, 4 September 2015‎ Wolfdogg

Dedicated partition not needed to boot grub2 using bcdedit

Since Dual_boot_with_Windows#Using_Windows_boot_loader involves creating linux.bin and putting it onto C: , there's no need to create a FAT32 partition or even install grub (either to MBR or a partition boot sector). When installed to MBR, the role of that 512 byte block is to load core.img embedded to the MBR gap. When installed to partition boot sector, its role is to load the file core.img residing in /boot/. The thing is: Windows Boot Manager loads the whole file, even if it's larger than 512 bytes. This allows to embed core.img into that file and put it to C:. Good news grub ships with a special boot sector that does not try to load core.img, but assumes that it's already loaded - lnxboot.img. Here's what you do:

  • Boot existing linux
# (optional) update core.img (see https://wiki.archlinux.org/index.php/GRUB#Generate_core.img_alone )
grub-install --target=i386-pc --grub-setup=/bin/true --debug /dev/sda

# embed core.img into bootable file
cat /usr/lib/grub/i386-pc/lnxboot.img /boot/grub/i386-pc/core.img >/media/win/grub4bcd.img

Hell, you don't even need to boot Linux, just extract those files from your Linux partition using some free tool and concatenate them.

  • Boot to Windows
bcdedit /create /d "Grub2" /application BOOTSECTOR
# The entry {ID} was successfully created.

bcdedit /set {ID} device partition=C:
bcdedit /set {ID} PATH \grub4bcd.img

# add grub as last entry
bcdedit /displayorder {ID} /addlast

# menu timeout
bcdedit /timeout 13

—This unsigned comment is by Basinilya (talk) 18:34, 30 June 2016‎. Please sign your posts with ~~~~!

Restoring a Windows boot record

Doesn't this situation refer to a MBR type installation? UEFI boot of windows requires a GPT type partitioning not MBR. Theking2 (talk) 18:24, 1 September 2016 (UTC)Reply[reply]

Shrinking the Windows Partition

The wiki mentions

"All systems pre-installed with Windows XP, Vista or 7 32-bit, irrespective of Service Pack level, bitness, edition (SKU) or presence of UEFI support in firmware, boot in BIOS/MBR mode by default."

So preinstalled systems are taken into account. But in all pre-installed systems, Windows usually occupies the full partition.

This wiki page contains information on how to reduce the size of the partition from Windows when using safe boot. I believe that some information from this section would be very helpful in this page. I'm not adding it because of my lack of experience with this, but perhaps someone else would like to adapt and add.

—This unsigned comment is by Ddshore (talk) 16:31, 11 August 2018‎. Please sign your posts with ~~~~!


Configure Internal HDD as External Drive

In Dual_boot_with_Windows#Disable_Fast_Startup_and_enable_hibernation there's a Note stating "You can avoid this issue for a drive by mounting a drive as an external drive in Windows and ejecting the drive in Windows before hibernating." Does anyone have more details on this? Some questions I have:

  • Can this be set for a shared partition on the same disk? For example a partition schema like [Recovery, ESP, C-Drive NTFS, D-Drive NTFS, Archlinux] is somewhat common partition schema for using the the "D-Drive" partition to share data between Windows and Linux. Can D: be configured as "an external drive"?
  • Is the "ejecting" step before hibernation something that must be done manually or does Windows do that automatically?
  • Can the ESP partition be marked as External so that Windows doesn't leave the partition mounted during Hibernate?

Bobpaul (talk) 16:31, 28 May 2020 (UTC)Reply[reply]

Does Arch really need access to ESP partition during updates?

In Dual_boot_with_Windows#Fast_Startup_and_hibernation most of the concern with Windows/Linux hibernating seems to be due to the shared use of the EFI System Partition. And if one is using systemd-boot or another boot loader which requires the Kernel lives on the ESP, then absolutely, one needs to share the ESP between Windows and Linux.

But many Bootloaders, such as GRUB, only require the Bootloader lives on the ESP. And I believe for GRUB, the only time Arch needs to write to the ESP is when the `grub-install` command is executed (which is not implicit during a GRUB package update).

It seems that, at least for GRUB, it should be sufficient to define the ESP in /etc/fstab, but configure it for noauto to prevent it from mounting on startup. One could then cautiously mount it (after ensuring Windows is not hibernated) before running grub-install, which should be rare.

Does this sound like a reasonable configuration or am I making some incorrect assumptions? Bobpaul (talk) 16:51, 28 May 2020 (UTC)Reply[reply]

I just did a Dual-Boot installation following https://www.youtube.com/watch?v=C3D_qzw94v8, where he creates a second EFI partition for Linux. Seems to work. This should also solve the problem with hibernation, no? Mauro3 (talk) 07:28, 6 September 2020 (UTC)Reply[reply]

Windows' ESP default size is rather small

It seems that per default, Windows creates a ESP that is just 100M big. This is below the size recommended by this wiki and I already had some problems with this being rather small. Would it be reasonable to add a warning that one should consider increasing this size manually when installing and partioning windows? N31415 (talk) 11:41, 1 July 2020 (UTC)Reply[reply]

Please feel free to add. -- Blackteahamburger (talk) 02:59, 3 August 2020 (UTC)Reply[reply]

Linux before Windows

This section and its subsection UEFI firmware I found unhelpful and confusing when installing Windows after Linux (Windows 10 specifically). What I did find helpful was documentation from Microsoft, but it, too, isn't the best as it's verbose and only refers to disk partitioning. This Microsoft documentation can be summarised into a concise table listing new partitions to add and accompanied with thorough and easier to follow steps covering the whole installation process, under a new Windows 10 (with GRUB boot loader) section. I can contribute what worked for me to make the installation process clearer and quicker. What might be a problem however is the section not being general enough for other boot loaders or older versions of Windows. Petarturukalo (talk) 05:52, 21 May 2021 (UTC)Reply[reply]

I found this section to be helpful. It gave me confidence that it is generally possible. I just successfully went through the described process to install a Windows11 along an Arch Linux installation. However, the explanations are unspecific about the correct order of events: The Windows Setup reboots several times. After the first reboot, remove the Windows Install Medium (USB-Stick) and boot into Linux. A new directory at /boot/efi/Microsoft should be present. Now add an Boot Entry in the Grub menu. Consider activating the os-prober functionality. Then reboot and select Windows to proceed with the installation. Rangerjo (talk) 19:08, 9 April 2023 (UTC)Reply[reply]

Adding commands to bypass UEFI requirement in Windows 11 setup

I don't know if this is beyond the scope of this page, but as the page mentions that Windows 11 is unofficially supported on BIOS/MBR once you bypass setup, it maybe useful to say how to bypass setup. I'm also not sure how to fit this into the page well, even though it is a fairly simple procedure:

Open command prompt by using Shift + F10, and launch regedit.exe. Navigate to HKEY_LOCAL_MACHINE\SYSTEM\Setup, right click the "Setup" key, and create a new key named "LabConfig". In this key, create 2 new DWORD (32-bit) values, named BypassTPMCheck and BypassSecureBootCheck, and set the value of each to be 1. Installer should proceed as normal then.

Pugbugdude (talk) 03:09, 7 July 2023 (UTC)Reply[reply]

Is the Windows 11 ISO even BIOS-bootable? Either way, instead of adding the instructions to the page which may indeed be out the scope, it would be better to simply link to the instructions. E.g. the ones on elevenforum.com. -- nl6720 (talk) 07:18, 7 July 2023 (UTC)Reply[reply]

Trying the ISO on a VM with BIOS/MBR and the BypassTMPCheck seems to work. Pugbugdude (talk) 17:11, 7 July 2023 (UTC)Reply[reply]