Installing Debian alongside another system

When you have another system installed on your computer, you might feel reluctant to give it up for something entirely new. Quite fortunately, you don't have to do that. If you have enough free space on your hard drive, you can keep your existing operating system, be it Window$, macO$, another Linux system, or just about anything else. If you use software that is not available for Linux, this might become an even more important consideration.

What is dual booting

Dual booting simply refers to a set-up, where there are two operating systems installed on the same computer, and you can choose which one you want to load when you first turn the computer on. Window$ does not usually allow for this out of the box (and tends to make it rather hard to set it up, and will try to keep messing it up, especially with EFI), but for Linux, dual-booting is a rather natural state of affairs.

It is not that Window$ developers don't know how to enable their system to dual boot with something else. It's not even that they just don't care. This is just Micro$oft's business model, to take over your PC completely, and establish a monopoly, where nobody else stands a chance. Just think about Window$ 10 forcing its updates right down people's throats at the most inconvenient times. See, with Window$ you don't actually own your PC, the company behind it will dictate how you can use it.

The fact that a simple Window$ update can disable dual booting, or that Window$ itself will do it when on (U)EFI, is intentional behaviour, once again trying to force you to not be able to use your computer in a way you have intended. Your humble(?) author personally disapproves of dual booting with Window$. That monstrosity of an operating system belongs to a safely sandboxed virtual machine, cut off from the internet and the real world, where it cannot collect and send your personal data to God knows where, it cannot infect your computer with malware and viruses, and cannot disrupt your workflow with forced system updates. In there it can be prodded and twisted and experimented with, nay tortured as much as you like.

If you can, do yourself a favour, and get rid of Window$ for good. You can probably have it still running in some virtual machine if you absolutely need stuff that only runs on it, but once you no longer have Window$, your life will immediately be just so much better.

Rant over.

You can dual-boot Linux with anything that can be recognised and booted form a bootloader. Debian uses GRUB2, which means you will probably not run into issues with any modern operating system. You can dual boot with anything, Window$, macO$, BSD, other Linux systems, or even a second Debian installation, and you can have as many systems installed as your hard drive can hold (in which case "dual booting" is no longer the right term, probably "multi-booting" would be better).

Seen that little word there and wondered what that was? Who would need their boots loaded? When you start your computer, the first thing to run (after initial BIOS/EFI things) is a bootloader, that will then load the operating system. Each operating system, even Window$ and macO$, have their own bootloaders, only they are transparent, and usually not accessible to you.

With Linux, and especially GRUB, the bootloader is fully configurable, you can basically set it up in any way you like. A bootloader like GRUB can recognise and load different operating systems and has handy features to allow you to choose at boot time, like e.g. a list-style menu, which can optionally include even a sub-menu system. It also has a minimal shell, where you can execute commands before booting, or customise how a system would be booted.

Want to learn more about bootloaders? Check out this page

Prepare your system for dual booting

To dual-boot Debian with another system, you will have to do one thing first: make room for it. Most probably your existing operating system takes up all the space on the disk. To install Debian alongside it, you will need to shrink that system on the disk and leave some empty (unallocated) disk space. The rest would be pretty easy from there on.

To shrink a disk volume or partition, you will have several options:

  • In Window$, you can use "Manage Disks"
  • You can use a dedicated tool, Like a GParted live CD
  • You can use a live Debian image, or almost any "live" Linux live distribution.
  • you can use whatever people usually use on macO$

To repartition your hard drive, follow one of the following guides

