Setting up a multi-boot of 5 Linux distributions

with Windows on the side

Manu Järvinen
Jan 17, 2017 · 24 min read

This article is aimed at distro hoppers who like to install multiple Linux distributions to their system drive and to be able to replace them with minimal effort when new ones come along. This is written especially digital artists and Blender users in mind. However, this article is only about the modern motherboards that have a UEFI BIOS. Required skill level: pretty much a beginner.

If you’re anything like me, about every six months you get the urge to wipe your system-disk and start from scratch and see how the latest Linux distributions have developed and if this time some other one suits you better than your current favorite — while trying to do all this in quick, predictable and optimized manner, not spending hours and hours for setting it all up.

Why a multi-boot of 5?

Simply put, to try out and experiment with new constantly developing distros while still keeping the stable working favorite ones available in order to get some work done.

NVIDIA drivers

When installing a new distro, the most important thing I’m looking for is to have CUDA available in Blender’s settings as easily as possible in order to enable GPU rendering (using your graphics card to render instead of the processor, crazy fast). More about this in this article I wrote: Installing NVIDIA drivers in Linux.

Wacom tablets

Another feature I’m looking for in distros is the support for a Wacom tablet.

Wacom Tablet control panel in Elementary OS

Other things

Other things I’m looking for in distros are:

  1. The overall enjoyability of usage
  2. Performance
  3. Visual appeal

The Plan

My plan was to have 5 different Linux distributions on my system and to be able to ditch and replace any of them without affecting any of the others or the boot manager.

The Plan: the Refind boot manager and some easily switchable distros.

1. Preparation

Without knowing any better, for my previous configuration I had just thrown my system SSD hard drive onto a random SATA port in the motherboard. That caused my secondary 3TB storage drive to be displayed as the first disk in my UEFI BIOS instead of the main SSD system disk. So when it was time to partition the system disk and install an operating system into the SSD, it was seen as /dev/sdb (the second hard drive in the computer) instead of /dev/sda (the first hard drive in the computer). It was a bit annoying, even though it was pretty much only a cosmetic thing.

The “dev” in /dev/sda means the devices directory. “Sda” means SCSI disk A.

Upper image: SATA port number one in motherboard’s manual. Lower image: in UEFI BIOS
Bootable distro USB sticks

2. Installing the first OS and the Refind boot manager

I used Xubuntu as the first operating system on my system disk. I’ve used it a lot, I’m very familiar with it and it’s one of my favorite distros. It’s also Ubuntu-based, which makes it easy to run the Refind boot manager’s installer .deb file whenever needed.

2.1 Create a new GPT partition table for the whole physical system disk

I wanted to use Refind as the boot manager for my system. For it to work, the system disk needs to have a modern GUID partition table (GPT) instead of the old MBR partition table (‘msdos’ in GParted). For modern UEFI BIOS motherboards and especially for 2 TB or larger hard drives there is no sense in using MBR anymore pretty much at all, as far as I know. Please, correct me if I’m wrong, feedback is appreciated :)

UEFI BIOS boot menu, by pressing F8 during boot. Selecting the USB stick.
Ctrl + Esc opens up the Whisker menu in Xubuntu
Wiping the whole system disk and creating a new GPT partition table for it.
The whole slate is clean!

2.2 Partitioning

The most important step here is to make the first partition (/dev/sda1) as an EFI System Partition (ESP). This is where the brains of the system booting will eventually go, the Refind boot manager.

Deepin needed more than 100MB for the EFI System Partition
Partitioning done, ready to apply all operations
Fedora required the biosboot type of partition. Swap also seemed to be mandatory.
Installation failed because of not putting the boot flag for the first EFI BOOT partition
Adding the boot flag and bios_grub flag to the partitions #1 and #2
Applying all operations and starting the installing of Xubuntu

2.3 Installing Xubuntu

During the installation of Xubuntu, I made mount points for the to-be-installed Xubuntu and for the Work and Storage partitions:

  • /work ( /dev/sda12, 25 GB EXT4 in the SSD)
  • /storage ( /dev/sdb1, 3 TB NTFS hard disk )

2.3.1 Temporary boot loader

For the ‘Device for boot loader installation’ section I always will choose /dev/sda in all of my distro installations.

2.4 User rights to write to the Work and Storage partitions

After the installation was finished, I noticed I can’t make folders or files to the root of the /storage or /work partitions. So, I went to the newly installed Xubuntu and started a terminal window via Ctrl+Alt+T. In some other Linuxes the terminal shortcut might be something else.

# See what's your user ID (for me it's mj):
id -u -n# Give write rights for the user:sudo chown mj /storage/sudo chown mj /work/# A single chained command might work also to do the same thing: sudo chown mj /storage/ /work/

