Linux – How to create a dual/multiboot of Windows and GNU/Linux, FreeBSD, etc

community-faq-proposedlinuxmulti-bootpartitioningwindows

Because of reoccuring questions about dualboot of GNU/Linux and Microsoft Windows, an authoritative general guide is needed as a reference for users asking about dualboot/multiboot.

Necessary elements:

  1. Cover both BIOS and UEFI boot methods, using GRUB2 as the Bootloader of choice because it is commonly used in popular GNU/Linux distributions.

  2. Set up the partitioning, with examples for both MBR and GPT partition tables. Include primary/logical partition problems with MBR and shrinking Windows partitions if no space is available elsewhere. This should preferably be explained for GPartEd, as that is the most commonly used GUI partitioning tool. Include information about the special partition that may be necessary with GPT.

  3. Explain setting mount points manually. At a minimum set swap and root (/), but preferably with directions for /home and /boot as well. Add mount points for existing NTFS/FAT/other data partitions. Optionally use the Ubuntu installer as an example so users can adapt to others.

  4. Repair/Install the bootloader when not done automatically by the installer or when damaged. Include the steps potentially needed for secure boot.

The guide shouldn't walk throug all edge cases but be helpful for most users. Part 4 for example should be as easy as showing the usage of grub-mkconfig (and additional work for secure-boot).

Best Answer

Whoa there, you're trying to cover way too much ground. Perhaps you're looking for a master document linking to all the various vendors' methods? Or simply a guide on how to Google for your solution?

Yes, this is a complex subject. There are many BIOS implementations, each with their own hotkeys and standards.

The problem with Grub2 is that it is still fairly new, even in 2013. Each distribution has its own way of coping with the tools provided by Grub2, so no universal documentation will suffice - in that regard Grub is much simpler and more universal.

I'd unpack the problems to something simple, like:

I can't boot my OS. How do I fix my bootloader?

Generally, all you need to know is this:

You can probably still boot your OS if you press the right hotkeys. Also, each OS has its own bootloader - and pecking order. Windows is allergic to Linux and will gladly overwrite your Linux bootloader in most circumstances.

Multiple Harddrives

The simplest solution by far is to have multiple harddrives connected to your machine. When you install a new OS, give it it's own harddrive. Power off, disconnect all the other drives, and install the new OS. After installation, reconnect the other drives and choose your boot drive from the BIOS, usually by pressing ESC, F8 or F10.

Single Harddrive

Install Windows first, starting from the older versions and then BSD's and then Linuxes. Windows generally hijacks the boot process and after any Windows install you'll likely need a USB Boot stick to get your Linux bootloader back. Installing Linux after Windows usually works much better as Linux gracefully creates boot-shortcuts to Windows for you.

When in trouble

Go to another PC and download a USB Boot stick for your OS; or get a good universal bootloader such as Grub or GRUB4DOS. (Eg. http://www.supergrubdisk.org/). On Windows, write it to your flash disc with: Universal USB Installer (http://www.pendrivelinux.com/universal-usb-installer-easy-as-1-2-3/) or look for your linux distro specific Bootable USB creator, eg. Startup Disk Creator in Ubuntu.

All PC's made since 2007 will boot off the same USB sticks, if you enable it in the BIOS, insert the disc early enough, and press the appropriate hotkey for your BIOS.

Related Question