Fedora triple boot

The goal was to install Windows 10, Fedora 28 and Fedora 27 on a single PC with triple boot option in UEFI mode. Fedora 28 is installed as a workstation while Fedora 27 is configured in non-gui mode. During installation there were few fails and tricks ideal to write it down to this post.

Target PC configuration contains 2 disk drives:

sda – 500GB HDD
sdb – 32GB SSD

Installation process for dual boot (Linux + Windows) is clear. Recommended order is to install Windows 10 first and then Linux as a second OS – this way, you’ll have the smallest headache. In my case, OS installation order was:

1) Windows 10
2) Fedora 28
3) Fedora 27

Windows 10 was installed on 250GB partition of sda disk drive in UEFI mode (second disk is invisible for Win OS). Installation modes can’t be mixed so followed Fedora installations are in UEFI mode as well. Fedora 28 uses sdb as system disk and other partitions are placed on sda. Fedora 27 is configured to use only sda – this is also the smallest OS in this scenario. Here is used disk partitioning:

500GB HDD (first drive)
/dev/sda1    499M Windows recovery env (Win10)
/dev/sda2    100M EFI System           (Win10 & F28 - /boot/efi)
/dev/sda3     16M Microsoft reserved   (Win10)
/dev/sda4    244G Microsoft basic data (Win10 - C disk)
/dev/sda5    400M /boot                (F28)
/dev/sda6    180G /home                (F28)
/dev/sda7     20G /var                 (F28)
/dev/sda8      4G /tmp                 (F28 & F27)
/dev/sda9      4G Linux swap           (F28 & F27)
/dev/sda10   100M EFI System (?)       (F27 - /boot/efi)
/dev/sda11   400M /boot                (F27)
/dev/sda12    13G /                    (F27)

32GB SDD (second drive)
/dev/sdb1   29.8G /                    (F28)

Windows 10 installer will automatically create first three partitions from the list – I had to create only one partition of 250GB. Size of /dev/sda2 is defined by default and it’s big enough to share between Windows 10 and Fedora 28. Generally speaking, it’s big enough for the most dual boot configurations (Windows + Linux). If needed, there is also option to set a custom EFI size:

Create EFI partition before installing Windows 10

Recommendation is to have only one EFI partition per disk drive for different OS but in my case with two identical Linux distributions (Fedora 27 and Fedora 28) is not quite clear. Generally, each OS will create its own folder on EFI partition. Here is list from /dev/sda2 EFI which is used by Windows 10 and Fedora 28:

# ll /boot/efi/EFI/
total 4
drwx------ 2 root root 1024 tra  25 02:36 Boot
drwx------ 6 root root 2048 lip  14 05:08 fedora
drwx------ 4 root root 1024 lip  13 09:01 Microsoft

As you can see, “Boot” and “Microsoft” belong to Windows 10 while folder “fedora” belongs to Fedora 28. The same way Debian distribution will create “debian” folder, Ubuntu “ubuntu” and so on. In scenario with both Fedora distributions, last Fedora installation certainly would overwrite /boot/efi/EFI/fedora directory. To prevent this happen, I decided to create separate EFI partition for Fedora 27 and only share first EFI (created by Win10 installer) for Windows 10 and Fedora 28. This way 100MB of EFI partition is good enough to share between two OS.

To preserve some disk space it’s possible to share swap and /tmp partitions between Fedora 28 and 27. In Fedora 27 installation (last in chain), it’s only needed to define /tmp mount point for the existing /tmp partition (of Fedora 28). On the other hand, swap partition can be left out because it already exist (from previous Fedora 28 installation) and installer will simply reuse it.

At the end just note that /boot and /boot/efi partitions should be on the same disk drive. For Fedora 28 I had idea to put /boot and “/” on the sdb while using shared /boot/efi on sda. This was recognized as an error and installation stopped until /boot partition wasn’t moved to disk sda near to /boot/efi.

Arrangement of grub menu options is whole another story. The easiest way for editing is with grub-customizer utility. At the time of writing this article, version for F28 had some bugs so I installed grub-customizer-5.0.6-6.fc27.x86_64.rpm to Fedora 28. Just run this app, edit displayed options and click save. For UEFI system do not click on “Install to MBR” under File sub-menu. It can mess up grub and you’ll need some extra time for googling and fixing. UEFI systems only save boot options to EFI partitions. To be more precisely, Fedora with grub2 will save grub menu to /boot/efi/EFI/fedora/grub.cfg file. grub.cfg can be also generated with command-line utility grub2-mkconfig. Here is how:

> grub2-mkconfig -o /boot/efi/EFI/fedora/grub.cfg

grub2-mkconfig will scan partitions (search bootable linux kernels, other OS …) and generate grub.cfg to its EFI partition. After reboot, new grub menu should be nicely displayed. Here is the trick, in case with more than one EFI partition, firmware will use EFI partition that is defined in BIOS boot order. Just enter to BIOS setup during booting PC (it’s usually by several presses on Del key), go to Boot menu and edit UEFI boot order. For UEFI system is also recommended to disable legacy boot BIOS mode.

So, in scenario with two EFI partitions, each EFI will have it’s own grub.cfg that can differ. Which one will be used (and displayed) during PC boot depends on BIOS boot order. Because Fedora 27 is installed as non-gui OS, I have used grub-customizer on Fedora 28 to generate grub.cfg and save it normally to its EFI partition on sda2. The same grub.cfg is then copied to Fedora 27 EFI partition sda10 to the same location:

/boot/efi/EFI/fedora/grub.cfg

Hope this post will save you some hair. It took me three times to install triple boot until everything was placed as it should :)

EDIT1

In the meantime I found info about Windows 8/10 update problem related to multiple EFI partitions on one disk. For that reason, I changed /dev/sda10 partition type to “Linux filesystem” and here is how final partition list looks:

500GB HDD (first drive)
/dev/sda1    499M Windows recovery env (Win10)
/dev/sda2    100M EFI System           (Win10 & F28 - /boot/efi)
/dev/sda3     16M Microsoft reserved   (Win10)
/dev/sda4    244G Microsoft basic data (Win10 - C disk)
/dev/sda5    400M /boot                (F28)
/dev/sda6    180G /home                (F28)
/dev/sda7     20G /var                 (F28)
/dev/sda8      4G /tmp                 (F28 & F27)
/dev/sda9      4G Linux swap           (F28 & F27)
/dev/sda10   100M Linux filesystem     (F27 - /boot/efi)
/dev/sda11   400M /boot                (F27)
/dev/sda12    13G /                    (F27)

32GB SDD (second drive)
/dev/sdb1   29.8G /                    (F28)
> fdisk -l
Disk /dev/sda: 465.8 GiB, 500107862016 bytes, 976773168 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 3A0885EA-D632-45C9-9F38-A25B01A2513C

Device         Start       End   Sectors   Size Type
/dev/sda1       2048   1023999   1021952   499M Windows recovery environment
/dev/sda2    1024000   1228799    204800   100M EFI System
/dev/sda3    1228800   1261567     32768    16M Microsoft reserved
/dev/sda4    1261568 512002047 510740480 243.6G Microsoft basic data
/dev/sda5  512002048 512821247    819200   400M Linux filesystem
/dev/sda6  512821248 890308607 377487360   180G Linux filesystem
/dev/sda7  890308608 932251647  41943040    20G Linux filesystem
/dev/sda8  932251648 940640255   8388608     4G Linux filesystem
/dev/sda9  940640256 949028863   8388608     4G Linux swap
/dev/sda10 949028864 949233663    204800   100M Linux filesystem
/dev/sda11 949233664 950052863    819200   400M Linux filesystem
/dev/sda12 950052864 976773119  26720256  12.8G Linux filesystem

Despite of changed partition type to “Linux filesystem” for /dev/sda10, in Fedora 27 sda10 is still mounted as /boot/efi and in df list is presented as vfat. New partition type should be “masked” (non visible) for Windows 10. I hope this trick will bypass potential Win10 “update issue” in the future.

EDIT2

I would like to mention that efibootmgr (userspace application) can be also used to restore/change the default loading order (if needed). As is written in manual, efibootmgr can create and destroy boot entries, change the boot order, change the next running boot option and so on, so be very careful how to use it. Here is nice tutorial with several examples:

Use Linux efibootmgr Command to Manage UEFI Boot Menu

Leave a Comment