2.5 Installing the Refind boot manager

A bit about boot managers’ and a boot loaders’ differences. From Refind’s webpage:

”Refind is a boot manager, meaning that it presents a menu of options to the user when the computer first starts up, as shown below. Refind is not a boot loader, which is a program that loads an OS kernel and hands off control to it.”

“Since version 3.3.0, the Linux kernel has included a built-in boot loader and that the older GRUB that many of us are used to use is both a boot manager and a boot loader.”

Download the latest version (0.10.4–1 at the time of writing this article) of Refind .deb file from here.

# Downloading refind_0.10.4-1_amd64.deb to the Downloads folder in Home (~/Downloads):wget -P ~/Downloads/ https://downloads.sourceforge.net/project/refind/0.10.4/refind_0.10.4-1_amd64.deb
Triple-clicking to select a command, Ctrl+C to copy it to the clipboard and then Ctrl+Shift+V to paste it into the Terminal
sudo dpkg -i ~/Downloads/refind_0.10.4-1_amd64.deb
Installing Refind

2.6 Finding a theme for the Refind boot manager

Here are some Refind themes I found from GitHub. Before installing, check from the link if it has all the icons for the distros you’re going to use.



2.7 Installing the theme Regular for the Refind boot manager

# Install git:sudo apt install git# Get rights to enter the EFI folder (because some distros prevent you going there 
(Note, also could work: sudo bash or su or sudo -s)):sudo -i# check if sda1 is mounted to /boot/efilsblk
# make an efi folder (if it isn't already there)mkdir /boot/efi/# Mount /dev/sda1 to /boot/efimount /dev/sda1 /boot/efi/
# Delete possible older installed versions of this theme (always be extra careful when using the rm (remove files) command with Root rights, accidental deleting of important stuff is not fun):rm -rf /boot/efi/EFI/refind/{regular-theme,refind-theme-regular}# Fetch the Regular theme:git clone https://github.com/munlik/refind-theme-regular.git /boot/efi/EFI/refind/refind-theme-regular# Remove unused stuff:rm -rf /boot/efi/EFI/refind/refind-theme-regular/{src,.git}
# Use the command line interface (CLI) text editor Nano to edit the Refind's configure file:nano /boot/efi/EFI/refind/refind.conf# Use Ctrl+W to search for this sentence:resolution 3# Under that line, write:resolution 1600 1200# (For me, 1600 1200 was the maximum. You can try larger resolutions if you wish. When you boot, it will tell you the accepted choices for your system. After that you can come back to edit this file again.)# Hit Page Down until you reach the end of the document.
# Paste (Ctrl+Shift+V) the following line there:include refind-theme-regular/theme.conf# Quit Nano with Ctrl+X.
# Save the current document by pressing Y and Enter.# If you made any mistakes for some reason (there's no undo as far as I know), it's recommendable to quit Nano with Ctrl+X and answering no and starting from the beginning.# To adjust icon size and font size edit theme.conf (however, the default size is quite nice already): 
nano /boot/efi/EFI/refind/refind-theme-regular/theme.conf# Exit the Root session:exit
Refind boot menu with annoying extra ‘ubuntu’ choice and some pink firmware update icon
# Open the Thunar file manager with Root rights:sudo thunar
Moving ‘ubuntu’ folder into IGNORE folder in /boot/efi/EFI/
/boot/efi/EFI/
# Reboot the computer (It’s instant, make sure you don’t have anything important or unsaved open):sudo reboot
Refind boot manager installed.

3. Installing the second operating system

Ubuntu GNOME was waiting next in the distro line to get in:

Setting up installation mount point for Ubuntu GNOME
Weird USB stick error. It happened after Ubuntu GNOME installation had been successfully finished, but the computer refused to reboot.
Choosing Xubuntu in Grub boot menu. It’s confusingly named as Ubuntu.
sudo dpkg -i ~/Downloads/refind_0.10.4-1_amd64.deb
Refind installer recognizing the customizations and configurations on re-install
sudo reboot
There’s the extra ‘ubuntu’ choice again (left Ubuntu icon) and Refind shows Ubuntu GNOME as normal Ubuntu (right Ubuntu icon)
# Check what the ubuntu gnome´s partition is with GParted, for example. In this case, sda5# Mount Ubuntu GNOME's sda5 partition:sudo mkdir /mnt/ubuntugnomesudo mount /dev/sda5 /mnt/ubuntugnome# Copy the Ubuntu GNOME icon to the root of sda5:sudo cp /boot/efi/EFI/refind/refind-theme-regular/icons/128-48/os_ubuntugnome.png /mnt/ubuntugnome/.VolumeIcon.png# Unmount:sudo umount /mnt/ubuntugnome
# Open the Thunar file manager with Root rights:sudo thunar
Overwriting files in /boot/efi/EFI/IGNORE/
sudo reboot

