Home Technology Linux UEFI and DualBoot – Linux Magazine

UEFI and DualBoot – Linux Magazine

0
UEFI and DualBoot – Linux Magazine

If you now go to your computer store to buy a new PC, it will almost always have pre-installed Windows on it. Sometimes you can also get some discount if you don’t want this, but this is often too much work for the shopkeeper (and not entirely unjustly). If the shopkeeper does want to take it off, you won’t care much about the wallet either. So usually you just take that Windows with you. Is the rest of the family also satisfied? (Arjan ten Hoopen)

But then you get the next challenge, Linux. The first step, making space by making the Windows partition a bit smaller, is usually taken quickly. Windows has disk management that makes this easy. But then Linux has to be added. In principle, that is not a big hurdle either. The real challenge is usually in booting. With a bit of bad luck, the system will continue to boot into Windows. You did something wrong somewhere.

UEFI and BIOS

Back to the beginning. In the days of the IBM PC, software, or better, firmware was needed to allow the operating system to talk to the hardware. This firmware is called the BIOS, the Basic Input Output System. The BIOS was also written to make the hardware accessible to the software at the time. Shortly through the bend; what did the BIOS do during boot. Walk through all hardware to see what’s there (Power-On Self Test, also known as POST). Then look for the Master Boot Record (MBR). This is a special sector on the partitioned part of your boot disk. The Master Boot Record contains information about the disk’s file system. After this, the boot loader is activated which then starts booting the operating system.

Beautifully thought out, but in the meantime the earth has turned around the necessary times and we have ended up in a different time. Disk capacity has increased enormously, 64 bit is the norm today (BIOS didn’t go beyond 16). So it was time for a successor. The successor is Unified Extensible Firmware Interface, UEFI for short.

UEFI can handle virtually all bootable disks now and in the future. UEFI itself is “baked” into a flash chip. This also makes it possible to install updates in the future. It also has a large memory and can handle a mouse and keyboard. If you have ever looked around in the UEFI of your own system, you will see that you can set a lot. You could perhaps see the UEFI as a small operating system in itself. An operating system that boots before the “real” operating system boots, in our case Linux.

That all sounds wonderful, and it is, but installing a Linux alongside the pre-installed Windows can lead to many cries of strength being uttered.

In this article I am going to take you by the hand so that a DualBoot system no longer holds any secrets for you. Figure 1 shows an example of a UEFI interface. The motherboard of your computer may come from a different supplier, but the functionality will be almost identical.

UEFI

First you enter the UEFI. After you have turned on your computer, you will probably (very) briefly see a message about how to get into the UEFI. All kinds of keys are used for this, in my system it is DEL. While booting the system, i.e. for Linux/Windows, press DEL and this will take you into the UEFI, see Figure 1. You can set the boot mode, or words to that effect, to UEFI or “Legacy and UEFI” (legacy refers to BIOS here). You have to make sure it is set to UEFI. Every UEFI implementation does this differently, a good starting point can be Search. Remember that UEFI can handle the mouse so you don’t have to navigate with all kinds of strange key combinations. Search for boot, then something will certainly come up with which you can set the boot mode. Set it to UEFI if not already and reboot the system. You then just enter the pre-installed Windows.

install openSUSE

Then insert your installation media into your computer, reboot it and let it boot from the CD/DVD/USB stick. You may have to manually select the boot device for this. In my case this was F11 (press this while booting) and select your boot device. I’m going to install openSUSE as an example. OpenSUSE has different boot screens for UEFI and Legacy boot. Figure 2 shows an example of the screen using openSUSE for UEFI. This gives you the assurance that you are on the right track.

Then perform an installation. Exactly the way you want it. However, when partitioning, you have to do a little trick. This trick is essential! We assume openSUSE, but the procedure is similar for other distributions.

At the partitioning screen during installation, click on the “Expert Partitioning” button and then select “Start with current proposal”. Now delete all partitions related to Linux (root, swap). Very likely there is a (second) /boot/efi partition created with the Linux partitions, delete it too!

In the windows part you will see a partition called “EFI System Partition” (or “EFI boot”). You have to mount this as /boot/efi. With openSUSE, select this partition, click on “modify” and then “Edit Partition”. This will give you properties of this partition. Make sure you do NOT format it, leave the type (EFI System Partition) as is. Do not encrypt but DO mount as /boot/efi.

Then create the partitions you need (minimum a swap of 2 to 4 GB and a root with the rest). Then click [Volgende]. You will then receive a message that the /boot/efi partition is too small (100Mb). Ignore this message is pure scare tactics.

Then continue the installation and make the right choices for you. Reboot at the end of the installation. If you’re lucky you’ll see the GRUB bootloader with choices for Linux and Windows. Do you have this; count yourself lucky. Sometimes it’s bad, sometimes it’s good.

Customize UEFI over Linux

If things go wrong, don’t worry, just reboot and during booting manually choose the boot device (F11 for me). This will give you roughly the list shown in Figure 3. As you can see, the order is wrong. You would like “opensuse” to be chosen automatically at boot (which will take you to GRUB). Select “opensuse” and let the system boot.

Login as root so that you have sufficient permissions to make changes to UEFI from Linux. If you log in as a regular user, you will be using it later su or sudo command must obtain sufficient privileges.

You have seen that the order is not right. Windows was on top, you want opensuse on top. With the tool efibootmgr you can change the order. Run it first with no arguments. You will then see the current configuration. Then run it with the -o option. This allows you to adjust the order. Then again without arguments to validate whether it has become what you expected. In figure 4 you will find the elaboration in an example. That looks good; reboot.

If you’re lucky you’ll see the GRUB bootloader with choices for Linux and Windows. Do you have this; count yourself lucky. Sometimes it’s bad, sometimes it’s good.

Make adjustments in the UEFI

If things go wrong, then still no man overboard. We confidently go deeper into the system. Since it didn’t work from Linux, we have to enter the UEFI. Reboot the system and enter the UEFI. In my case, I had to press DEL. This will bring you back to the screen shown in Figure 1. But we need to dig a little deeper and go to the Advanced settings (F7) for that. See Figure 5. Click on Settings here to go even deeper into the UEFI. You will then arrive at Image 6. Click here on Boot. This will give the screen like Picture 7. We’re getting somewhere now. Under FIXED BOOT ORDER you will see that the UEFI will first search the Hard Disk, if nothing is found there, continue to the CD/DVD etc. Now click on “UEFI Hard Disk Drive BBS Priorities”, which will take you to the screen as shown on Figure 8. That’s where we want to be! If UEFI has found “what”, there may be several options. UEFI always starts with the first (Boot Option #1). By playing, in my case with the + and – keys, you can choose the correct value for each option. The first is of course opensuse. Then save and reboot. The system will now take you to GRUB.

You now have sufficient knowledge to turn your (new) PC into a DualBoot machine. It is possible that the UEFI interface looks a bit different, but with the information from this article you will also find your way around it.

LEAVE A REPLY

Please enter your comment!
Please enter your name here