Linux Windows dual boot
16th October 2020

How to install a dual-boot Linux/Windows machine

This article started as my response to somebody who posted to the “Linux and Open Source Users Group” on MeWe asking how to configure his new computer to dual-boot both MS Windows and Linux.

I am going to start by saying that unless you have a serious, intensive and frequent need to run more than one particular operating system as “the” only one running on a piece of hardware at any one time, dual-boot is a bad idea – there are far better and easier ways of allowing multiple operating systems to exist on a single machine.

These include installing the second operating inside the main one you will use as a virtual machine (“VM”). VMs are supported by all current versions of Linux and Windows desktop operating systems and the technology is no longer restricted to use by servers. Unless you need the CPU or graphical power of your machine for the second operating system (in which case a VM is the way to go) other very simple answers to the problem of retaining (say) Windows just to configure a few older devices whose control software will only run in a native Windows environment include retaining an old laptop (or desktop machine) that is still running Windows or buying one of the very cheap “micro PCS” available on websites such as AliExpress or Banggood that can, once initially configured be run as “headless” machines (ie, no screen, mouse or keyboard attached) access with screen replication technology (eg; the Linux program Remmina has an excellent RDP client which is exactly what is needed to see a full Windows machine from the comfort of your Linux desktop) and this is the route I use to keep my older Windows specific devices running.

I really recommend anyone considering a dual-boot installation to think through other options because dual-boot brings with it a lot of unnecessary complication and a boat-load of problems surrounding sharing and access to storage and file systems.

But, the question was asked, the questioner said he had already trawled the web and found no workable way to do what he wanted so I present here the simplest answer I can think of.

Technical difficulty

I consider the technical difficulty and pre-existing knowledge level required to understand and accomplish this article as MODERATE.

f you are considering a dual-boot option, I suggest you read this article in full before commencing to ensure you understand the requirements and procedures. If anything remains clear or outside your experience then unless you wish to attempt this exercise as a learning exercise on a spare piece of hardware please do not proceed – just understand that dual-boot is an unnecessary idea for the majority of use cases and read one of the other articles in this series that explains a simpler way of running multiple operating systems on a single machine.

Background

The background – which I think is fairly typical of such requests – is that the questioner wanted to migrate away from Windows to a complete Linux desktop environment (something done here a decade ago) but still had a few favourite applications and configuration apps for certain devices that would only run on native Windows.

He had assembled hardware for his machine (I don’t know the CPU, RAM etc) including:

  • A 256GB SSD (fast Solid State Disk) to act as the boot drive and hold programs etc for fast application load
  • TWO 2TB HDD (traditional magnetic hard disks)

His initial plan was to

a) Divide the 256GB SSD into two partitions giving one to each operating system (“OS”)

b) Devote one complete 2TB HDD to each operating system (a very wasteful and poor use of resource in my opinion as you will see) for storage of “applications” used by each OS

The initial question concerned installation of Windows 10 and (unknown version) of Ubuntu on the Linux side. As Linux OS varieties (eg; Ubuntu, Mint, Centos, Arch …) all use a common graphical installer called Anaconda what follows should be applicable to whatever flavour of Linux OS you prefer.

You should be able to easily adapt the instructions if you have a different disk layout.

Equally, the instructions should be applicable to any version of Windows from Windows 7 onward and most current flavours of Linux distro.

The questioner had chosen Ubuntu as it is well known – read the full discussion or read my views on why I choose the Linux versions I use elsewhere in this series of articles to get an idea of what you can do to choose a Linux variety that suits you if you are new to the operating system.