Absolutely always make a backup of your data, before attempting to partition a hard drive. This is not optional. Managing partitions can easily end up in data loss. (Think of a disaster scenario, like a sudden power-cut, if you're just too smug in your belief that nothing bad will ever happen to you.) Also, make sure you store that backup somewhere else, like the cloud, another PC, or some removable media. (Sounds obvious, but you never know...)

Anyway, you've been warned. Also, you will do this at your own risk, the author of this document, or the website, the website owner, or anyone apart from you has zero responsibility for any loss or damage you cause with your careless behaviour. Huh!

While it might look a lot simpler than using any of the other listed methods, shrinking a Window$ volume from within Window$ itself has its limitations. One issue you will most likely encounter is the fact that Window$ cannot shrink a volume beyond the point where any unmovable files are located, and might even tell you so in a pop-up message.

Such unmovable files can be files associated with hibernation, virtual memory, and system protection. There is a detailed and easy to follow tutorial on download3k.com, that can help if you encounter such issues.

To shrink the Window$ volume from within Window$ itself, follow these simple steps:

  • Open Window$ Explorer, right-click Computer and select Manage

Select this

  • In the window that opens, right-click the drive letter on which Window$ is installed (usually C:), and select Shrink volume

Shrink that volume

  • In the popup window that appears, find the size of available shrink space (1). This will tell you the maximum amount of free space you can create with shrinking the volume.
  • When you know the maximum amount, set the actual amount of free space you want to create (2). About 10GB is recommended as a minimum for Debian, but you would probably want to have more to be sure to have enough space for your files and data and to be able to use your system comfortably. How much space you should really have for it depends on many factors. Will you store large files (like media files), or will you just browse the web? Consider your options carefully, it is a lot easier to make the right amount of space now, than to adjust things later. If in doubt, go for 50% of the total drive space, if that would be available, or as close to it as you can.
  • Then click Shrink (3)

Keep shrinking

There is a problem, or more like an inconvenience with how Window$ Volume Manager works: You'll never know the progress of the operation. You will only see a spinning cursor, and no progressbar or anything to tell you how much you still need to wait. Considering that shrinking of large volumes can take up to several minutes or even hours, it can feel like your system is just locked, or frozen. As is often the case with Window$, you only need to be patient. Although probably for a long time.

And you're done. You will now have sufficient space to install Debian alongside M$ Window$.

If you feel adventurous, or want to try something different, you are not running Window$, and not sure what to do, or just want more control over the whole process, you can use a tool called Gnome Partition Editor, or in short, GParted.

GParted itself runs on Linux, and if you don't have Linux installed, you can also use a Live CD. The GParted live environment is a minimal Linux system, designed to run GParted and not much else. To download and use GParted Live, visit the official website, where you will find detailed download and usage guides, including how to burn it onto a bootable medium, such as a CD or USB stick.

Once you have created a bootable GParted system, reboot your computer, make sure you boot from the removable medium, and follow these instructions:

  • Unless your system has specific needs, and you know what you're doing, choose the default option from the boot menu

GParted GRUB menu

  • Since we are not going to do anything keyboard-heavy, you can go with the default keymap. Select Don't touch keymap and press enter

GParted keymap selection menu

  • Select your language. If you can. You are supposed to know what your language is called in English, even if you don't speak English. Well, the thought is what counts here, isn't it?

GParted language menu

  • Just before you'd think you'll get away easy, you have yet again to choose. This time it's a helpful prompt about starting the graphical environment. Selecting 0 will launch it automatically. Instructions about what to do if it fails are provided as well.

GParted graphical environment selector

  • Once the graphical UI has loaded, launch the GParted application by double-clicking its icon (1) if it has not launched automatically.

  • In the GParted application, select the appropriate volume (2). The selected volume's graphical representation will also be highlighted (3) and marked with the already discussed /dev/sdxXvolume name (e.g. /dev/sda2, as pictured). This is slightly more difficult than it is in Window$ because the Window$ drive letters do not apply here, so they will not appear. What you do not want to select is the partition that is marked System Reserved, or anything that has "boot" or "EFI" written on it. If it's a simple Window$ installation, you will just have to go for the largest partition. If you have multiple partitions, select the last one, or the one that has enough empty space on it to be shrunk.

GParted application

  • When you've selected the appropriate partition, press Resize/Move from the top menu (1). A popup window will appear.

  • In the popup window, you can grab the handle showing on the partition's graphical representation, and drag to resize it visually (2), or just enter the desired size in the New Size input box. About 10GB is recommended as a minimum, you would probably want to have more to be sure to have enough space for your files and data, and to be able to use your system comfortably. How much space you should really have for it, depends on many factors. Will you store large files (like media files), or will you just browse the web? Consider your options carefully, it is a lot easier to make the right amount of space now, than to adjust things later. If in doubt, go for 50% of the total drive space, if that would be available, or as close to it as you can.

  • When you have set the desired size, press the ambiguously named Resize/Move button on the popup window (3)

GParted resize

  • GParted is now showing the final layout but had not changed anything yet. This step is as important as it is useful. You can still change your mind, as resizing a partition is a potentially dangerous operation.

GParted resizing result

  • if you are satisfied with what you see, or are not satisfied but have no choice but to proceed, then do proceed by pressing Apply (1. A popup will warn you of the possible dangers of doing so. Tell it that you're a responsible grown adult, by pressing Apply (2) again.

GParted apply changes

  • Then sit back and enjoy as partitions are being resized, data is possibly being destroyed, and know that your life will never, ever be the same again.

GParted applying changes

  • When it's all done, you can reboot your PC, remove the GParted medium, and proceed with the installation.

You can, of course, use a Debian live image to prepare your system, although it will need a little preparation, such as installing software and setting a temporary root password.

Nothing you do in the live environment will be permanent, apart from the partitioning itself. The root password, as well as the additionally installed software, will be temporary, and only available until you reboot your PC.

Following the instructions below, you will be able to resize your Window$ partition using Debian Live KDE. You can also do this with other editions, but the software used will probably differ. E.g. the terminal might be called something else (often just "terminal"), and for a partition editor, you might be better off installing gparted if not going with the KDE version.

  • Boot the Live DVD, press the menu icon (the little "K" in the lower left corner), type "konsole", and click on the Konsole application that appears in the results. Konsole is a terminal emulator, in which you can run commands as if you were logged in to a CLI only terminal.

Open a terminal

  • Into the Konsole window, type the following: sudo apt update && sudo apt install partitionmanager, then press y to accept the prompt and wait for the installation to finish.

Install partition manager

sudo is not normally configured on your fresh installation, but the live environment will allow you to use it without a password. The installation itself will, of course, be temporary.

  • Next, you will need to set up a temporary root password for your live environment, it will be necessary for the next steps. You can use the passwd command to set a new password for root, by typing sudo passwd root into the terminal. You will be prompted to enter a new password. Enter it, then press Enter. Then you will need to confirm the password, and you're done.

Set temp root pwd

When you use the passwd command to set a password, there will be no visible cursor and no hint as to what you are typing at all. This is normal and serves a simple security purpose of obfuscation. If someone is looking over your shoulder, or later accesses the terminal logs, there will be no indicator as to how long your password is, making it so much more difficult to guess and/or crack.

  • Close the terminal, and return to the application menu. Search for "partition manager" (typing "partition" should suffice), then launch the application by clicking on it.

Launch partition manager

  • You will be prompted for the root password. So good that you've set one up just now. Type the password you've set, and click OK.

Root pwd propmt

  • When KDE partition manager opens up, it will be very similar to what you might see in gparted (see other tab), only a lot prettier.

The partition manager

From here on, the instructions will be exactly the same as for GParted.

One small although significant difference is that the KDE partition manager will visually mark the available free space on a partition, making it somewhat easier to resize by dragging.

  • In the GParted application, select the appropriate volume (1). The selected volume's graphical representation will also be highlighted (2) and marked with the already discussed sdxXvolume name (e.g. sda2, as pictured). This is slightly more difficult than in Window$ because the Window$ drive letters do not apply here, so they will not appear. What you do not want to select is the partition that is marked System Reserved, or anything that has "boot" or "EFI" written on it. If it's a simple Window$ installation, you will just have to go for the largest one. If you have multiple partitions, select the last one, or the one that has enough empty space on it to be shrunk.

KDE Partition Manager application

  • When you've selected the appropriate partition, press Resize/Move from the top menu (1). A popup window will appear.

  • In the popup window, you can grab the handle showing on the partition's graphical representation, and drag to resize it visually (2), or just enter the desired size in the Size input box. About 10GB is recommended as a minimum, but you would probably want to have more to be sure to have enough space for your files and data and to be able to use your system comfortably. How much space you should really have for it depends on many factors. Will you store large files (like media files), or will you just browse the web? Consider your options carefully, it is a lot easier to make the right amount of space now, than to adjust things later. If in doubt, go for 50% of the total drive space, if that would be available, or as close to it as you can.

  • When you have set the desired size, press OK on the popup window (3)

Partition manager resize

  • Partition Manager is now showing the final layout but had not changed anything yet. This step is as important as it is useful. You can still change your mind, as resizing a partition is a potentially dangerous operation.

Resizing result

  • if you are satisfied with what you see, or are not satisfied but have no choice but to proceed, then do proceed by pressing Apply (1). A popup will warn you of the possible dangers of doing so. Tell it that you're a responsible grown adult, by pressing Apply Pending Operations (2) on the popup menu.

Partition manager apply changes

  • Then sit back and enjoy as partitions are being resized, data is possibly being destroyed, and know that your life will never, ever be the same again.

Partition manager applying changes

  • When it's all done, you can reboot your PC, remove the live medium, and/or proceed with the installation.

As your humble author has no access to a Mac (or even a Macbook), these instructions are missing and will remain absent until somebody either gives me a lot of money or donates such a computer.

To be honest, I once thought about buying a Mac. I had the money together. Then I thought better of it, and from the same money I bought a house, a car, went for a long holiday, then from the remainder I bought a powerful PC, which I'm using to write this right now. But I'm sure Macs are worth it.

Accessing Window$ files from your dual-booted system

Jumping ahead of time a little, it's worth mentioning, that although Window$ will continue to treat any dual-booted system as non-existent, and pretend that it's the only OS on your machine, from Linux you will be able to access and use your Window$ files.

Window$ partition mounted

This is both a risk and a great convenience. A risk, because you can accidentally delete/modify important Window$ system files from Debian, rendering your Window$ installation unusable, but also a convenience, because sharing files between the two systems will be seamless.

In the following chapters, a detailed tutorial will be provided following which you will be able to safely access user documents from Window$, without compromising system files.