4. Installing the third operating system

Manjaro XFCE’s turn.

5. Installing the fourth operating system

Time to install Lubuntu to /dev/sda7:

On my way to the Xubuntu (/dev/sda4) option after installing Lubuntu. It’s still confusingly named as Ubuntu.
sudo dpkg -i ~/Downloads/refind_0.10.4-1_amd64.debsudo reboot
sudo thunar
sudo reboot

6. Installing the fifth operating system

Kubuntu.

sudo dpkg -i ~/Downloads/refind_0.10.4-1_amd64.deb
Going back to Xubuntu (/dev/sda4) after installing Kubuntu

7. Installing Windows 7

Then I install windows 7 to the partition 13.

The Windows 7 DVD
Installing Windows

Service Pack 1 and Microsoft Security Essentials

If you need to get the Windows 7 Service Pack 1, like I did (in order to play Steam games), they’ve really seen effort to hide it here and the correct file you want to download (for Windows 7 64-bit) after pressing the red download button is named: windows6.1-KB976932-X64.exe — very convenient, eh?

Changing boot option number one from Windows to Refind in the UEFI BIOS
Clean boot manager once again!

8. Making a Refind rescue USB stick

This is totally optional, but it’s handy to have a USB Refind rescue stick for any distro hopper. There can be times when you need to open the Refind boot manager menu if something has happened to the original one.

# Check what's your USB sticks name (ie. /dev/sdc)
lsblk# Writing refind-flashdrive-0.10.4.img to /dev/sdc:sudo dd if=refind-flashdrive-0.10.4.img of=/dev/sdc
Writing Refind USB flash drive image file to a USB stick
Using the Refind USB Rescue from the USB stick

9. Tweaks

If you want to add the small gray arrow seen in the following Refind image below (and a circle image for selecting the small icons in Refind), do in Xubuntu:

# Get the arrow image. Backup the original selection-big.png as selection-big_original.png. Put arrow image in its place:sudo wget http://i.imgur.com/Kax1bn7.png -P /boot/efi/EFI/refind/refind-theme-regular/icons/128-48/ && sudo mv /boot/efi/EFI/refind/refind-theme-regular/icons/128-48/selection-big.png /boot/efi/EFI/refind/refind-theme-regular/icons/128-48/selection-big_original.png && sudo mv /boot/efi/EFI/refind/refind-theme-regular/icons/128-48/Kax1bn7.png /boot/efi/EFI/refind/refind-theme-regular/icons/128-48/selection-big.png# Get the small circle image. Backup the original selection-small.png as selection-small_original.png. Put small circle image in its place:sudo wget http://i.imgur.com/odu8ol2.png -P /boot/efi/EFI/refind/refind-theme-regular/icons/128-48/ && sudo mv /boot/efi/EFI/refind/refind-theme-regular/icons/128-48/selection-small.png /boot/efi/EFI/refind/refind-theme-regular/icons/128-48/selection-small_original.png && sudo mv /boot/efi/EFI/refind/refind-theme-regular/icons/128-48/odu8ol2.png /boot/efi/EFI/refind/refind-theme-regular/icons/128-48/selection-small.png
sudo reboot
Final 5-way multi-boot achieved! (And Windows)

10. Resizing partitions

Cropped screenshots from GParted
Shrinking and moving a lot of partitions and expanding one in GParted
Applying all operations in GParted

11. Notes after installing different distros

Here are some notes from my earlier distro experiments, like installing OpenSUSE or Deepin.

Pressing F2 in Refind in order to get to boot item’s options
Pressing F2 again and typing ‘nomodeset’ to instruct the kernel to not load video drivers
Finding out the .efi files I wanted to sweep away from the Refind boot manager
Cleaner boot manager. (And the disk icon badges that were visible in an earlier Refind version)

12. My current favorite distros

As of 2017–01–01

  1. Zorin OS (12 Beta) (great for beginners or people coming from Windows)
  2. Ubuntu
  3. Solus OS (great for beginners but feels a bit unfinished for me)
  4. Ubuntu GNOME
  5. Lubuntu
  6. elementary OS (great for beginners, or people coming from Mac OS X)
  7. Manjaro XFCE (a bit technical but great and light. Krita OpenGL was slow, though)
  8. Debian
  9. Kubuntu


Thank you: Jeffrey Hoover

2016


Manu Järvinen

Written by

Animator, 3D modeler and illustrator. Likes open-source stuff like Blender, Linux, Gimp & Krita. And Demoscene. Support me on Patreon.com/manujarvinen