Cautions and preparations

  • Avoiding techie maths for a moment, dividing a disk into two halves will inevitably lose some space – so 1 x 256GB becomes ~ 2 x 120GB partitions. The loss of space is due to partitioning requirements that partitions start on certain boundaries (locations) on the disk.
  • 2TB is a LOT of disk space for “applications” in either of these operating systems so I assume these large spaces are actually intended for data.
  • Unless you have a wish to install every huge application package under the sun all your applications and associated working files should fit comfortably inside the ~120GB of space allocated to each OS on the SSD.
  • Segregating the data produced by each OS on to a separate HDD is not necessarily a good idea. Apart from the inevitable waste of space (OK – not a huge problem with HDD prices so low) a bigger issue arises when you want to access (say) a document understood in both OSs while “the other one” is booted and in use. This requires careful consideration of disk format types, access methods and deep knowledge of the different file permission mechanism used by each OS if it is to work.
  • Finally – this article covers installation of the Home version of Win10 and a single desktop version of whatever Linux flavour is chosen. If you are installing the enterprise versions of either OS or attempting to integrate this machine into an enterprise infrastructure stop right now and go get help from the documentation for BOTH OSs or the techies who installed the enterprise infrastructure. Installing just one of these beasts into an enterprise environment is a mammoth undertaking – trying to install both and getting them to integrate with their respective back-ends or a single authority mechanism is advanced stuff (technical term).
  • This article assumes you are comfortable with disk partitioning tools, disk formatting, the differences between file system types and how to mount (make a given disk or partition available to) filing systems under each OS. If you are not then STOP right now – you should not be trying to install a dual-boot OS system.

HOW TO configure a dual-boot system with a single boot drive two hard drives for data

This process allows a dual-boot system to be configured with minimal adjustment to the automatic assumptions made by the standard Windows and Linux/Anaconda installers. It deliberately avoids the need to manually place and configure (especially) the various Linux partitions or do much more than select which disk Windows should install on and (if you have not already done so) confine it to half the available disk space. Other than that, the installation processes can proceed with no more manual intervention than is normally required.

It is a good idea to have a few coloured sticky labels handy so that you can identify which HDD belongs to which OS – and more importantly which SATA cable connects to each – this simple trick may save much later confusion.

It is vitally important that each step is performed in the order presented.

I’d suggest the easiest process (starting with a fresh machine)

  1. With the machine powered down, disconnect (unplug the SATA cable) of one of the 2TB disks – you should now have just the SSD and one 2TB HDD connected
  2. Partition the SSD drive into two equal halves OR ensure that you adjust the amount of space allocated to Windows in the next step. Unless you are trying to install older versions of Windows (eg; XP, NT or Server 2012 or earlier editions) it is easiest to use the Windows installer to halve the SSD space it uses.
  3. Install Win10 confining it to half (or whatever proportion you want to give it) of the SSD and allow it to install on what will become disk “C:” – it should then also “grab” the connected 2TB disk and prepare it as disk “D:”.
  4. Let the machine reboot and confirm you have a working Win installation with the disks the way you want them. You should complete the first-run installation process (ie; create users, set machine name and network addressing and sharing method etc) before proceeding.
  5. Shutdown the machine (ie; use the SHUTDOWN in Windows – don’t just pull the plug.
  6. Disconnect the HDD you have configured as the Windows “D:” drive – you should have only the SSD connected at this point. If you leave either HDD connected the Anaconda installer’s current usual response is to form something called an LVM (“Logical Volume Management”) group combining the disks and spreading operating system parts and data space between the disks – which is what you definitely DO NOT want. It is possible to have Anaconda restrict itself to a simpler layout as you wish – OS on the SSD, data on the HDD – but it is certainly no easier than using the disk management tools I describe later and can be somewhat error prone.
  7. Boot the machine into its BIOS and set it to boot from whatever Linux installation media you have (eg; USB stick) then save and boot.
  8. Let Linux start and load the Anaconda installer
  9. You should eventually see a graphical screen with the sections of information you must provide obviously displayed – this is the Anaconda installer screen.
    1. the key part you want is the disk layout – here you should choose to install ONLY on the FREE (ie; unpartitioned) SPACE on the SSD … the installer should identify this as soon as you select the SSD.
    2. Allow Anaconda to create all the necessary partitions on the empty section of the SSD, checking that the partition /home contains a reasonable amount of space (it should be the largest partition on a 120GB disk) and that the full amount of free disk space has been used.
    3. Then apply the changes by clicking the [Save] button. If you forget to do this the changes made will not be applied to the disk and installation cannot proceed.
    4. it is useful to at least configure the network and machine name (separate operations within the “Network” section of the installer) at this point as well as the initial software load (it will be MUCH faster to load software from the installation media than over the Internet which becomes the default choice once the machine is prepared and booted up.
  10. Complete the other sections the installer asks for (eg; the initial application load or typical machine use – which selects a roughly suitable starter set of applications for you).
  11. Let the installation proceed to completion – at which point a [Reboot] button will appear at bottom right of the installer screen.
    1. while the installer is completing its work and loading your initial software choices, YOU REALLY, REALLY SHOULD enter a secure password for the “root” login ID where prompted – it is not necessary to create other users at this point though if you are installing something Debian based (eg; Ubuntu, Mate …) you should create at least one normal user as you will avoid much hassle by doing so.
  12. Reconnect the SATA cables ensuring the correct cable is fitted to the correct disk to both HDDs.
  13. Click the on-screen [Reboot] button when the installation is finished – one of three things will then happen (depending on how smart the version of Anaconda used is):
    1. (a) you will eventually be presented with a menu asking you to select which OS to boot,
    2. (b) the machine will just boot straight into Win10 or,
    3. (c) the machine will boot straight into Ubuntu – I assume you would prefer (a).
  14. If (a) doesn’t happen a temporary work-around is to press a key (typically F12 if you have a modern UEFI BIOS) during the BIOS load process or whatever key the BIOS prompts you to press to select the boot device – the BIOS will then present you a list of bootable disk partitions from which you can select.
  15. For a permanent move to (a)
    1. you will have to read specific help documentation for your installed Linux flavour (hint: search for “{Linux_flavour_name} grub” in a search engine to start) or
    2. look (probably in the Boot/Advanced section) of your BIOS configuration for an option to Select the boot device on power-up.
  16. When you first boot into Linux make sure you complete its first-run configuration. For both Win10 and Linux (assuming you have a typical home Internet installation with a combined modem/router box that “takes care” of network addressing and routing set the network addressing mode to “DHCP” and let everything take its natural course.
  17. The remaining job is to prepare the second HDD as a Linux data drive. Within Linux, Look for an option on the system menu like “Disks” or “Disk Manager” – probably in the “System” or “Utilities” menu. WARNING – Here be dragons! The disk management tools in Linux are very powerful and great care must be taken to ensure you are making changes to the correct disk and have enough knowledge to choose the file system type with which disk partitions you create. Ii is impossible to give specific instructions because depending on the graphical desktop you choose (eg; Gnome, KDE, Mate …) the very tool itself may be different. Generally a vertical panel displays a list of available disks and when a disk is selected its existing partition layout is displayed in a larger horizontal panel.
    1. If you have started with fresh disks identifying the remaining (blank) HDD should be easy – it is the one with no partitions showing when selected.
    2. Select the disk and create one partition using the defaults offered for starting and ending sectors. This will create a single partition using the entire disk. When prompted for the file system type, unless the operation supports more advanced types and you understand the differences between them I suggest you select “ext4”.
    3. Changes made in any of the disk or partition management tools I have used in Linux do not take effect until you consciously instruct them to be written to the disk. This is usually a large “tick” or “Apply” button on a graphical tool or a specific command if using a command line tool such a s gparted. So, check and then check again that you have (a) been making changes to the correct disk and (b) that the partition layout and file system type are as you want … then apply the changes.
    4. Some versions of Linux will automatically recognise the new disk, others will require an addition to the mechanism that automatically mounts disks at boot time. Look for an option (check-box) in the disk management tool to “Load this disk at boot” or something similar. Alternatively, you will have to edit the file /etc/fstab which contains details of which disks are mounted and where. If you are unfamiliar with this mechanism the command line instruction “man fstab” will bring up a manual page describing its operation. Playing around with fstab is ADVANCED Linux management so look for an option in the graphical disk management tool first before making possibly destructive changes to fstab. As ever, back-up important system files before making changes in case you make any disastrous errors.

That should be it – you should now have a dual-boot Win10/Linux machine with each OS booting from and loading applications on the SD and having access to its own 2TB HDD

Conclusion

Finally, this procedure might look long-winded and a bit daunting but part of that is because I have tried to describe WHY actions are being performed and WHAT they are doing to your system. In reality, the process is mountain-sized less onerous and less work than trying to reshuffle partitions that have been scattered about by Anaconda if you take the “easy” installation route.